backlog-js 0.16.0 → 0.17.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/dist/index.mjs ADDED
@@ -0,0 +1,1229 @@
1
+ import { t as __exportAll } from "./chunk-CfYAbeIz.mjs";
2
+ import * as qs from "qs";
3
+ //#region src/error.ts
4
+ var error_exports = /* @__PURE__ */ __exportAll({
5
+ BacklogApiError: () => BacklogApiError,
6
+ BacklogAuthError: () => BacklogAuthError,
7
+ BacklogError: () => BacklogError,
8
+ UnexpectedError: () => UnexpectedError
9
+ });
10
+ var BacklogError = class extends Error {
11
+ _name;
12
+ _url;
13
+ _status;
14
+ _body;
15
+ _response;
16
+ constructor(name, response, body) {
17
+ super(response.statusText);
18
+ this._name = name;
19
+ this._url = response.url;
20
+ this._status = response.status;
21
+ this._body = body;
22
+ this._response = response;
23
+ }
24
+ get name() {
25
+ return this._name;
26
+ }
27
+ get url() {
28
+ return this._url;
29
+ }
30
+ get status() {
31
+ return this._status;
32
+ }
33
+ get body() {
34
+ return this._body;
35
+ }
36
+ get response() {
37
+ return this._response;
38
+ }
39
+ };
40
+ var BacklogApiError = class extends BacklogError {
41
+ constructor(response, body) {
42
+ super("BacklogApiError", response, body);
43
+ }
44
+ };
45
+ var BacklogAuthError = class extends BacklogError {
46
+ constructor(response, body) {
47
+ super("BacklogAuthError", response, body);
48
+ }
49
+ };
50
+ var UnexpectedError = class extends BacklogError {
51
+ constructor(response) {
52
+ super("UnexpectedError", response);
53
+ }
54
+ };
55
+ //#endregion
56
+ //#region src/request.ts
57
+ var Request = class {
58
+ fetch;
59
+ constructor(configure) {
60
+ this.configure = configure;
61
+ this.fetch = configure.fetch ?? globalThis.fetch;
62
+ }
63
+ get(path, params) {
64
+ return this.request({
65
+ method: "GET",
66
+ path,
67
+ params
68
+ }).then(this.parseJSON);
69
+ }
70
+ post(path, params) {
71
+ return this.request({
72
+ method: "POST",
73
+ path,
74
+ params
75
+ }).then(this.parseJSON);
76
+ }
77
+ put(path, params) {
78
+ return this.request({
79
+ method: "PUT",
80
+ path,
81
+ params
82
+ }).then(this.parseJSON);
83
+ }
84
+ patch(path, params) {
85
+ return this.request({
86
+ method: "PATCH",
87
+ path,
88
+ params
89
+ }).then(this.parseJSON);
90
+ }
91
+ delete(path, params) {
92
+ return this.request({
93
+ method: "DELETE",
94
+ path,
95
+ params
96
+ }).then(this.parseJSON);
97
+ }
98
+ request(options) {
99
+ const { method, path, params = {} } = options;
100
+ const { apiKey, accessToken, timeout, userAgent } = this.configure;
101
+ const query = apiKey ? { apiKey } : {};
102
+ const headers = {};
103
+ const init = {
104
+ method,
105
+ headers
106
+ };
107
+ if (timeout) init["timeout"] = timeout;
108
+ if (!apiKey && accessToken) headers["Authorization"] = "Bearer " + accessToken;
109
+ if (userAgent) headers["User-Agent"] = userAgent;
110
+ if (typeof window !== "undefined") init.mode = "cors";
111
+ if (method !== "GET") if (params instanceof FormData) init.body = params;
112
+ else {
113
+ headers["Content-type"] = "application/x-www-form-urlencoded";
114
+ init.body = this.toQueryString(params);
115
+ }
116
+ else Object.keys(params).forEach((key) => query[key] = params[key]);
117
+ const queryStr = this.toQueryString(query);
118
+ const url = `${this.restBaseURL}/${path}` + (queryStr.length > 0 ? `?${queryStr}` : "");
119
+ return this.fetch(url, init).then(this.checkStatus);
120
+ }
121
+ checkStatus(response) {
122
+ return new Promise((resolve, reject) => {
123
+ if (200 <= response.status && response.status < 300) resolve(response);
124
+ else response.json().then((data) => {
125
+ if (response.status === 401) reject(new BacklogAuthError(response, data));
126
+ else reject(new BacklogApiError(response, data));
127
+ }).catch(() => reject(new UnexpectedError(response)));
128
+ });
129
+ }
130
+ parseJSON(response) {
131
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") return Promise.resolve(void 0);
132
+ return response.json();
133
+ }
134
+ toQueryString(params) {
135
+ const formatted = {};
136
+ Object.keys(params).forEach((key) => {
137
+ const value = params[key];
138
+ if (key.startsWith("customField_") && Array.isArray(value)) value.forEach((v, i) => {
139
+ formatted[`${key}[${i}]`] = v;
140
+ });
141
+ else formatted[key] = value;
142
+ });
143
+ return qs.stringify(formatted, { arrayFormat: "brackets" });
144
+ }
145
+ get webAppBaseURL() {
146
+ return `https://${this.configure.host}`;
147
+ }
148
+ get restBaseURL() {
149
+ return `${this.webAppBaseURL}/api/v2`;
150
+ }
151
+ };
152
+ //#endregion
153
+ //#region src/backlog.ts
154
+ var Backlog = class extends Request {
155
+ constructor(configure) {
156
+ super(configure);
157
+ }
158
+ /**
159
+ * https://developer.nulab.com/docs/backlog/api/2/get-space/
160
+ */
161
+ getSpace() {
162
+ return this.get("space");
163
+ }
164
+ /**
165
+ * https://developer.nulab.com/docs/backlog/api/2/get-recent-updates/
166
+ */
167
+ getSpaceActivities(params) {
168
+ return this.get("space/activities", params);
169
+ }
170
+ /**
171
+ * https://developer.nulab.com/docs/backlog/api/2/get-space-logo/
172
+ */
173
+ getSpaceIcon() {
174
+ return this.download("space/image");
175
+ }
176
+ /**
177
+ * https://developer.nulab.com/docs/backlog/api/2/get-space-notification/
178
+ */
179
+ getSpaceNotification() {
180
+ return this.get("space/notification");
181
+ }
182
+ /**
183
+ * https://developer.nulab.com/docs/backlog/api/2/update-space-notification/
184
+ */
185
+ putSpaceNotification(params) {
186
+ return this.put("space/notification", params);
187
+ }
188
+ /**
189
+ * https://developer.nulab.com/docs/backlog/api/2/get-space-disk-usage/
190
+ */
191
+ getSpaceDiskUsage() {
192
+ return this.get("space/diskUsage");
193
+ }
194
+ /**
195
+ * https://developer.nulab.com/docs/backlog/api/2/post-attachment-file/
196
+ */
197
+ postSpaceAttachment(form) {
198
+ return this.upload("space/attachment", form);
199
+ }
200
+ /**
201
+ * https://developer.nulab.com/docs/backlog/api/2/get-user-list/
202
+ */
203
+ getUsers() {
204
+ return this.get(`users`);
205
+ }
206
+ /**
207
+ * https://developer.nulab.com/docs/backlog/api/2/get-user/
208
+ */
209
+ getUser(userId) {
210
+ return this.get(`users/${userId}`);
211
+ }
212
+ /**
213
+ * https://developer.nulab.com/docs/backlog/api/2/add-user/
214
+ */
215
+ postUser(params) {
216
+ return this.post(`users`, params);
217
+ }
218
+ /**
219
+ * https://developer.nulab.com/docs/backlog/api/2/update-user/
220
+ */
221
+ patchUser(userId, params) {
222
+ return this.patch(`users/${userId}`, params);
223
+ }
224
+ /**
225
+ * https://developer.nulab.com/docs/backlog/api/2/delete-user/
226
+ */
227
+ deleteUser(userId) {
228
+ return this.delete(`users/${userId}`);
229
+ }
230
+ /**
231
+ * https://developer.nulab.com/docs/backlog/api/2/get-own-user/
232
+ */
233
+ getMyself() {
234
+ return this.get("users/myself");
235
+ }
236
+ /**
237
+ * https://developer.nulab.com/docs/backlog/api/2/get-user-icon/
238
+ */
239
+ getUserIcon(userId) {
240
+ return this.download(`users/${userId}/icon`);
241
+ }
242
+ /**
243
+ * https://developer.nulab.com/docs/backlog/api/2/get-user-recent-updates/
244
+ */
245
+ getUserActivities(userId, params) {
246
+ return this.get(`users/${userId}/activities`, params);
247
+ }
248
+ /**
249
+ * https://developer.nulab.com/docs/backlog/api/2/get-received-star-list/
250
+ */
251
+ getUserStars(userId, params) {
252
+ return this.get(`users/${userId}/stars`, params);
253
+ }
254
+ /**
255
+ * https://developer.nulab.com/docs/backlog/api/2/count-user-received-stars/
256
+ */
257
+ getUserStarsCount(userId, params) {
258
+ return this.get(`users/${userId}/stars/count`, params);
259
+ }
260
+ /**
261
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-issues/
262
+ */
263
+ getRecentlyViewedIssues(params) {
264
+ return this.get("users/myself/recentlyViewedIssues", params);
265
+ }
266
+ /**
267
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-projects/
268
+ */
269
+ getRecentlyViewedProjects(params) {
270
+ return this.get("users/myself/recentlyViewedProjects", params);
271
+ }
272
+ /**
273
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-recently-viewed-wikis/
274
+ */
275
+ getRecentlyViewedWikis(params) {
276
+ return this.get("users/myself/recentlyViewedWikis", params);
277
+ }
278
+ /**
279
+ * https://developer.nulab.com/docs/backlog/api/2/get-status-list-of-project/
280
+ */
281
+ getProjectStatuses(projectIdOrKey) {
282
+ return this.get(`projects/${projectIdOrKey}/statuses`);
283
+ }
284
+ /**
285
+ * https://developer.nulab.com/docs/backlog/api/2/get-resolution-list/
286
+ */
287
+ getResolutions() {
288
+ return this.get("resolutions");
289
+ }
290
+ /**
291
+ * https://developer.nulab.com/docs/backlog/api/2/get-priority-list/
292
+ */
293
+ getPriorities() {
294
+ return this.get("priorities");
295
+ }
296
+ /**
297
+ * https://developer.nulab.com/docs/backlog/api/2/get-project-list/
298
+ */
299
+ getProjects(params) {
300
+ return this.get("projects", params);
301
+ }
302
+ /**
303
+ * https://developer.nulab.com/docs/backlog/api/2/add-project/
304
+ */
305
+ postProject(params) {
306
+ return this.post("projects", params);
307
+ }
308
+ /**
309
+ * https://developer.nulab.com/docs/backlog/api/2/get-project/
310
+ */
311
+ getProject(projectIdOrKey) {
312
+ return this.get(`projects/${projectIdOrKey}`);
313
+ }
314
+ /**
315
+ * https://developer.nulab.com/docs/backlog/api/2/update-project/
316
+ */
317
+ patchProject(projectIdOrKey, params) {
318
+ return this.patch(`projects/${projectIdOrKey}`, params);
319
+ }
320
+ /**
321
+ * https://developer.nulab.com/docs/backlog/api/2/delete-project/
322
+ */
323
+ deleteProject(projectIdOrKey) {
324
+ return this.delete(`projects/${projectIdOrKey}`);
325
+ }
326
+ /**
327
+ * https://developer.nulab.com/docs/backlog/api/2/get-project-icon/
328
+ */
329
+ getProjectIcon(projectIdOrKey) {
330
+ return this.download(`projects/${projectIdOrKey}/image`);
331
+ }
332
+ /**
333
+ * https://developer.nulab.com/docs/backlog/api/2/get-project-recent-updates/
334
+ */
335
+ getProjectActivities(projectIdOrKey, params) {
336
+ return this.get(`projects/${projectIdOrKey}/activities`, params);
337
+ }
338
+ /**
339
+ * https://developer.nulab.com/docs/backlog/api/2/add-project-user/
340
+ */
341
+ postProjectUser(projectIdOrKey, userId) {
342
+ return this.post(`projects/${projectIdOrKey}/users`, { userId });
343
+ }
344
+ /**
345
+ * https://developer.nulab.com/docs/backlog/api/2/get-project-user-list/
346
+ */
347
+ getProjectUsers(projectIdOrKey) {
348
+ return this.get(`projects/${projectIdOrKey}/users`);
349
+ }
350
+ /**
351
+ * https://developer.nulab.com/docs/backlog/api/2/delete-project-user/
352
+ */
353
+ deleteProjectUsers(projectIdOrKey, params) {
354
+ return this.delete(`projects/${projectIdOrKey}/users`, params);
355
+ }
356
+ /**
357
+ * https://developer.nulab.com/docs/backlog/api/2/add-project-administrator/
358
+ */
359
+ postProjectAdministrators(projectIdOrKey, params) {
360
+ return this.post(`projects/${projectIdOrKey}/administrators`, params);
361
+ }
362
+ /**
363
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-project-administrators/
364
+ */
365
+ getProjectAdministrators(projectIdOrKey) {
366
+ return this.get(`projects/${projectIdOrKey}/administrators`);
367
+ }
368
+ /**
369
+ * https://developer.nulab.com/docs/backlog/api/2/delete-project-administrator/
370
+ */
371
+ deleteProjectAdministrators(projectIdOrKey, params) {
372
+ return this.delete(`projects/${projectIdOrKey}/administrators`, params);
373
+ }
374
+ /**
375
+ * https://developer.nulab.com/docs/backlog/api/2/add-status/
376
+ */
377
+ postProjectStatus(projectIdOrKey, params) {
378
+ return this.post(`projects/${projectIdOrKey}/statuses`, params);
379
+ }
380
+ /**
381
+ * https://developer.nulab.com/docs/backlog/api/2/update-status/
382
+ */
383
+ patchProjectStatus(projectIdOrKey, id, params) {
384
+ return this.patch(`projects/${projectIdOrKey}/statuses/${id}`, params);
385
+ }
386
+ /**
387
+ * https://developer.nulab.com/docs/backlog/api/2/delete-status/
388
+ */
389
+ deleteProjectStatus(projectIdOrKey, id, substituteStatusId) {
390
+ return this.delete(`projects/${projectIdOrKey}/statuses/${id}`, { substituteStatusId });
391
+ }
392
+ /**
393
+ * https://developer.nulab.com/docs/backlog/api/2/update-order-of-status/
394
+ */
395
+ patchProjectStatusOrder(projectIdOrKey, statusId) {
396
+ return this.patch(`projects/${projectIdOrKey}/statuses/updateDisplayOrder`, { statusId });
397
+ }
398
+ /**
399
+ * https://developer.nulab.com/docs/backlog/api/2/get-issue-type-list/
400
+ */
401
+ getIssueTypes(projectIdOrKey) {
402
+ return this.get(`projects/${projectIdOrKey}/issueTypes`);
403
+ }
404
+ /**
405
+ * https://developer.nulab.com/docs/backlog/api/2/add-issue-type/
406
+ */
407
+ postIssueType(projectIdOrKey, params) {
408
+ return this.post(`projects/${projectIdOrKey}/issueTypes`, params);
409
+ }
410
+ /**
411
+ * https://developer.nulab.com/docs/backlog/api/2/update-issue-type/
412
+ */
413
+ patchIssueType(projectIdOrKey, id, params) {
414
+ return this.patch(`projects/${projectIdOrKey}/issueTypes/${id}`, params);
415
+ }
416
+ /**
417
+ * https://developer.nulab.com/docs/backlog/api/2/delete-issue-type/
418
+ */
419
+ deleteIssueType(projectIdOrKey, id, params) {
420
+ return this.delete(`projects/${projectIdOrKey}/issueTypes/${id}`, params);
421
+ }
422
+ /**
423
+ * https://developer.nulab.com/docs/backlog/api/2/get-category-list/
424
+ */
425
+ getCategories(projectIdOrKey) {
426
+ return this.get(`projects/${projectIdOrKey}/categories`);
427
+ }
428
+ /**
429
+ * https://developer.nulab.com/docs/backlog/api/2/add-category/
430
+ */
431
+ postCategories(projectIdOrKey, params) {
432
+ return this.post(`projects/${projectIdOrKey}/categories`, params);
433
+ }
434
+ /**
435
+ * https://developer.nulab.com/docs/backlog/api/2/update-category/
436
+ */
437
+ patchCategories(projectIdOrKey, id, params) {
438
+ return this.patch(`projects/${projectIdOrKey}/categories/${id}`, params);
439
+ }
440
+ /**
441
+ * https://developer.nulab.com/docs/backlog/api/2/delete-category/
442
+ */
443
+ deleteCategories(projectIdOrKey, id) {
444
+ return this.delete(`projects/${projectIdOrKey}/categories/${id}`);
445
+ }
446
+ /**
447
+ * https://developer.nulab.com/docs/backlog/api/2/get-version-milestone-list/
448
+ */
449
+ getVersions(projectIdOrKey) {
450
+ return this.get(`projects/${projectIdOrKey}/versions`);
451
+ }
452
+ /**
453
+ * https://developer.nulab.com/docs/backlog/api/2/add-version-milestone/
454
+ */
455
+ postVersions(projectIdOrKey, params) {
456
+ return this.post(`projects/${projectIdOrKey}/versions`, params);
457
+ }
458
+ /**
459
+ * https://developer.nulab.com/docs/backlog/api/2/update-version-milestone/
460
+ */
461
+ patchVersions(projectIdOrKey, id, params) {
462
+ return this.patch(`projects/${projectIdOrKey}/versions/${id}`, params);
463
+ }
464
+ /**
465
+ * https://developer.nulab.com/docs/backlog/api/2/delete-version/
466
+ */
467
+ deleteVersions(projectIdOrKey, id) {
468
+ return this.delete(`projects/${projectIdOrKey}/versions/${id}`);
469
+ }
470
+ /**
471
+ * https://developer.nulab.com/docs/backlog/api/2/get-custom-field-list/
472
+ */
473
+ getCustomFields(projectIdOrKey) {
474
+ return this.get(`projects/${projectIdOrKey}/customFields`);
475
+ }
476
+ /**
477
+ * https://developer.nulab.com/docs/backlog/api/2/add-custom-field/
478
+ */
479
+ postCustomField(projectIdOrKey, params) {
480
+ return this.post(`projects/${projectIdOrKey}/customFields`, params);
481
+ }
482
+ /**
483
+ * https://developer.nulab.com/docs/backlog/api/2/update-custom-field/
484
+ */
485
+ patchCustomField(projectIdOrKey, id, params) {
486
+ return this.patch(`projects/${projectIdOrKey}/customFields/${id}`, params);
487
+ }
488
+ /**
489
+ * https://developer.nulab.com/docs/backlog/api/2/delete-custom-field/
490
+ */
491
+ deleteCustomField(projectIdOrKey, id) {
492
+ return this.delete(`projects/${projectIdOrKey}/customFields/${id}`);
493
+ }
494
+ /**
495
+ * https://developer.nulab.com/docs/backlog/api/2/add-list-item-for-list-type-custom-field/
496
+ */
497
+ postCustomFieldItem(projectIdOrKey, id, params) {
498
+ return this.post(`projects/${projectIdOrKey}/customFields/${id}/items`, params);
499
+ }
500
+ /**
501
+ * https://developer.nulab.com/docs/backlog/api/2/update-list-item-for-list-type-custom-field/
502
+ */
503
+ patchCustomFieldItem(projectIdOrKey, id, itemId, params) {
504
+ return this.patch(`projects/${projectIdOrKey}/customFields/${id}/items/${itemId}`, params);
505
+ }
506
+ /**
507
+ * https://developer.nulab.com/docs/backlog/api/2/delete-list-item-for-list-type-custom-field/
508
+ */
509
+ deleteCustomFieldItem(projectIdOrKey, id, itemId) {
510
+ return this.delete(`projects/${projectIdOrKey}/customFields/${id}/items/${itemId}`);
511
+ }
512
+ /**
513
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-shared-files/
514
+ */
515
+ getSharedFiles(projectIdOrKey, path, params) {
516
+ return this.get(`projects/${projectIdOrKey}/files/metadata/${path}`, params);
517
+ }
518
+ /**
519
+ * https://developer.nulab.com/docs/backlog/api/2/get-file/
520
+ */
521
+ getSharedFile(projectIdOrKey, sharedFileId) {
522
+ return this.download(`projects/${projectIdOrKey}/files/${sharedFileId}`);
523
+ }
524
+ /**
525
+ * https://developer.nulab.com/docs/backlog/api/2/get-project-disk-usage/
526
+ */
527
+ getProjectsDiskUsage(projectIdOrKey) {
528
+ return this.get(`projects/${projectIdOrKey}/diskUsage`);
529
+ }
530
+ /**
531
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-webhooks/
532
+ */
533
+ getWebhooks(projectIdOrKey) {
534
+ return this.get(`projects/${projectIdOrKey}/webhooks`);
535
+ }
536
+ /**
537
+ * https://developer.nulab.com/docs/backlog/api/2/add-webhook/
538
+ */
539
+ postWebhook(projectIdOrKey, params) {
540
+ return this.post(`projects/${projectIdOrKey}/webhooks`, params);
541
+ }
542
+ /**
543
+ * https://developer.nulab.com/docs/backlog/api/2/get-webhook/
544
+ */
545
+ getWebhook(projectIdOrKey, webhookId) {
546
+ return this.get(`projects/${projectIdOrKey}/webhooks/${webhookId}`);
547
+ }
548
+ /**
549
+ * https://developer.nulab.com/docs/backlog/api/2/update-webhook/
550
+ */
551
+ patchWebhook(projectIdOrKey, webhookId, params) {
552
+ return this.patch(`projects/${projectIdOrKey}/webhooks/${webhookId}`, params);
553
+ }
554
+ /**
555
+ * https://developer.nulab.com/docs/backlog/api/2/delete-webhook/
556
+ */
557
+ deleteWebhook(projectIdOrKey, webhookId) {
558
+ return this.delete(`projects/${projectIdOrKey}/webhooks/${webhookId}`);
559
+ }
560
+ /**
561
+ * https://developer.nulab.com/docs/backlog/api/2/get-issue-list/
562
+ */
563
+ getIssues(params) {
564
+ return this.get("issues", params);
565
+ }
566
+ /**
567
+ * https://developer.nulab.com/docs/backlog/api/2/count-issue/
568
+ */
569
+ getIssuesCount(params) {
570
+ return this.get("issues/count", params);
571
+ }
572
+ /**
573
+ * https://developer.nulab.com/docs/backlog/api/2/add-issue/
574
+ */
575
+ postIssue(params) {
576
+ return this.post("issues", params);
577
+ }
578
+ /**
579
+ * https://developer.nulab.com/docs/backlog/api/2/update-issue/
580
+ */
581
+ patchIssue(issueIdOrKey, params) {
582
+ return this.patch(`issues/${issueIdOrKey}`, params);
583
+ }
584
+ /**
585
+ * https://developer.nulab.com/docs/backlog/api/2/get-issue/
586
+ */
587
+ getIssue(issueIdOrKey, params) {
588
+ return this.get(`issues/${issueIdOrKey}`, params);
589
+ }
590
+ /**
591
+ * https://developer.nulab.com/docs/backlog/api/2/delete-issue/
592
+ */
593
+ deleteIssue(issueIdOrKey) {
594
+ return this.delete(`issues/${issueIdOrKey}`);
595
+ }
596
+ /**
597
+ * https://developer.nulab.com/docs/backlog/api/2/get-comment-list/
598
+ */
599
+ getIssueComments(issueIdOrKey, params) {
600
+ return this.get(`issues/${issueIdOrKey}/comments`, params);
601
+ }
602
+ /**
603
+ * https://developer.nulab.com/docs/backlog/api/2/add-comment/
604
+ */
605
+ postIssueComments(issueIdOrKey, params) {
606
+ return this.post(`issues/${issueIdOrKey}/comments`, params);
607
+ }
608
+ /**
609
+ * https://developer.nulab.com/docs/backlog/api/2/count-comment/
610
+ */
611
+ getIssueCommentsCount(issueIdOrKey) {
612
+ return this.get(`issues/${issueIdOrKey}/comments/count`);
613
+ }
614
+ /**
615
+ * https://developer.nulab.com/docs/backlog/api/2/get-comment/
616
+ */
617
+ getIssueComment(issueIdOrKey, commentId) {
618
+ return this.get(`issues/${issueIdOrKey}/comments/${commentId}`);
619
+ }
620
+ /**
621
+ * https://developer.nulab.com/docs/backlog/api/2/delete-comment/
622
+ */
623
+ deleteIssueComment(issueIdOrKey, commentId) {
624
+ return this.delete(`issues/${issueIdOrKey}/comments/${commentId}`);
625
+ }
626
+ /**
627
+ * https://developer.nulab.com/docs/backlog/api/2/update-comment/
628
+ */
629
+ patchIssueComment(issueIdOrKey, commentId, params) {
630
+ return this.patch(`issues/${issueIdOrKey}/comments/${commentId}`, params);
631
+ }
632
+ /**
633
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-comment-notifications/
634
+ */
635
+ getIssueCommentNotifications(issueIdOrKey, commentId) {
636
+ return this.get(`issues/${issueIdOrKey}/comments/${commentId}/notifications`);
637
+ }
638
+ /**
639
+ * https://developer.nulab.com/docs/backlog/api/2/add-comment-notification/
640
+ */
641
+ postIssueCommentNotifications(issueIdOrKey, commentId, prams) {
642
+ return this.post(`issues/${issueIdOrKey}/comments/${commentId}/notifications`, prams);
643
+ }
644
+ /**
645
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-issue-attachments/
646
+ */
647
+ getIssueAttachments(issueIdOrKey) {
648
+ return this.get(`issues/${issueIdOrKey}/attachments`);
649
+ }
650
+ /**
651
+ * https://developer.nulab.com/docs/backlog/api/2/get-issue-attachment/
652
+ */
653
+ getIssueAttachment(issueIdOrKey, attachmentId) {
654
+ return this.download(`issues/${issueIdOrKey}/attachments/${attachmentId}`);
655
+ }
656
+ /**
657
+ * https://developer.nulab.com/docs/backlog/api/2/delete-issue-attachment/
658
+ */
659
+ deleteIssueAttachment(issueIdOrKey, attachmentId) {
660
+ return this.delete(`issues/${issueIdOrKey}/attachments/${attachmentId}`);
661
+ }
662
+ /**
663
+ * https://developer.nulab.com/docs/backlog/api/2/get-issue-participant-list/
664
+ */
665
+ getIssueParticipants(issueIdOrKey) {
666
+ return this.get(`issues/${issueIdOrKey}/participants`);
667
+ }
668
+ /**
669
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-linked-shared-files/
670
+ */
671
+ getIssueSharedFiles(issueIdOrKey) {
672
+ return this.get(`issues/${issueIdOrKey}/sharedFiles`);
673
+ }
674
+ /**
675
+ * https://developer.nulab.com/docs/backlog/api/2/link-shared-files-to-issue/
676
+ */
677
+ linkIssueSharedFiles(issueIdOrKey, params) {
678
+ return this.post(`issues/${issueIdOrKey}/sharedFiles`, params);
679
+ }
680
+ /**
681
+ * https://developer.nulab.com/docs/backlog/api/2/remove-link-to-shared-file-from-issue/
682
+ */
683
+ unlinkIssueSharedFile(issueIdOrKey, id) {
684
+ return this.delete(`issues/${issueIdOrKey}/sharedFiles/${id}`);
685
+ }
686
+ /**
687
+ * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-list/
688
+ */
689
+ getWikis(params) {
690
+ return this.get(`wikis`, params);
691
+ }
692
+ /**
693
+ * https://developer.nulab.com/docs/backlog/api/2/count-wiki-page/
694
+ */
695
+ getWikisCount(projectIdOrKey) {
696
+ return this.get(`wikis/count`, { projectIdOrKey });
697
+ }
698
+ /**
699
+ * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-tag-list/
700
+ */
701
+ getWikisTags(projectIdOrKey) {
702
+ return this.get(`wikis/tags`, { projectIdOrKey });
703
+ }
704
+ /**
705
+ * https://developer.nulab.com/docs/backlog/api/2/add-wiki-page/
706
+ */
707
+ postWiki(params) {
708
+ return this.post(`wikis`, params);
709
+ }
710
+ /**
711
+ * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page/
712
+ */
713
+ getWiki(wikiId) {
714
+ return this.get(`wikis/${wikiId}`);
715
+ }
716
+ /**
717
+ * https://developer.nulab.com/docs/backlog/api/2/update-wiki-page/
718
+ */
719
+ patchWiki(wikiId, params) {
720
+ return this.patch(`wikis/${wikiId}`, params);
721
+ }
722
+ /**
723
+ * https://developer.nulab.com/docs/backlog/api/2/delete-wiki-page/
724
+ */
725
+ deleteWiki(wikiId, mailNotify) {
726
+ return this.delete(`wikis/${wikiId}`, { mailNotify });
727
+ }
728
+ /**
729
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-wiki-attachments/
730
+ */
731
+ getWikisAttachments(wikiId) {
732
+ return this.get(`wikis/${wikiId}/attachments`);
733
+ }
734
+ /**
735
+ * https://developer.nulab.com/docs/backlog/api/2/attach-file-to-wiki/
736
+ */
737
+ postWikisAttachments(wikiId, attachmentId) {
738
+ return this.post(`wikis/${wikiId}/attachments`, { attachmentId });
739
+ }
740
+ /**
741
+ * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-attachment/
742
+ */
743
+ getWikiAttachment(wikiId, attachmentId) {
744
+ return this.download(`wikis/${wikiId}/attachments/${attachmentId}`);
745
+ }
746
+ /**
747
+ * https://developer.nulab.com/docs/backlog/api/2/remove-wiki-attachment/
748
+ */
749
+ deleteWikisAttachments(wikiId, attachmentId) {
750
+ return this.delete(`wikis/${wikiId}/attachments/${attachmentId}`);
751
+ }
752
+ /**
753
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-shared-files-on-wiki/
754
+ */
755
+ getWikisSharedFiles(wikiId) {
756
+ return this.get(`wikis/${wikiId}/sharedFiles`);
757
+ }
758
+ /**
759
+ * https://developer.nulab.com/docs/backlog/api/2/link-shared-files-to-wiki/
760
+ */
761
+ linkWikisSharedFiles(wikiId, fileId) {
762
+ return this.post(`wikis/${wikiId}/sharedFiles`, { fileId });
763
+ }
764
+ /**
765
+ * https://developer.nulab.com/docs/backlog/api/2/remove-link-to-shared-file-from-wiki/
766
+ */
767
+ unlinkWikisSharedFiles(wikiId, id) {
768
+ return this.delete(`wikis/${wikiId}/sharedFiles/${id}`);
769
+ }
770
+ /**
771
+ * https://developer.nulab.com/docs/backlog/api/get-document-list/
772
+ */
773
+ getDocuments(params) {
774
+ return this.get("documents", params);
775
+ }
776
+ /**
777
+ * https://developer.nulab.com/docs/backlog/api/get-document-tree/
778
+ */
779
+ getDocumentTree(projectIdOrKey) {
780
+ return this.get(`documents/tree`, { projectIdOrKey });
781
+ }
782
+ /**
783
+ * https://developer.nulab.com/docs/backlog/api/get-document/
784
+ */
785
+ getDocument(documentId) {
786
+ return this.get(`documents/${documentId}`);
787
+ }
788
+ /**
789
+ * https://developer.nulab.com/docs/backlog/api/get-document-attachments/
790
+ */
791
+ downloadDocumentAttachment(documentId, attachmentId) {
792
+ return this.download(`documents/${documentId}/attachments/${attachmentId}`);
793
+ }
794
+ /**
795
+ * https://developer.nulab.com/docs/backlog/api/2/add-document/
796
+ */
797
+ addDocument(params) {
798
+ return this.post("documents", params);
799
+ }
800
+ /**
801
+ * https://developer.nulab.com/docs/backlog/api/2/delete-document/
802
+ */
803
+ deleteDocument(documentId) {
804
+ return this.delete(`documents/${documentId}`);
805
+ }
806
+ /**
807
+ * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-history/
808
+ */
809
+ getWikisHistory(wikiId, params) {
810
+ return this.get(`wikis/${wikiId}/history`, params);
811
+ }
812
+ /**
813
+ * https://developer.nulab.com/docs/backlog/api/2/get-wiki-page-star/
814
+ */
815
+ getWikisStars(wikiId) {
816
+ return this.get(`wikis/${wikiId}/stars`);
817
+ }
818
+ /**
819
+ * https://developer.nulab.com/docs/backlog/api/2/add-star/
820
+ */
821
+ postStar(params) {
822
+ return this.post("stars", params);
823
+ }
824
+ /**
825
+ * https://developer.nulab.com/docs/backlog/api/2/remove-star/
826
+ */
827
+ removeStar(starId) {
828
+ const endpoint = `stars/${starId}`;
829
+ return this.delete(endpoint);
830
+ }
831
+ /**
832
+ * https://developer.nulab.com/docs/backlog/api/2/get-notification/
833
+ */
834
+ getNotifications(params) {
835
+ return this.get("notifications", params);
836
+ }
837
+ /**
838
+ * https://developer.nulab.com/docs/backlog/api/2/count-notification/
839
+ */
840
+ getNotificationsCount(params) {
841
+ return this.get("notifications/count", params);
842
+ }
843
+ /**
844
+ * https://developer.nulab.com/docs/backlog/api/2/reset-unread-notification-count/
845
+ */
846
+ resetNotificationsMarkAsRead() {
847
+ return this.post("notifications/markAsRead");
848
+ }
849
+ /**
850
+ * https://developer.nulab.com/docs/backlog/api/2/read-notification/
851
+ */
852
+ markAsReadNotification(id) {
853
+ return this.post(`notifications/${id}/markAsRead`);
854
+ }
855
+ /**
856
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-git-repositories/
857
+ */
858
+ getGitRepositories(projectIdOrKey) {
859
+ return this.get(`projects/${projectIdOrKey}/git/repositories`);
860
+ }
861
+ /**
862
+ * https://developer.nulab.com/docs/backlog/api/2/get-git-repository/
863
+ */
864
+ getGitRepository(projectIdOrKey, repoIdOrName) {
865
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}`);
866
+ }
867
+ /**
868
+ * https://developer.nulab.com/docs/backlog/api/2/get-pull-request-list/
869
+ */
870
+ getPullRequests(projectIdOrKey, repoIdOrName, params) {
871
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests`, params);
872
+ }
873
+ /**
874
+ * https://developer.nulab.com/docs/backlog/api/2/get-number-of-pull-requests/
875
+ */
876
+ getPullRequestsCount(projectIdOrKey, repoIdOrName, params) {
877
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/count`, params);
878
+ }
879
+ /**
880
+ * https://developer.nulab.com/docs/backlog/api/2/add-pull-request/
881
+ */
882
+ postPullRequest(projectIdOrKey, repoIdOrName, params) {
883
+ return this.post(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests`, params);
884
+ }
885
+ /**
886
+ * https://developer.nulab.com/docs/backlog/api/2/get-pull-request/
887
+ */
888
+ getPullRequest(projectIdOrKey, repoIdOrName, number) {
889
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}`);
890
+ }
891
+ /**
892
+ * https://developer.nulab.com/docs/backlog/api/2/update-pull-request/
893
+ */
894
+ patchPullRequest(projectIdOrKey, repoIdOrName, number, params) {
895
+ return this.patch(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}`, params);
896
+ }
897
+ /**
898
+ * https://developer.nulab.com/docs/backlog/api/2/get-pull-request-comment/
899
+ */
900
+ getPullRequestComments(projectIdOrKey, repoIdOrName, number, params) {
901
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments`, params);
902
+ }
903
+ /**
904
+ * https://developer.nulab.com/docs/backlog/api/2/add-pull-request-comment/
905
+ */
906
+ postPullRequestComments(projectIdOrKey, repoIdOrName, number, params) {
907
+ return this.post(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments`, params);
908
+ }
909
+ /**
910
+ * https://developer.nulab.com/docs/backlog/api/2/get-number-of-pull-request-comments/
911
+ */
912
+ getPullRequestCommentsCount(projectIdOrKey, repoIdOrName, number) {
913
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments/count`);
914
+ }
915
+ /**
916
+ * https://developer.nulab.com/docs/backlog/api/2/update-pull-request-comment-information/
917
+ */
918
+ patchPullRequestComments(projectIdOrKey, repoIdOrName, number, commentId, params) {
919
+ return this.patch(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/comments/${commentId}`, params);
920
+ }
921
+ /**
922
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-pull-request-attachment/
923
+ */
924
+ getPullRequestAttachments(projectIdOrKey, repoIdOrName, number) {
925
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/attachments`);
926
+ }
927
+ /**
928
+ * https://developer.nulab.com/docs/backlog/api/2/download-pull-request-attachment/
929
+ */
930
+ getPullRequestAttachment(projectIdOrKey, repoIdOrName, number, attachmentId) {
931
+ return this.download(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/attachments/${attachmentId}`);
932
+ }
933
+ /**
934
+ * https://developer.nulab.com/docs/backlog/api/2/delete-pull-request-attachments/
935
+ */
936
+ deletePullRequestAttachment(projectIdOrKey, repoIdOrName, number, attachmentId) {
937
+ return this.get(`projects/${projectIdOrKey}/git/repositories/${repoIdOrName}/pullRequests/${number}/attachments/${attachmentId}`);
938
+ }
939
+ /**
940
+ * https://developer.nulab.com/docs/backlog/api/2/get-watching-list
941
+ */
942
+ getWatchingListItems(userId, params) {
943
+ return this.get(`users/${userId}/watchings`, params);
944
+ }
945
+ /**
946
+ * https://developer.nulab.com/docs/backlog/api/2/count-watching
947
+ */
948
+ getWatchingListCount(userId, params) {
949
+ return this.get(`users/${userId}/watchings/count`, params);
950
+ }
951
+ /**
952
+ * https://developer.nulab.com/docs/backlog/api/2/get-watching
953
+ */
954
+ getWatchingListItem(watchId) {
955
+ return this.get(`watchings/${watchId}`);
956
+ }
957
+ /**
958
+ * https://developer.nulab.com/docs/backlog/api/2/add-watching
959
+ */
960
+ postWatchingListItem(params) {
961
+ return this.post(`watchings`, params);
962
+ }
963
+ /**
964
+ * https://developer.nulab.com/docs/backlog/api/2/update-watching
965
+ */
966
+ patchWatchingListItem(watchId, note) {
967
+ return this.patch(`watchings/${watchId}`, { note });
968
+ }
969
+ /**
970
+ * https://developer.nulab.com/docs/backlog/api/2/delete-watching
971
+ */
972
+ deletehWatchingListItem(watchId) {
973
+ return this.delete(`watchings/${watchId}`);
974
+ }
975
+ /**
976
+ * https://developer.nulab.com/docs/backlog/api/2/mark-watching-as-read
977
+ */
978
+ resetWatchingListItemAsRead(watchId) {
979
+ return this.post(`watchings/${watchId}/markAsRead`);
980
+ }
981
+ /**
982
+ * https://developer.nulab.com/docs/backlog/api/2/get-licence
983
+ */
984
+ getLicence() {
985
+ return this.get(`space/licence`);
986
+ }
987
+ /**
988
+ * https://developer.nulab.com/docs/backlog/api/2/get-list-of-teams/
989
+ */
990
+ getTeams(params) {
991
+ return this.get(`teams`, params);
992
+ }
993
+ /**
994
+ * https://developer.nulab.com/docs/backlog/api/2/add-team/
995
+ */
996
+ postTeam(params) {
997
+ return this.post(`teams`, params);
998
+ }
999
+ /**
1000
+ * https://developer.nulab.com/docs/backlog/api/2/get-team/
1001
+ */
1002
+ getTeam(teamId) {
1003
+ return this.get(`teams/${teamId}`);
1004
+ }
1005
+ /**
1006
+ * https://developer.nulab.com/docs/backlog/api/2/update-team/
1007
+ */
1008
+ patchTeam(teamId, params) {
1009
+ return this.patch(`teams/${teamId}`, params);
1010
+ }
1011
+ /**
1012
+ * https://developer.nulab.com/docs/backlog/api/2/delete-team/
1013
+ */
1014
+ deleteTeam(teamId) {
1015
+ return this.delete(`teams/${teamId}`);
1016
+ }
1017
+ /**
1018
+ * https://developer.nulab.com/docs/backlog/api/2/get-team-icon/
1019
+ */
1020
+ getTeamIcon(teamId) {
1021
+ return this.download(`teams/${teamId}/icon`);
1022
+ }
1023
+ /**
1024
+ * https://developer.nulab.com/docs/backlog/api/2/get-project-team-list/
1025
+ */
1026
+ getProjectTeams(projectIdOrKey) {
1027
+ return this.get(`projects/${projectIdOrKey}/teams`);
1028
+ }
1029
+ /**
1030
+ * https://developer.nulab.com/docs/backlog/api/2/add-project-team/
1031
+ */
1032
+ postProjectTeam(projectIdOrKey, teamId) {
1033
+ return this.post(`projects/${projectIdOrKey}/teams`, { teamId });
1034
+ }
1035
+ /**
1036
+ * https://developer.nulab.com/docs/backlog/api/2/delete-project-team/
1037
+ */
1038
+ deleteProjectTeam(projectIdOrKey, teamId) {
1039
+ return this.delete(`projects/${projectIdOrKey}/teams`, { teamId });
1040
+ }
1041
+ /**
1042
+ * https://developer.nulab.com/docs/backlog/api/2/get-rate-limit/
1043
+ */
1044
+ getRateLimit() {
1045
+ return this.get("rateLimit");
1046
+ }
1047
+ download(path) {
1048
+ return this.request({
1049
+ method: "GET",
1050
+ path
1051
+ }).then(this.parseFileData);
1052
+ }
1053
+ upload(path, params) {
1054
+ return this.request({
1055
+ method: "POST",
1056
+ path,
1057
+ params
1058
+ }).then(this.parseJSON);
1059
+ }
1060
+ parseFileData(response) {
1061
+ return new Promise((resolve) => {
1062
+ if (typeof window !== "undefined") resolve({
1063
+ body: response.body,
1064
+ url: response.url,
1065
+ blob: () => response.blob()
1066
+ });
1067
+ else {
1068
+ const disposition = response.headers.get("Content-Disposition");
1069
+ const filename = disposition ? disposition.substring(disposition.indexOf("''") + 2) : "";
1070
+ resolve({
1071
+ body: response.body,
1072
+ url: response.url,
1073
+ filename
1074
+ });
1075
+ }
1076
+ });
1077
+ }
1078
+ };
1079
+ //#endregion
1080
+ //#region src/oauth2.ts
1081
+ var OAuth2 = class {
1082
+ constructor(credentials, timeout, fetch) {
1083
+ this.credentials = credentials;
1084
+ this.timeout = timeout;
1085
+ this.fetch = fetch;
1086
+ }
1087
+ getAuthorizationURL(options) {
1088
+ const params = {
1089
+ client_id: this.credentials.clientId,
1090
+ response_type: "code",
1091
+ redirect_uri: options.redirectUri,
1092
+ state: options.state
1093
+ };
1094
+ return `https://${options.host}/OAuth2AccessRequest.action?` + Object.keys(params).map((key) => params[key] ? `${key}=${params[key]}` : "").filter((x) => x.length > 0).join("&");
1095
+ }
1096
+ getAccessToken(options) {
1097
+ return new Request({
1098
+ host: options.host,
1099
+ timeout: this.timeout,
1100
+ fetch: this.fetch
1101
+ }).post("oauth2/token", {
1102
+ grant_type: "authorization_code",
1103
+ code: options.code,
1104
+ client_id: this.credentials.clientId,
1105
+ client_secret: this.credentials.clientSecret,
1106
+ redirect_uri: options.redirectUri
1107
+ });
1108
+ }
1109
+ refreshAccessToken(options) {
1110
+ return new Request({
1111
+ host: options.host,
1112
+ timeout: this.timeout,
1113
+ fetch: this.fetch
1114
+ }).post("oauth2/token", {
1115
+ grant_type: "refresh_token",
1116
+ client_id: this.credentials.clientId,
1117
+ client_secret: this.credentials.clientSecret,
1118
+ refresh_token: options.refreshToken
1119
+ });
1120
+ }
1121
+ };
1122
+ //#endregion
1123
+ //#region src/option.ts
1124
+ var option_exports = /* @__PURE__ */ __exportAll({ Issue: () => Issue });
1125
+ let Issue;
1126
+ (function(_Issue) {
1127
+ _Issue.ParentChildType = /* @__PURE__ */ function(ParentChildType) {
1128
+ ParentChildType[ParentChildType["All"] = 0] = "All";
1129
+ ParentChildType[ParentChildType["NotChild"] = 1] = "NotChild";
1130
+ /** @deprecated Use {@link ChildOrGrandchild}. */
1131
+ ParentChildType[ParentChildType["Child"] = 2] = "Child";
1132
+ ParentChildType[ParentChildType["ChildOrGrandchild"] = 2] = "ChildOrGrandchild";
1133
+ ParentChildType[ParentChildType["NotChildNotParent"] = 3] = "NotChildNotParent";
1134
+ /** @deprecated Use {@link HasChildren}. */
1135
+ ParentChildType[ParentChildType["Parent"] = 4] = "Parent";
1136
+ ParentChildType[ParentChildType["HasChildren"] = 4] = "HasChildren";
1137
+ ParentChildType[ParentChildType["GrandchildOnly"] = 5] = "GrandchildOnly";
1138
+ ParentChildType[ParentChildType["ChildOnly"] = 6] = "ChildOnly";
1139
+ ParentChildType[ParentChildType["TopLevelOnly"] = 7] = "TopLevelOnly";
1140
+ ParentChildType[ParentChildType["ExcludeGrandchild"] = 8] = "ExcludeGrandchild";
1141
+ ParentChildType[ParentChildType["ExcludeTopLevel"] = 9] = "ExcludeTopLevel";
1142
+ ParentChildType[ParentChildType["LeafOnly"] = 10] = "LeafOnly";
1143
+ return ParentChildType;
1144
+ }({});
1145
+ })(Issue || (Issue = {}));
1146
+ //#endregion
1147
+ //#region src/entity.ts
1148
+ var entity_exports = /* @__PURE__ */ __exportAll({});
1149
+ //#endregion
1150
+ //#region src/types.ts
1151
+ var types_exports = /* @__PURE__ */ __exportAll({
1152
+ ActivityType: () => ActivityType,
1153
+ ClassicRoleType: () => ClassicRoleType,
1154
+ CustomFieldType: () => CustomFieldType,
1155
+ NormalRoleType: () => NormalRoleType
1156
+ });
1157
+ let ClassicRoleType = /* @__PURE__ */ function(ClassicRoleType) {
1158
+ ClassicRoleType[ClassicRoleType["Admin"] = 1] = "Admin";
1159
+ ClassicRoleType[ClassicRoleType["User"] = 2] = "User";
1160
+ ClassicRoleType[ClassicRoleType["Reporter"] = 3] = "Reporter";
1161
+ ClassicRoleType[ClassicRoleType["Viewer"] = 4] = "Viewer";
1162
+ ClassicRoleType[ClassicRoleType["GuestReporter"] = 5] = "GuestReporter";
1163
+ ClassicRoleType[ClassicRoleType["GuestViewer"] = 6] = "GuestViewer";
1164
+ return ClassicRoleType;
1165
+ }({});
1166
+ let NormalRoleType = /* @__PURE__ */ function(NormalRoleType) {
1167
+ NormalRoleType[NormalRoleType["Admin"] = 1] = "Admin";
1168
+ NormalRoleType[NormalRoleType["MemberOrGuest"] = 2] = "MemberOrGuest";
1169
+ NormalRoleType[NormalRoleType["MemberOrGuestForAddIssues"] = 3] = "MemberOrGuestForAddIssues";
1170
+ NormalRoleType[NormalRoleType["MemberOrGuestForViewIssues"] = 4] = "MemberOrGuestForViewIssues";
1171
+ return NormalRoleType;
1172
+ }({});
1173
+ let ActivityType = /* @__PURE__ */ function(ActivityType) {
1174
+ ActivityType[ActivityType["Undefined"] = -1] = "Undefined";
1175
+ ActivityType[ActivityType["IssueCreated"] = 1] = "IssueCreated";
1176
+ ActivityType[ActivityType["IssueUpdated"] = 2] = "IssueUpdated";
1177
+ ActivityType[ActivityType["IssueCommented"] = 3] = "IssueCommented";
1178
+ ActivityType[ActivityType["IssueDeleted"] = 4] = "IssueDeleted";
1179
+ ActivityType[ActivityType["WikiCreated"] = 5] = "WikiCreated";
1180
+ ActivityType[ActivityType["WikiUpdated"] = 6] = "WikiUpdated";
1181
+ ActivityType[ActivityType["WikiDeleted"] = 7] = "WikiDeleted";
1182
+ ActivityType[ActivityType["FileAdded"] = 8] = "FileAdded";
1183
+ ActivityType[ActivityType["FileUpdated"] = 9] = "FileUpdated";
1184
+ ActivityType[ActivityType["FileDeleted"] = 10] = "FileDeleted";
1185
+ ActivityType[ActivityType["SvnCommitted"] = 11] = "SvnCommitted";
1186
+ ActivityType[ActivityType["GitPushed"] = 12] = "GitPushed";
1187
+ ActivityType[ActivityType["GitRepositoryCreated"] = 13] = "GitRepositoryCreated";
1188
+ ActivityType[ActivityType["IssueMultiUpdated"] = 14] = "IssueMultiUpdated";
1189
+ ActivityType[ActivityType["ProjectUserAdded"] = 15] = "ProjectUserAdded";
1190
+ ActivityType[ActivityType["ProjectUserRemoved"] = 16] = "ProjectUserRemoved";
1191
+ ActivityType[ActivityType["NotifyAdded"] = 17] = "NotifyAdded";
1192
+ ActivityType[ActivityType["PullRequestAdded"] = 18] = "PullRequestAdded";
1193
+ ActivityType[ActivityType["PullRequestUpdated"] = 19] = "PullRequestUpdated";
1194
+ ActivityType[ActivityType["PullRequestCommented"] = 20] = "PullRequestCommented";
1195
+ ActivityType[ActivityType["PullRequestMerged"] = 21] = "PullRequestMerged";
1196
+ ActivityType[ActivityType["MilestoneCreated"] = 22] = "MilestoneCreated";
1197
+ ActivityType[ActivityType["MilestoneUpdated"] = 23] = "MilestoneUpdated";
1198
+ ActivityType[ActivityType["MilestoneDeleted"] = 24] = "MilestoneDeleted";
1199
+ ActivityType[ActivityType["ProjectGroupAdded"] = 25] = "ProjectGroupAdded";
1200
+ ActivityType[ActivityType["ProjectGroupDeleted"] = 26] = "ProjectGroupDeleted";
1201
+ ActivityType[ActivityType["IssuesDatesUpdated"] = 35] = "IssuesDatesUpdated";
1202
+ ActivityType[ActivityType["StatusDeleted"] = 34] = "StatusDeleted";
1203
+ ActivityType[ActivityType["DocumentCreated"] = 36] = "DocumentCreated";
1204
+ ActivityType[ActivityType["DocumentDeleted"] = 37] = "DocumentDeleted";
1205
+ ActivityType[ActivityType["DocumentTitleUpdated"] = 38] = "DocumentTitleUpdated";
1206
+ ActivityType[ActivityType["DocumentCommentCreated"] = 40] = "DocumentCommentCreated";
1207
+ ActivityType[ActivityType["DocumentCommentUpdated"] = 41] = "DocumentCommentUpdated";
1208
+ ActivityType[ActivityType["DocumentCommentDeleted"] = 42] = "DocumentCommentDeleted";
1209
+ ActivityType[ActivityType["DocumentCommentReplyCreated"] = 43] = "DocumentCommentReplyCreated";
1210
+ ActivityType[ActivityType["DocumentCommentReplyUpdated"] = 44] = "DocumentCommentReplyUpdated";
1211
+ ActivityType[ActivityType["DocumentCommentReplyDeleted"] = 45] = "DocumentCommentReplyDeleted";
1212
+ ActivityType[ActivityType["DocumentAttachmentCreated"] = 46] = "DocumentAttachmentCreated";
1213
+ ActivityType[ActivityType["IssueMultiCreated"] = 47] = "IssueMultiCreated";
1214
+ ActivityType[ActivityType["DocumentMultiCreated"] = 48] = "DocumentMultiCreated";
1215
+ return ActivityType;
1216
+ }({});
1217
+ let CustomFieldType = /* @__PURE__ */ function(CustomFieldType) {
1218
+ CustomFieldType[CustomFieldType["Text"] = 1] = "Text";
1219
+ CustomFieldType[CustomFieldType["TextArea"] = 2] = "TextArea";
1220
+ CustomFieldType[CustomFieldType["Numeric"] = 3] = "Numeric";
1221
+ CustomFieldType[CustomFieldType["Date"] = 4] = "Date";
1222
+ CustomFieldType[CustomFieldType["SingleList"] = 5] = "SingleList";
1223
+ CustomFieldType[CustomFieldType["MultipleList"] = 6] = "MultipleList";
1224
+ CustomFieldType[CustomFieldType["CheckBox"] = 7] = "CheckBox";
1225
+ CustomFieldType[CustomFieldType["Radio"] = 8] = "Radio";
1226
+ return CustomFieldType;
1227
+ }({});
1228
+ //#endregion
1229
+ export { Backlog, entity_exports as Entity, error_exports as Error, OAuth2, option_exports as Option, types_exports as Types };