backlog-js 0.12.3 → 0.12.6
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/CHANGELOG.md +21 -0
- package/dist/backlog.js +628 -139
- package/dist/backlog.min.js +1 -1
- package/dist/types/backlog.d.ts +628 -0
- package/dist/types/entity.d.ts +23 -0
- package/dist/types/error.d.ts +37 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/oauth2.d.ts +21 -0
- package/dist/types/option.d.ts +455 -0
- package/dist/types/request.d.ts +27 -0
- package/package.json +25 -23
- package/dist/backlog.d.ts +0 -750
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare class BacklogError extends Error {
|
|
2
|
+
private _name;
|
|
3
|
+
private _url;
|
|
4
|
+
private _status;
|
|
5
|
+
private _body;
|
|
6
|
+
private _response;
|
|
7
|
+
constructor(name: BacklogErrorNameType, response: Response, body?: {
|
|
8
|
+
errors: BacklogErrorMessage[];
|
|
9
|
+
});
|
|
10
|
+
get name(): BacklogErrorNameType;
|
|
11
|
+
get url(): string;
|
|
12
|
+
get status(): number;
|
|
13
|
+
get body(): {
|
|
14
|
+
errors: BacklogErrorMessage[];
|
|
15
|
+
};
|
|
16
|
+
get response(): Response;
|
|
17
|
+
}
|
|
18
|
+
export declare class BacklogApiError extends BacklogError {
|
|
19
|
+
constructor(response: Response, body?: {
|
|
20
|
+
errors: BacklogErrorMessage[];
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export declare class BacklogAuthError extends BacklogError {
|
|
24
|
+
constructor(response: Response, body?: {
|
|
25
|
+
errors: BacklogErrorMessage[];
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export declare class UnexpectedError extends BacklogError {
|
|
29
|
+
constructor(response: Response);
|
|
30
|
+
}
|
|
31
|
+
export interface BacklogErrorMessage {
|
|
32
|
+
message: string;
|
|
33
|
+
code: number;
|
|
34
|
+
errorInfo: string;
|
|
35
|
+
moreInfo: string;
|
|
36
|
+
}
|
|
37
|
+
export declare type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Option from './option';
|
|
2
|
+
import * as Entity from './entity';
|
|
3
|
+
export default class OAuth2 {
|
|
4
|
+
private credentials;
|
|
5
|
+
private timeout?;
|
|
6
|
+
constructor(credentials: Option.OAuth2.Credentials, timeout?: number);
|
|
7
|
+
getAuthorizationURL(options: {
|
|
8
|
+
host: string;
|
|
9
|
+
redirectUri?: string;
|
|
10
|
+
state?: string;
|
|
11
|
+
}): string;
|
|
12
|
+
getAccessToken(options: {
|
|
13
|
+
host: string;
|
|
14
|
+
code: string;
|
|
15
|
+
redirectUri?: string;
|
|
16
|
+
}): Promise<Entity.OAuth2.AccessToken>;
|
|
17
|
+
refreshAccessToken(options: {
|
|
18
|
+
host: string;
|
|
19
|
+
refreshToken: string;
|
|
20
|
+
}): Promise<Entity.OAuth2.AccessToken>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
export declare type Order = "asc" | "desc";
|
|
2
|
+
export declare enum ActivityType {
|
|
3
|
+
Undefined = -1,
|
|
4
|
+
IssueCreated = 1,
|
|
5
|
+
IssueUpdated = 2,
|
|
6
|
+
IssueCommented = 3,
|
|
7
|
+
IssueDeleted = 4,
|
|
8
|
+
WikiCreated = 5,
|
|
9
|
+
WikiUpdated = 6,
|
|
10
|
+
WikiDeleted = 7,
|
|
11
|
+
FileAdded = 8,
|
|
12
|
+
FileUpdated = 9,
|
|
13
|
+
FileDeleted = 10,
|
|
14
|
+
SvnCommitted = 11,
|
|
15
|
+
GitPushed = 12,
|
|
16
|
+
GitRepositoryCreated = 13,
|
|
17
|
+
IssueMultiUpdated = 14,
|
|
18
|
+
ProjectUserAdded = 15,
|
|
19
|
+
ProjectUserRemoved = 16,
|
|
20
|
+
NotifyAdded = 17,
|
|
21
|
+
PullRequestAdded = 18,
|
|
22
|
+
PullRequestUpdated = 19,
|
|
23
|
+
PullRequestCommented = 20,
|
|
24
|
+
PullRequestMerged = 21
|
|
25
|
+
}
|
|
26
|
+
export declare namespace Notification {
|
|
27
|
+
interface GetNotificationsParams {
|
|
28
|
+
minId?: number;
|
|
29
|
+
maxId?: number;
|
|
30
|
+
count?: number;
|
|
31
|
+
order?: Order;
|
|
32
|
+
}
|
|
33
|
+
interface GetNotificationsCountParams {
|
|
34
|
+
alreadyRead: boolean;
|
|
35
|
+
resourceAlreadyRead: boolean;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export declare namespace Space {
|
|
39
|
+
interface GetActivitiesParams {
|
|
40
|
+
activityTypeId?: ActivityType[];
|
|
41
|
+
minId?: number;
|
|
42
|
+
maxId?: number;
|
|
43
|
+
count?: number;
|
|
44
|
+
order?: Order;
|
|
45
|
+
}
|
|
46
|
+
interface PutSpaceNotificationParams {
|
|
47
|
+
content: string;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export declare namespace User {
|
|
51
|
+
interface PostUserParams {
|
|
52
|
+
userId: string;
|
|
53
|
+
password: string;
|
|
54
|
+
name: string;
|
|
55
|
+
mailAddress: string;
|
|
56
|
+
roleType: RoleType;
|
|
57
|
+
}
|
|
58
|
+
interface PatchUserParams {
|
|
59
|
+
password?: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
mailAddress?: string;
|
|
62
|
+
roleType?: RoleType;
|
|
63
|
+
}
|
|
64
|
+
enum RoleType {
|
|
65
|
+
Admin = 1,
|
|
66
|
+
User = 2,
|
|
67
|
+
Reporter = 3,
|
|
68
|
+
Viewer = 4,
|
|
69
|
+
GuestReporter = 5,
|
|
70
|
+
GuestViewer = 6
|
|
71
|
+
}
|
|
72
|
+
interface GetUserActivitiesParams {
|
|
73
|
+
activityTypeId?: ActivityType[];
|
|
74
|
+
minId?: number;
|
|
75
|
+
maxId?: number;
|
|
76
|
+
count?: number;
|
|
77
|
+
order?: Order;
|
|
78
|
+
}
|
|
79
|
+
interface GetUserStarsParams {
|
|
80
|
+
minId?: number;
|
|
81
|
+
maxId?: number;
|
|
82
|
+
count?: number;
|
|
83
|
+
order?: Order;
|
|
84
|
+
}
|
|
85
|
+
interface GetUserStarsCountParams {
|
|
86
|
+
since?: string;
|
|
87
|
+
until?: string;
|
|
88
|
+
}
|
|
89
|
+
interface GetRecentlyViewedParams {
|
|
90
|
+
order?: Order;
|
|
91
|
+
offset?: number;
|
|
92
|
+
count?: number;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export declare namespace Group {
|
|
96
|
+
interface GetGroupsParams {
|
|
97
|
+
order?: Order;
|
|
98
|
+
offset?: number;
|
|
99
|
+
count?: number;
|
|
100
|
+
}
|
|
101
|
+
interface PostGroupsParams {
|
|
102
|
+
name: string;
|
|
103
|
+
members?: string[];
|
|
104
|
+
}
|
|
105
|
+
interface PatchGroupParams {
|
|
106
|
+
name?: string;
|
|
107
|
+
members?: string[];
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
export declare namespace Team {
|
|
111
|
+
interface GetTeamsParams {
|
|
112
|
+
order?: Order;
|
|
113
|
+
offset?: number;
|
|
114
|
+
count?: number;
|
|
115
|
+
}
|
|
116
|
+
interface PatchTeamParams {
|
|
117
|
+
name?: string;
|
|
118
|
+
members?: number[];
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export declare namespace Project {
|
|
122
|
+
type TextFormattingRule = "backlog" | "markdown";
|
|
123
|
+
interface PostProjectParams {
|
|
124
|
+
name: string;
|
|
125
|
+
key: string;
|
|
126
|
+
chartEnabled: boolean;
|
|
127
|
+
projectLeaderCanEditProjectLeader?: boolean;
|
|
128
|
+
subtaskingEnabled: boolean;
|
|
129
|
+
textFormattingRule: TextFormattingRule;
|
|
130
|
+
}
|
|
131
|
+
interface PatchProjectParams {
|
|
132
|
+
name?: string;
|
|
133
|
+
key?: string;
|
|
134
|
+
chartEnabled?: boolean;
|
|
135
|
+
subtaskingEnabled?: boolean;
|
|
136
|
+
projectLeaderCanEditProjectLeader?: boolean;
|
|
137
|
+
textFormattingRule?: TextFormattingRule;
|
|
138
|
+
archived?: boolean;
|
|
139
|
+
}
|
|
140
|
+
interface GetProjectsParams {
|
|
141
|
+
archived?: boolean;
|
|
142
|
+
all?: boolean;
|
|
143
|
+
}
|
|
144
|
+
interface DeleteProjectUsersParams {
|
|
145
|
+
userId: number;
|
|
146
|
+
}
|
|
147
|
+
interface PostProjectAdministrators {
|
|
148
|
+
userId: number;
|
|
149
|
+
}
|
|
150
|
+
interface DeleteProjectAdministrators {
|
|
151
|
+
userId: number;
|
|
152
|
+
}
|
|
153
|
+
type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665";
|
|
154
|
+
interface PostIssueTypeParams {
|
|
155
|
+
name: string;
|
|
156
|
+
color: IssueTypeColor;
|
|
157
|
+
}
|
|
158
|
+
interface PatchIssueTypeParams {
|
|
159
|
+
name?: string;
|
|
160
|
+
color?: IssueTypeColor;
|
|
161
|
+
}
|
|
162
|
+
interface DeleteIssueTypeParams {
|
|
163
|
+
substituteIssueTypeId: number;
|
|
164
|
+
}
|
|
165
|
+
interface PostCategoriesParams {
|
|
166
|
+
name: string;
|
|
167
|
+
}
|
|
168
|
+
interface PatchCategoriesParams {
|
|
169
|
+
name: string;
|
|
170
|
+
}
|
|
171
|
+
interface PostVersionsParams {
|
|
172
|
+
name: string;
|
|
173
|
+
description: string;
|
|
174
|
+
startDate: string;
|
|
175
|
+
releaseDueDate: string;
|
|
176
|
+
}
|
|
177
|
+
interface PatchVersionsParams {
|
|
178
|
+
name: string;
|
|
179
|
+
description?: string;
|
|
180
|
+
startDate?: string;
|
|
181
|
+
releaseDueDate?: string;
|
|
182
|
+
archived?: boolean;
|
|
183
|
+
}
|
|
184
|
+
interface PostCustomFieldParams {
|
|
185
|
+
typeId: FieldType;
|
|
186
|
+
name: string;
|
|
187
|
+
applicableIssueTypes?: number[];
|
|
188
|
+
description?: string;
|
|
189
|
+
required?: boolean;
|
|
190
|
+
}
|
|
191
|
+
interface PostCustomFieldWithNumericParams extends PostCustomFieldParams {
|
|
192
|
+
min?: number;
|
|
193
|
+
max?: number;
|
|
194
|
+
initialValue?: number;
|
|
195
|
+
unit?: string;
|
|
196
|
+
}
|
|
197
|
+
interface PostCustomFieldWithDateParams extends PostCustomFieldParams {
|
|
198
|
+
min?: string;
|
|
199
|
+
max?: string;
|
|
200
|
+
initialValueType?: number;
|
|
201
|
+
initialDate?: string;
|
|
202
|
+
initialShift?: number;
|
|
203
|
+
}
|
|
204
|
+
interface PostCustomFieldWithListParams extends PostCustomFieldParams {
|
|
205
|
+
items?: string[];
|
|
206
|
+
allowInput?: boolean;
|
|
207
|
+
allowAddItem?: boolean;
|
|
208
|
+
}
|
|
209
|
+
interface PatchCustomFieldParams {
|
|
210
|
+
name?: string;
|
|
211
|
+
applicableIssueTypes?: number[];
|
|
212
|
+
description?: string;
|
|
213
|
+
required?: boolean;
|
|
214
|
+
}
|
|
215
|
+
interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams {
|
|
216
|
+
min?: number;
|
|
217
|
+
max?: number;
|
|
218
|
+
initialValue?: number;
|
|
219
|
+
unit?: string;
|
|
220
|
+
}
|
|
221
|
+
interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams {
|
|
222
|
+
min?: string;
|
|
223
|
+
max?: string;
|
|
224
|
+
initialValueType?: number;
|
|
225
|
+
initialDate?: string;
|
|
226
|
+
initialShift?: number;
|
|
227
|
+
}
|
|
228
|
+
interface PatchCustomFieldWithListParams extends PatchCustomFieldParams {
|
|
229
|
+
items?: string[];
|
|
230
|
+
allowInput?: boolean;
|
|
231
|
+
allowAddItem?: boolean;
|
|
232
|
+
}
|
|
233
|
+
interface PostCustomFieldItemParams {
|
|
234
|
+
name: string;
|
|
235
|
+
}
|
|
236
|
+
interface PatchCustomFieldItemParams {
|
|
237
|
+
name: string;
|
|
238
|
+
}
|
|
239
|
+
interface GetSharedFilesParams {
|
|
240
|
+
order?: Order;
|
|
241
|
+
offset?: number;
|
|
242
|
+
count?: number;
|
|
243
|
+
}
|
|
244
|
+
interface PostWebhookParams {
|
|
245
|
+
name?: string;
|
|
246
|
+
description?: string;
|
|
247
|
+
hookUrl?: string;
|
|
248
|
+
allEvent?: boolean;
|
|
249
|
+
activityTypeIds?: number[];
|
|
250
|
+
}
|
|
251
|
+
interface PatchWebhookParams {
|
|
252
|
+
name?: string;
|
|
253
|
+
description?: string;
|
|
254
|
+
hookUrl?: string;
|
|
255
|
+
allEvent?: boolean;
|
|
256
|
+
activityTypeIds?: number[];
|
|
257
|
+
}
|
|
258
|
+
enum FieldType {
|
|
259
|
+
Text = 1,
|
|
260
|
+
TextArea = 2,
|
|
261
|
+
Numeric = 3,
|
|
262
|
+
Date = 4,
|
|
263
|
+
SingleList = 5,
|
|
264
|
+
MultipleList = 6,
|
|
265
|
+
CheckBox = 7,
|
|
266
|
+
Radio = 8
|
|
267
|
+
}
|
|
268
|
+
interface PostStarParams {
|
|
269
|
+
issueId?: number;
|
|
270
|
+
commentId?: number;
|
|
271
|
+
wikiId?: number;
|
|
272
|
+
pullRequestId?: number;
|
|
273
|
+
pullRequestCommentId?: number;
|
|
274
|
+
}
|
|
275
|
+
type ProjectStatusColor = "#ea2c00" | "#e87758" | "#e07b9a" | "#868cb7" | "#3b9dbd" | "#4caf93" | "#b0be3c" | "#eda62a" | "#f42858" | "#393939";
|
|
276
|
+
interface PostStatusParams {
|
|
277
|
+
name: string;
|
|
278
|
+
color: ProjectStatusColor;
|
|
279
|
+
}
|
|
280
|
+
interface PatchStatusParams {
|
|
281
|
+
name?: string;
|
|
282
|
+
color?: ProjectStatusColor;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
export declare namespace Issue {
|
|
286
|
+
interface PostIssueParams {
|
|
287
|
+
projectId: number;
|
|
288
|
+
summary: string;
|
|
289
|
+
priorityId: number;
|
|
290
|
+
issueTypeId: number;
|
|
291
|
+
parentIssueId?: number;
|
|
292
|
+
description?: string;
|
|
293
|
+
startDate?: string;
|
|
294
|
+
dueDate?: string;
|
|
295
|
+
estimatedHours?: number;
|
|
296
|
+
actualHours?: number;
|
|
297
|
+
categoryId?: number[];
|
|
298
|
+
versionId?: number[];
|
|
299
|
+
milestoneId?: number[];
|
|
300
|
+
assigneeId?: number;
|
|
301
|
+
notifiedUserId?: number[];
|
|
302
|
+
attachmentId?: number[];
|
|
303
|
+
[customField_: string]: any;
|
|
304
|
+
}
|
|
305
|
+
interface PatchIssueParams {
|
|
306
|
+
summary?: string;
|
|
307
|
+
parentIssueId?: number;
|
|
308
|
+
description?: string;
|
|
309
|
+
statusId?: number;
|
|
310
|
+
resolutionId?: number;
|
|
311
|
+
startDate?: string;
|
|
312
|
+
dueDate?: string;
|
|
313
|
+
estimatedHours?: number;
|
|
314
|
+
actualHours?: number;
|
|
315
|
+
issueTypeId?: number;
|
|
316
|
+
categoryId?: number[];
|
|
317
|
+
versionId?: number[];
|
|
318
|
+
milestoneId?: number[];
|
|
319
|
+
priorityId?: number;
|
|
320
|
+
assigneeId?: number;
|
|
321
|
+
notifiedUserId?: number[];
|
|
322
|
+
attachmentId?: number[];
|
|
323
|
+
comment?: string;
|
|
324
|
+
[customField_: string]: any;
|
|
325
|
+
}
|
|
326
|
+
interface GetIssuesParams {
|
|
327
|
+
projectId?: number[];
|
|
328
|
+
issueTypeId?: number[];
|
|
329
|
+
categoryId?: number[];
|
|
330
|
+
versionId?: number[];
|
|
331
|
+
milestoneId?: number[];
|
|
332
|
+
statusId?: number[];
|
|
333
|
+
priorityId?: number[];
|
|
334
|
+
assigneeId?: number[];
|
|
335
|
+
createdUserId?: number[];
|
|
336
|
+
resolutionId?: number[];
|
|
337
|
+
parentChild?: ParentChildType;
|
|
338
|
+
attachment?: boolean;
|
|
339
|
+
sharedFile?: boolean;
|
|
340
|
+
sort?: SortKey;
|
|
341
|
+
order?: Order;
|
|
342
|
+
offset?: number;
|
|
343
|
+
count?: number;
|
|
344
|
+
createdSince?: string;
|
|
345
|
+
createdUntil?: string;
|
|
346
|
+
updatedSince?: string;
|
|
347
|
+
updatedUntil?: string;
|
|
348
|
+
startDateSince?: string;
|
|
349
|
+
startDateUntil?: string;
|
|
350
|
+
dueDateSince?: string;
|
|
351
|
+
dueDateUntil?: string;
|
|
352
|
+
id?: number[];
|
|
353
|
+
parentIssueId?: number[];
|
|
354
|
+
keyword?: string;
|
|
355
|
+
[customField_: string]: any;
|
|
356
|
+
}
|
|
357
|
+
enum ParentChildType {
|
|
358
|
+
All = 0,
|
|
359
|
+
NotChild = 1,
|
|
360
|
+
Child = 2,
|
|
361
|
+
NotChildNotParent = 3,
|
|
362
|
+
Parent = 4
|
|
363
|
+
}
|
|
364
|
+
type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue";
|
|
365
|
+
interface GetIssueCommentsParams {
|
|
366
|
+
minId?: number;
|
|
367
|
+
maxId?: number;
|
|
368
|
+
count?: number;
|
|
369
|
+
order?: Order;
|
|
370
|
+
}
|
|
371
|
+
interface PostIssueCommentsParams {
|
|
372
|
+
content: string;
|
|
373
|
+
notifiedUserId?: number[];
|
|
374
|
+
attachmentId?: number[];
|
|
375
|
+
}
|
|
376
|
+
interface PatchIssueCommentParams {
|
|
377
|
+
content: string;
|
|
378
|
+
}
|
|
379
|
+
interface IssueCommentNotifications {
|
|
380
|
+
notifiedUserId: number[];
|
|
381
|
+
}
|
|
382
|
+
interface LinkIssueSharedFilesParams {
|
|
383
|
+
fileId: number[];
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
export declare namespace PullRequest {
|
|
387
|
+
interface GetPullRequestsParams {
|
|
388
|
+
statusId?: number[];
|
|
389
|
+
assigneeId?: number[];
|
|
390
|
+
issueId?: number[];
|
|
391
|
+
createdUserId?: number[];
|
|
392
|
+
offset?: number;
|
|
393
|
+
count?: number;
|
|
394
|
+
}
|
|
395
|
+
interface PostPullRequestParams {
|
|
396
|
+
summary: string;
|
|
397
|
+
description: string;
|
|
398
|
+
base: string;
|
|
399
|
+
branch: string;
|
|
400
|
+
issueId?: number;
|
|
401
|
+
assigneeId?: number;
|
|
402
|
+
notifiedUserId?: number[];
|
|
403
|
+
attachmentId?: number[];
|
|
404
|
+
}
|
|
405
|
+
interface PatchPullRequestParams {
|
|
406
|
+
summary?: string;
|
|
407
|
+
description?: string;
|
|
408
|
+
issueId?: number;
|
|
409
|
+
assigneeId?: number;
|
|
410
|
+
notifiedUserId?: number[];
|
|
411
|
+
comment?: string[];
|
|
412
|
+
}
|
|
413
|
+
interface GetPullRequestCommentsParams {
|
|
414
|
+
minId?: number;
|
|
415
|
+
maxId?: number;
|
|
416
|
+
count?: number;
|
|
417
|
+
order?: Order;
|
|
418
|
+
}
|
|
419
|
+
interface PostPullRequestCommentsParams {
|
|
420
|
+
content: string;
|
|
421
|
+
notifiedUserId?: number[];
|
|
422
|
+
}
|
|
423
|
+
interface PatchPullRequestCommentsParams {
|
|
424
|
+
content: string;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
export declare namespace Wiki {
|
|
428
|
+
interface GetWikiParams {
|
|
429
|
+
projectIdOrKey: string | number;
|
|
430
|
+
keyword?: string;
|
|
431
|
+
}
|
|
432
|
+
interface PostWikiParams {
|
|
433
|
+
projectId: number;
|
|
434
|
+
name: string;
|
|
435
|
+
content: string;
|
|
436
|
+
mailNotify?: boolean;
|
|
437
|
+
}
|
|
438
|
+
interface PatchWikiParams {
|
|
439
|
+
name?: string;
|
|
440
|
+
content?: string;
|
|
441
|
+
mailNotify?: boolean;
|
|
442
|
+
}
|
|
443
|
+
interface GetWikisHistoryParams {
|
|
444
|
+
minId?: number;
|
|
445
|
+
maxId?: number;
|
|
446
|
+
count?: number;
|
|
447
|
+
order?: Order;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
export declare namespace OAuth2 {
|
|
451
|
+
interface Credentials {
|
|
452
|
+
clientId: string;
|
|
453
|
+
clientSecret: string;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default class Request {
|
|
2
|
+
private configure;
|
|
3
|
+
constructor(configure: {
|
|
4
|
+
host: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
accessToken?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
});
|
|
9
|
+
get<T>(path: string, params?: any): Promise<T>;
|
|
10
|
+
post<T>(path: string, params?: any): Promise<T>;
|
|
11
|
+
put<T>(path: string, params: any): Promise<T>;
|
|
12
|
+
patch<T>(path: string, params: any): Promise<T>;
|
|
13
|
+
delete<T>(path: string, params?: any): Promise<T>;
|
|
14
|
+
request(options: {
|
|
15
|
+
method: string;
|
|
16
|
+
path: string;
|
|
17
|
+
params?: Params | FormData;
|
|
18
|
+
}): Promise<Response>;
|
|
19
|
+
checkStatus(response: Response): Promise<Response>;
|
|
20
|
+
parseJSON<T>(response: Response): Promise<T>;
|
|
21
|
+
private toQueryString;
|
|
22
|
+
get webAppBaseURL(): string;
|
|
23
|
+
get restBaseURL(): string;
|
|
24
|
+
}
|
|
25
|
+
export declare type Params = {
|
|
26
|
+
[index: string]: number | string | number[] | string[];
|
|
27
|
+
};
|
package/package.json
CHANGED
|
@@ -1,51 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backlog-js",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.6",
|
|
4
4
|
"description": "Backlog API v2 client for browser and node",
|
|
5
|
-
"main": "dist/backlog.js",
|
|
5
|
+
"main": "dist/backlog.min.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git://github.com/nulab/backlog-js.git"
|
|
9
10
|
},
|
|
10
11
|
"scripts": {
|
|
11
|
-
"test": "
|
|
12
|
-
"test-cov": "
|
|
12
|
+
"test": "mocha --timeout 10000 --require espower-typescript/guess test/test*.ts",
|
|
13
|
+
"test-cov": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec dist/test/**/test*.js",
|
|
13
14
|
"coveralls": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
|
|
14
|
-
"
|
|
15
|
-
"build
|
|
16
|
-
"build-
|
|
17
|
-
"build-
|
|
18
|
-
"build-
|
|
15
|
+
"clean": "/bin/rm -rf dist",
|
|
16
|
+
"build": "npm run clean && npm run build-tsc && npm run copy-dts && npm run build-dist && npm run build-minify",
|
|
17
|
+
"build-dist": "browserify --standalone Backlog dist/src/index.js -o dist/backlog.js",
|
|
18
|
+
"build-minify": "uglifyjs dist/backlog.js -o dist/backlog.min.js",
|
|
19
|
+
"build-tsc": "tsc --declaration",
|
|
20
|
+
"copy-dts": "mkdir -p dist/types && cp -r dist/src/*.d.ts dist/types",
|
|
19
21
|
"changelog": "ghch -w -F markdown -N ${VERSION}"
|
|
20
22
|
},
|
|
21
23
|
"author": "vvatanabe",
|
|
22
24
|
"license": "MIT",
|
|
23
25
|
"dependencies": {
|
|
24
|
-
"qs": "^6.10.
|
|
26
|
+
"qs": "^6.10.3"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
27
29
|
"@types/dotenv": "^6.1.1",
|
|
28
|
-
"@types/empower": "^1.2.
|
|
29
|
-
"@types/isomorphic-fetch": "0.0.
|
|
30
|
-
"@types/mocha": "^
|
|
30
|
+
"@types/empower": "^1.2.32",
|
|
31
|
+
"@types/isomorphic-fetch": "0.0.36",
|
|
32
|
+
"@types/mocha": "^9.1.1",
|
|
31
33
|
"@types/nock": "^10.0.3",
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"@types/power-assert": "^1.5.
|
|
34
|
-
"@types/power-assert-formatter": "^1.4.
|
|
35
|
-
"@types/qs": "^6.9.
|
|
34
|
+
"@types/node": "^17.0.31",
|
|
35
|
+
"@types/power-assert": "^1.5.8",
|
|
36
|
+
"@types/power-assert-formatter": "^1.4.30",
|
|
37
|
+
"@types/qs": "^6.9.7",
|
|
36
38
|
"browserify": "^17.0.0",
|
|
37
|
-
"coveralls": "^3.1.
|
|
38
|
-
"dotenv": "^
|
|
39
|
+
"coveralls": "^3.1.1",
|
|
40
|
+
"dotenv": "^16.0.0",
|
|
39
41
|
"es6-promise": "^4.2.8",
|
|
40
42
|
"espower-typescript": "^10.0.0",
|
|
41
43
|
"isomorphic-fetch": "^3.0.0",
|
|
42
44
|
"isomorphic-form-data": "^2.0.0",
|
|
43
45
|
"istanbul": "^0.4.5",
|
|
44
|
-
"mocha": "^
|
|
45
|
-
"nock": "^13.
|
|
46
|
+
"mocha": "^10.0.0",
|
|
47
|
+
"nock": "^13.2.4",
|
|
46
48
|
"power-assert": "^1.6.1",
|
|
47
|
-
"typescript": "^4.
|
|
48
|
-
"uglify-js": "^3.
|
|
49
|
+
"typescript": "^4.6.4",
|
|
50
|
+
"uglify-js": "^3.15.4"
|
|
49
51
|
},
|
|
50
52
|
"keywords": [
|
|
51
53
|
"nulab",
|