backlog-js 0.12.1 → 0.12.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,513 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- var request_1 = require("./request");
19
- var Backlog = (function (_super) {
20
- __extends(Backlog, _super);
21
- function Backlog(configure) {
22
- return _super.call(this, configure) || this;
23
- }
24
- Backlog.prototype.getSpace = function () {
25
- return this.get('space');
26
- };
27
- Backlog.prototype.getSpaceActivities = function (params) {
28
- return this.get('space/activities', params);
29
- };
30
- Backlog.prototype.getSpaceIcon = function () {
31
- return this.download('space/image');
32
- };
33
- Backlog.prototype.getSpaceNotification = function () {
34
- return this.get('space/notification');
35
- };
36
- Backlog.prototype.putSpaceNotification = function (params) {
37
- return this.put('space/notification', params);
38
- };
39
- Backlog.prototype.getSpaceDiskUsage = function () {
40
- return this.get('space/diskUsage');
41
- };
42
- Backlog.prototype.postSpaceAttachment = function (form) {
43
- return this.upload("space/attachment", form);
44
- };
45
- Backlog.prototype.getUsers = function () {
46
- return this.get("users");
47
- };
48
- Backlog.prototype.getUser = function (userId) {
49
- return this.get("users/" + userId);
50
- };
51
- Backlog.prototype.postUser = function (params) {
52
- return this.post("users", params);
53
- };
54
- Backlog.prototype.patchUser = function (userId, params) {
55
- return this.patch("users/" + userId, params);
56
- };
57
- Backlog.prototype.deleteUser = function (userId) {
58
- return this.delete("users/" + userId);
59
- };
60
- Backlog.prototype.getMyself = function () {
61
- return this.get('users/myself');
62
- };
63
- Backlog.prototype.getUserIcon = function (userId) {
64
- return this.download("users/" + userId + "/icon");
65
- };
66
- Backlog.prototype.getUserActivities = function (userId, params) {
67
- return this.get("users/" + userId + "/activities", params);
68
- };
69
- Backlog.prototype.getUserStars = function (userId, params) {
70
- return this.get("users/" + userId + "/stars", params);
71
- };
72
- Backlog.prototype.getUserStarsCount = function (userId, params) {
73
- return this.get("users/" + userId + "/stars/count", params);
74
- };
75
- Backlog.prototype.getRecentlyViewedIssues = function (params) {
76
- return this.get('users/myself/recentlyViewedIssues', params);
77
- };
78
- Backlog.prototype.getRecentlyViewedProjects = function (params) {
79
- return this.get('users/myself/recentlyViewedProjects', params);
80
- };
81
- Backlog.prototype.getRecentlyViewedWikis = function (params) {
82
- return this.get('users/myself/recentlyViewedWikis', params);
83
- };
84
- Backlog.prototype.getGroups = function (params) {
85
- console.warn("Deprecated: Use getTeams instead.");
86
- return this.get('groups', params);
87
- };
88
- Backlog.prototype.postGroups = function (params) {
89
- console.warn("Deprecated: Use postTeam instead.");
90
- return this.post('groups', params);
91
- };
92
- Backlog.prototype.getGroup = function (groupId) {
93
- console.warn("Deprecated: Use getTeam instead.");
94
- return this.get("groups/" + groupId);
95
- };
96
- Backlog.prototype.patchGroup = function (groupId, params) {
97
- console.warn("Deprecated: Use patchTeam instead.");
98
- return this.patch("groups/" + groupId, params);
99
- };
100
- Backlog.prototype.deleteGroup = function (groupId) {
101
- console.warn("Deprecated: Use deleteTeam instead.");
102
- return this.delete("groups/" + groupId);
103
- };
104
- Backlog.prototype.getStatuses = function () {
105
- console.warn("Deprecated: Use getProjectStatuses instead.");
106
- return this.get('statuses');
107
- };
108
- Backlog.prototype.getProjectStatuses = function (projectIdOrKey) {
109
- return this.get("projects/" + projectIdOrKey + "/statuses");
110
- };
111
- Backlog.prototype.getResolutions = function () {
112
- return this.get('resolutions');
113
- };
114
- Backlog.prototype.getPriorities = function () {
115
- return this.get('priorities');
116
- };
117
- Backlog.prototype.getProjects = function (params) {
118
- return this.get('projects', params);
119
- };
120
- Backlog.prototype.postProject = function (params) {
121
- return this.post('projects', params);
122
- };
123
- Backlog.prototype.getProject = function (projectIdOrKey) {
124
- return this.get("projects/" + projectIdOrKey);
125
- };
126
- Backlog.prototype.patchProject = function (projectIdOrKey, params) {
127
- return this.patch("projects/" + projectIdOrKey, params);
128
- };
129
- Backlog.prototype.deleteProject = function (projectIdOrKey) {
130
- return this.delete("projects/" + projectIdOrKey);
131
- };
132
- Backlog.prototype.getProjectIcon = function (projectIdOrKey) {
133
- return this.download("projects/" + projectIdOrKey + "/image");
134
- };
135
- Backlog.prototype.getProjectActivities = function (projectIdOrKey, params) {
136
- return this.get("projects/" + projectIdOrKey + "/activities", params);
137
- };
138
- Backlog.prototype.postProjectUser = function (projectIdOrKey, userId) {
139
- return this.post("projects/" + projectIdOrKey + "/users", { userId: userId });
140
- };
141
- Backlog.prototype.getProjectUsers = function (projectIdOrKey) {
142
- return this.get("projects/" + projectIdOrKey + "/users");
143
- };
144
- Backlog.prototype.deleteProjectUsers = function (projectIdOrKey, params) {
145
- return this.delete("projects/" + projectIdOrKey + "/users", params);
146
- };
147
- Backlog.prototype.postProjectAdministrators = function (projectIdOrKey, params) {
148
- return this.post("projects/" + projectIdOrKey + "/administrators", params);
149
- };
150
- Backlog.prototype.getProjectAdministrators = function (projectIdOrKey) {
151
- return this.get("projects/" + projectIdOrKey + "/administrators");
152
- };
153
- Backlog.prototype.deleteProjectAdministrators = function (projectIdOrKey, params) {
154
- return this.delete("projects/" + projectIdOrKey + "/administrators", params);
155
- };
156
- Backlog.prototype.postProjectStatus = function (projectIdOrKey, params) {
157
- return this.post("projects/" + projectIdOrKey + "/statuses", params);
158
- };
159
- Backlog.prototype.patchProjectStatus = function (projectIdOrKey, id, params) {
160
- return this.patch("projects/" + projectIdOrKey + "/statuses/" + id, params);
161
- };
162
- Backlog.prototype.deleteProjectStatus = function (projectIdOrKey, id, substituteStatusId) {
163
- return this.delete("projects/" + projectIdOrKey + "/statuses/" + id, { substituteStatusId: substituteStatusId });
164
- };
165
- Backlog.prototype.patchProjectStatusOrder = function (projectIdOrKey, statusId) {
166
- return this.patch("projects/" + projectIdOrKey + "/statuses/updateDisplayOrder", { statusId: statusId });
167
- };
168
- Backlog.prototype.getIssueTypes = function (projectIdOrKey) {
169
- return this.get("projects/" + projectIdOrKey + "/issueTypes");
170
- };
171
- Backlog.prototype.postIssueType = function (projectIdOrKey, params) {
172
- return this.post("projects/" + projectIdOrKey + "/issueTypes", params);
173
- };
174
- Backlog.prototype.patchIssueType = function (projectIdOrKey, id, params) {
175
- return this.patch("projects/" + projectIdOrKey + "/issueTypes/" + id, params);
176
- };
177
- Backlog.prototype.deleteIssueType = function (projectIdOrKey, id, params) {
178
- return this.delete("projects/" + projectIdOrKey + "/issueTypes/" + id, params);
179
- };
180
- Backlog.prototype.getCategories = function (projectIdOrKey) {
181
- return this.get("projects/" + projectIdOrKey + "/categories");
182
- };
183
- Backlog.prototype.postCategories = function (projectIdOrKey, params) {
184
- return this.post("projects/" + projectIdOrKey + "/categories", params);
185
- };
186
- Backlog.prototype.patchCategories = function (projectIdOrKey, id, params) {
187
- return this.patch("projects/" + projectIdOrKey + "/categories/" + id, params);
188
- };
189
- Backlog.prototype.deleteCategories = function (projectIdOrKey, id) {
190
- return this.delete("projects/" + projectIdOrKey + "/categories/" + id);
191
- };
192
- Backlog.prototype.getVersions = function (projectIdOrKey) {
193
- return this.get("projects/" + projectIdOrKey + "/versions");
194
- };
195
- Backlog.prototype.postVersions = function (projectIdOrKey, params) {
196
- return this.post("projects/" + projectIdOrKey + "/versions", params);
197
- };
198
- Backlog.prototype.patchVersions = function (projectIdOrKey, id, params) {
199
- return this.patch("projects/" + projectIdOrKey + "/versions/" + id, params);
200
- };
201
- Backlog.prototype.deleteVersions = function (projectIdOrKey, id) {
202
- return this.delete("projects/" + projectIdOrKey + "/versions/" + id);
203
- };
204
- Backlog.prototype.getCustomFields = function (projectIdOrKey) {
205
- return this.get("projects/" + projectIdOrKey + "/customFields");
206
- };
207
- Backlog.prototype.postCustomField = function (projectIdOrKey, params) {
208
- return this.post("projects/" + projectIdOrKey + "/customFields", params);
209
- };
210
- Backlog.prototype.patchCustomField = function (projectIdOrKey, id, params) {
211
- return this.patch("projects/" + projectIdOrKey + "/customFields/" + id, params);
212
- };
213
- Backlog.prototype.deleteCustomField = function (projectIdOrKey, id) {
214
- return this.delete("projects/" + projectIdOrKey + "/customFields/" + id);
215
- };
216
- Backlog.prototype.postCustomFieldItem = function (projectIdOrKey, id, params) {
217
- return this.post("projects/" + projectIdOrKey + "/customFields/" + id + "/items", params);
218
- };
219
- Backlog.prototype.patchCustomFieldItem = function (projectIdOrKey, id, itemId, params) {
220
- return this.patch("projects/" + projectIdOrKey + "/customFields/" + id + "/items/" + itemId, params);
221
- };
222
- Backlog.prototype.deleteCustomFieldItem = function (projectIdOrKey, id, itemId) {
223
- return this.delete("projects/" + projectIdOrKey + "/customFields/" + id + "/items/" + itemId);
224
- };
225
- Backlog.prototype.getSharedFiles = function (projectIdOrKey, path, params) {
226
- return this.get("projects/" + projectIdOrKey + "/files/metadata/" + path, params);
227
- };
228
- Backlog.prototype.getSharedFile = function (projectIdOrKey, sharedFileId) {
229
- return this.download("projects/" + projectIdOrKey + "/files/" + sharedFileId);
230
- };
231
- Backlog.prototype.getProjectsDiskUsage = function (projectIdOrKey) {
232
- return this.get("projects/" + projectIdOrKey + "/diskUsage");
233
- };
234
- Backlog.prototype.getWebhooks = function (projectIdOrKey) {
235
- return this.get("projects/" + projectIdOrKey + "/webhooks");
236
- };
237
- Backlog.prototype.postWebhook = function (projectIdOrKey, params) {
238
- return this.post("projects/" + projectIdOrKey + "/webhooks", params);
239
- };
240
- Backlog.prototype.getWebhook = function (projectIdOrKey, webhookId) {
241
- return this.get("projects/" + projectIdOrKey + "/webhooks/" + webhookId);
242
- };
243
- Backlog.prototype.patchWebhook = function (projectIdOrKey, webhookId, params) {
244
- return this.patch("projects/" + projectIdOrKey + "/webhooks/" + webhookId, params);
245
- };
246
- Backlog.prototype.deleteWebhook = function (projectIdOrKey, webhookId) {
247
- return this.delete("projects/" + projectIdOrKey + "/webhooks/" + webhookId);
248
- };
249
- Backlog.prototype.getIssues = function (params) {
250
- return this.get('issues', params);
251
- };
252
- Backlog.prototype.getIssuesCount = function (params) {
253
- return this.get('issues/count', params);
254
- };
255
- Backlog.prototype.postIssue = function (params) {
256
- return this.post('issues', params);
257
- };
258
- Backlog.prototype.patchIssue = function (issueIdOrKey, params) {
259
- return this.patch("issues/" + issueIdOrKey, params);
260
- };
261
- Backlog.prototype.getIssue = function (issueIdOrKey) {
262
- return this.get("issues/" + issueIdOrKey);
263
- };
264
- Backlog.prototype.deleteIssuesCount = function (issueIdOrKey) {
265
- return this.delete("issues/" + issueIdOrKey);
266
- };
267
- Backlog.prototype.getIssueComments = function (issueIdOrKey, params) {
268
- return this.get("issues/" + issueIdOrKey + "/comments", params);
269
- };
270
- Backlog.prototype.postIssueComments = function (issueIdOrKey, params) {
271
- return this.post("issues/" + issueIdOrKey + "/comments", params);
272
- };
273
- Backlog.prototype.getIssueCommentsCount = function (issueIdOrKey) {
274
- return this.get("issues/" + issueIdOrKey + "/comments/count");
275
- };
276
- Backlog.prototype.getIssueComment = function (issueIdOrKey, commentId) {
277
- return this.get("issues/" + issueIdOrKey + "/comments/" + commentId);
278
- };
279
- Backlog.prototype.deleteIssueComment = function (issueIdOrKey, commentId) {
280
- return this.delete("issues/" + issueIdOrKey + "/comments/" + commentId);
281
- };
282
- Backlog.prototype.patchIssueComment = function (issueIdOrKey, commentId, params) {
283
- return this.patch("issues/" + issueIdOrKey + "/comments/" + commentId, params);
284
- };
285
- Backlog.prototype.getIssueCommentNotifications = function (issueIdOrKey, commentId) {
286
- return this.get("issues/" + issueIdOrKey + "/comments/" + commentId + "/notifications");
287
- };
288
- Backlog.prototype.postIssueCommentNotifications = function (issueIdOrKey, commentId, prams) {
289
- return this.post("issues/" + issueIdOrKey + "/comments/" + commentId + "/notifications", prams);
290
- };
291
- Backlog.prototype.getIssueAttachments = function (issueIdOrKey) {
292
- return this.get("issues/" + issueIdOrKey + "/attachments");
293
- };
294
- Backlog.prototype.getIssueAttachment = function (issueIdOrKey, attachmentId) {
295
- return this.download("issues/" + issueIdOrKey + "/attachments/" + attachmentId);
296
- };
297
- Backlog.prototype.deleteIssueAttachment = function (issueIdOrKey, attachmentId) {
298
- return this.delete("issues/" + issueIdOrKey + "/attachments/" + attachmentId);
299
- };
300
- Backlog.prototype.getIssueParticipants = function (issueIdOrKey) {
301
- return this.get("issues/" + issueIdOrKey + "/participants");
302
- };
303
- Backlog.prototype.getIssueSharedFiles = function (issueIdOrKey) {
304
- return this.get("issues/" + issueIdOrKey + "/sharedFiles");
305
- };
306
- Backlog.prototype.linkIssueSharedFiles = function (issueIdOrKey, params) {
307
- return this.post("issues/" + issueIdOrKey + "/sharedFiles", params);
308
- };
309
- Backlog.prototype.unlinkIssueSharedFile = function (issueIdOrKey, id) {
310
- return this.delete("issues/" + issueIdOrKey + "/sharedFiles/" + id);
311
- };
312
- Backlog.prototype.getWikis = function (params) {
313
- return this.get("wikis", params);
314
- };
315
- Backlog.prototype.getWikisCount = function (projectIdOrKey) {
316
- return this.get("wikis/count", { projectIdOrKey: projectIdOrKey });
317
- };
318
- Backlog.prototype.getWikisTags = function (projectIdOrKey) {
319
- return this.get("wikis/tags", { projectIdOrKey: projectIdOrKey });
320
- };
321
- Backlog.prototype.postWiki = function (params) {
322
- return this.post("wikis", params);
323
- };
324
- Backlog.prototype.getWiki = function (wikiId) {
325
- return this.get("wikis/" + wikiId);
326
- };
327
- Backlog.prototype.patchWiki = function (wikiId, params) {
328
- return this.patch("wikis/" + wikiId, params);
329
- };
330
- Backlog.prototype.deleteWiki = function (wikiId, mailNotify) {
331
- return this.delete("wikis/" + wikiId, { mailNotify: mailNotify });
332
- };
333
- Backlog.prototype.getWikisAttachments = function (wikiId) {
334
- return this.get("wikis/" + wikiId + "/attachments");
335
- };
336
- Backlog.prototype.postWikisAttachments = function (wikiId, attachmentId) {
337
- return this.post("wikis/" + wikiId + "/attachments", { attachmentId: attachmentId });
338
- };
339
- Backlog.prototype.getWikiAttachment = function (wikiId, attachmentId) {
340
- return this.download("wikis/" + wikiId + "/attachments/" + attachmentId);
341
- };
342
- Backlog.prototype.deleteWikisAttachments = function (wikiId, attachmentId) {
343
- return this.delete("wikis/" + wikiId + "/attachments/" + attachmentId);
344
- };
345
- Backlog.prototype.getWikisSharedFiles = function (wikiId) {
346
- return this.get("wikis/" + wikiId + "/sharedFiles");
347
- };
348
- Backlog.prototype.linkWikisSharedFiles = function (wikiId, fileId) {
349
- return this.post("wikis/" + wikiId + "/sharedFiles", { fileId: fileId });
350
- };
351
- Backlog.prototype.unlinkWikisSharedFiles = function (wikiId, id) {
352
- return this.delete("wikis/" + wikiId + "/sharedFiles/" + id);
353
- };
354
- Backlog.prototype.getWikisHistory = function (wikiId, params) {
355
- return this.get("wikis/" + wikiId + "/history", params);
356
- };
357
- Backlog.prototype.getWikisStars = function (wikiId) {
358
- return this.get("wikis/" + wikiId + "/stars");
359
- };
360
- Backlog.prototype.postStar = function (params) {
361
- return this.post('stars', params);
362
- };
363
- Backlog.prototype.getNotifications = function (params) {
364
- return this.get('notifications', params);
365
- };
366
- Backlog.prototype.getNotificationsCount = function (params) {
367
- return this.get('notifications/count', params);
368
- };
369
- Backlog.prototype.resetNotificationsMarkAsRead = function () {
370
- return this.post('notifications/markAsRead');
371
- };
372
- Backlog.prototype.markAsReadNotification = function (id) {
373
- return this.post("notifications/" + id + "/markAsRead");
374
- };
375
- Backlog.prototype.getGitRepositories = function (projectIdOrKey) {
376
- return this.get("projects/" + projectIdOrKey + "/git/repositories");
377
- };
378
- Backlog.prototype.getGitRepository = function (projectIdOrKey, repoIdOrName) {
379
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName);
380
- };
381
- Backlog.prototype.getPullRequests = function (projectIdOrKey, repoIdOrName, params) {
382
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests", params);
383
- };
384
- Backlog.prototype.getPullRequestsCount = function (projectIdOrKey, repoIdOrName, params) {
385
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/count", params);
386
- };
387
- Backlog.prototype.postPullRequest = function (projectIdOrKey, repoIdOrName, params) {
388
- return this.post("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests", params);
389
- };
390
- Backlog.prototype.getPullRequest = function (projectIdOrKey, repoIdOrName, number) {
391
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number);
392
- };
393
- Backlog.prototype.patchPullRequest = function (projectIdOrKey, repoIdOrName, number, params) {
394
- return this.patch("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number, params);
395
- };
396
- Backlog.prototype.getPullRequestComments = function (projectIdOrKey, repoIdOrName, number, params) {
397
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/comments", params);
398
- };
399
- Backlog.prototype.postPullRequestComments = function (projectIdOrKey, repoIdOrName, number, params) {
400
- return this.post("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/comments", params);
401
- };
402
- Backlog.prototype.getPullRequestCommentsCount = function (projectIdOrKey, repoIdOrName, number) {
403
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/comments/count");
404
- };
405
- Backlog.prototype.patchPullRequestComments = function (projectIdOrKey, repoIdOrName, number, commentId, params) {
406
- return this.patch("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/comments/" + commentId, params);
407
- };
408
- Backlog.prototype.getPullRequestAttachments = function (projectIdOrKey, repoIdOrName, number) {
409
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/attachments");
410
- };
411
- Backlog.prototype.getPullRequestAttachment = function (projectIdOrKey, repoIdOrName, number, attachmentId) {
412
- return this.download("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/attachments/" + attachmentId);
413
- };
414
- Backlog.prototype.deletePullRequestAttachment = function (projectIdOrKey, repoIdOrName, number, attachmentId) {
415
- return this.get("projects/" + projectIdOrKey + "/git/repositories/" + repoIdOrName + "/pullRequests/" + number + "/attachments/" + attachmentId);
416
- };
417
- Backlog.prototype.getWatchingListItems = function (userId) {
418
- return this.get("users/" + userId + "/watchings");
419
- };
420
- Backlog.prototype.getWatchingListCount = function (userId) {
421
- return this.get("users/" + userId + "/watchings/count");
422
- };
423
- Backlog.prototype.getWatchingListItem = function (watchId) {
424
- return this.get("watchings/" + watchId);
425
- };
426
- Backlog.prototype.postWatchingListItem = function (params) {
427
- return this.post("watchings", params);
428
- };
429
- Backlog.prototype.patchWatchingListItem = function (watchId, note) {
430
- return this.patch("watchings/" + watchId, { note: note });
431
- };
432
- Backlog.prototype.deletehWatchingListItem = function (watchId) {
433
- return this.delete("watchings/" + watchId);
434
- };
435
- Backlog.prototype.resetWatchingListItemAsRead = function (watchId) {
436
- return this.post("watchings/" + watchId + "/markAsRead");
437
- };
438
- Backlog.prototype.getProjectGroupList = function (projectIdOrKey) {
439
- console.warn("Deprecated: Use getProjectTeams instead.");
440
- return this.get("projects/" + projectIdOrKey + "/groups");
441
- };
442
- Backlog.prototype.postProjectGroup = function (projectIdOrKey, params) {
443
- console.warn("Deprecated: Use postProjectTeam instead.");
444
- return this.post("projects/" + projectIdOrKey + "/groups", params);
445
- };
446
- Backlog.prototype.deleteProjectGroup = function (projectIdOrKey) {
447
- console.warn("Deprecated: Use deleteProjectTeam instead.");
448
- return this.delete("projects/" + projectIdOrKey + "/groups");
449
- };
450
- Backlog.prototype.getGroupIcon = function (groupId) {
451
- console.warn("Deprecated: Use getTeamIcon instead.");
452
- return this.download("groups/" + groupId + "/icon");
453
- };
454
- Backlog.prototype.getLicence = function () {
455
- return this.get("space/licence");
456
- };
457
- Backlog.prototype.getTeams = function (params) {
458
- return this.get("teams", params);
459
- };
460
- Backlog.prototype.postTeam = function (members) {
461
- return this.post("teams", { members: members });
462
- };
463
- Backlog.prototype.getTeam = function (teamId) {
464
- return this.get("teams/" + teamId);
465
- };
466
- Backlog.prototype.patchTeam = function (teamId, params) {
467
- return this.patch("teams/" + teamId, params);
468
- };
469
- Backlog.prototype.deleteTeam = function (teamId) {
470
- return this.delete("teams/" + teamId);
471
- };
472
- Backlog.prototype.getTeamIcon = function (teamId) {
473
- return this.download("teams/" + teamId + "/icon");
474
- };
475
- Backlog.prototype.getProjectTeams = function (projectIdOrKey) {
476
- return this.get("projects/" + projectIdOrKey + "/teams");
477
- };
478
- Backlog.prototype.postProjectTeam = function (projectIdOrKey, teamId) {
479
- return this.post("projects/" + projectIdOrKey + "/teams", { teamId: teamId });
480
- };
481
- Backlog.prototype.deleteProjectTeam = function (projectIdOrKey, teamId) {
482
- return this.delete("projects/" + projectIdOrKey + "/teams", { teamId: teamId });
483
- };
484
- Backlog.prototype.download = function (path) {
485
- return this.request({ method: 'GET', path: path }).then(this.parseFileData);
486
- };
487
- Backlog.prototype.upload = function (path, params) {
488
- return this.request({ method: 'POST', path: path, params: params }).then(this.parseJSON);
489
- };
490
- Backlog.prototype.parseFileData = function (response) {
491
- return new Promise(function (resolve, reject) {
492
- if (typeof window !== 'undefined') {
493
- resolve({
494
- body: response.body,
495
- url: response.url,
496
- blob: function () { return response.blob(); },
497
- });
498
- }
499
- else {
500
- var disposition = response.headers.get("Content-Disposition");
501
- var filename = disposition
502
- ? disposition.substring(disposition.indexOf("''") + 2) : "";
503
- resolve({
504
- body: response.body,
505
- url: response.url,
506
- filename: filename
507
- });
508
- }
509
- });
510
- };
511
- return Backlog;
512
- }(request_1.default));
513
- exports.default = Backlog;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
package/dist/src/error.js DELETED
@@ -1,91 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.UnexpectedError = exports.BacklogAuthError = exports.BacklogApiError = exports.BacklogError = void 0;
19
- var BacklogError = (function (_super) {
20
- __extends(BacklogError, _super);
21
- function BacklogError(name, response, body) {
22
- var _this = _super.call(this, response.statusText) || this;
23
- _this._name = name;
24
- _this._url = response.url;
25
- _this._status = response.status;
26
- _this._body = body;
27
- _this._response = response;
28
- return _this;
29
- }
30
- Object.defineProperty(BacklogError.prototype, "name", {
31
- get: function () {
32
- return this._name;
33
- },
34
- enumerable: false,
35
- configurable: true
36
- });
37
- Object.defineProperty(BacklogError.prototype, "url", {
38
- get: function () {
39
- return this._url;
40
- },
41
- enumerable: false,
42
- configurable: true
43
- });
44
- Object.defineProperty(BacklogError.prototype, "status", {
45
- get: function () {
46
- return this._status;
47
- },
48
- enumerable: false,
49
- configurable: true
50
- });
51
- Object.defineProperty(BacklogError.prototype, "body", {
52
- get: function () {
53
- return this._body;
54
- },
55
- enumerable: false,
56
- configurable: true
57
- });
58
- Object.defineProperty(BacklogError.prototype, "response", {
59
- get: function () {
60
- return this._response;
61
- },
62
- enumerable: false,
63
- configurable: true
64
- });
65
- return BacklogError;
66
- }(global.Error));
67
- exports.BacklogError = BacklogError;
68
- var BacklogApiError = (function (_super) {
69
- __extends(BacklogApiError, _super);
70
- function BacklogApiError(response, body) {
71
- return _super.call(this, 'BacklogApiError', response, body) || this;
72
- }
73
- return BacklogApiError;
74
- }(BacklogError));
75
- exports.BacklogApiError = BacklogApiError;
76
- var BacklogAuthError = (function (_super) {
77
- __extends(BacklogAuthError, _super);
78
- function BacklogAuthError(response, body) {
79
- return _super.call(this, 'BacklogAuthError', response, body) || this;
80
- }
81
- return BacklogAuthError;
82
- }(BacklogError));
83
- exports.BacklogAuthError = BacklogAuthError;
84
- var UnexpectedError = (function (_super) {
85
- __extends(UnexpectedError, _super);
86
- function UnexpectedError(response) {
87
- return _super.call(this, 'UnexpectedError', response) || this;
88
- }
89
- return UnexpectedError;
90
- }(BacklogError));
91
- exports.UnexpectedError = UnexpectedError;
package/dist/src/index.js DELETED
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Error = exports.Entity = exports.Option = exports.OAuth2 = exports.Backlog = void 0;
4
- var backlog_1 = require("./backlog");
5
- exports.Backlog = backlog_1.default;
6
- var oauth2_1 = require("./oauth2");
7
- exports.OAuth2 = oauth2_1.default;
8
- var Option = require("./option");
9
- exports.Option = Option;
10
- var Entity = require("./entity");
11
- exports.Entity = Entity;
12
- var Error = require("./error");
13
- exports.Error = Error;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var request_1 = require("./request");
4
- var OAuth2 = (function () {
5
- function OAuth2(credentials, timeout) {
6
- this.credentials = credentials;
7
- this.timeout = timeout;
8
- }
9
- OAuth2.prototype.getAuthorizationURL = function (options) {
10
- var params = {
11
- client_id: this.credentials.clientId,
12
- response_type: 'code',
13
- redirect_uri: options.redirectUri,
14
- state: options.state
15
- };
16
- return "https://" + options.host + "/OAuth2AccessRequest.action?" +
17
- Object.keys(params)
18
- .map(function (key) { return params[key] ? key + "=" + params[key] : ''; })
19
- .filter(function (x) { return x.length > 0; })
20
- .join('&');
21
- };
22
- OAuth2.prototype.getAccessToken = function (options) {
23
- return new request_1.default({
24
- host: options.host, timeout: this.timeout
25
- }).post('oauth2/token', {
26
- grant_type: 'authorization_code',
27
- code: options.code,
28
- client_id: this.credentials.clientId,
29
- client_secret: this.credentials.clientSecret,
30
- redirect_uri: options.redirectUri
31
- });
32
- };
33
- OAuth2.prototype.refreshAccessToken = function (options) {
34
- return new request_1.default({
35
- host: options.host, timeout: this.timeout
36
- }).post('oauth2/token', {
37
- grant_type: "refresh_token",
38
- client_id: this.credentials.clientId,
39
- client_secret: this.credentials.clientSecret,
40
- refresh_token: options.refreshToken
41
- });
42
- };
43
- return OAuth2;
44
- }());
45
- exports.default = OAuth2;