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