1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
12 | function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
13 | return new (P || (P = Promise))(function (resolve, reject) {
|
14 | function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
15 | function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
16 | function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
17 | step((generator = generator.apply(thisArg, _arguments || [])).next());
|
18 | });
|
19 | };
|
20 | Object.defineProperty(exports, "__esModule", { value: true });
|
21 | exports.WorkItemTrackingApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const WorkItemTrackingInterfaces = require("./interfaces/WorkItemTrackingInterfaces");
|
24 | class WorkItemTrackingApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-WorkItemTracking-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 | getAccountMyWorkData(queryOption) {
|
34 | return __awaiter(this, void 0, void 0, function* () {
|
35 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
36 | let routeValues = {};
|
37 | let queryValues = {
|
38 | '$queryOption': queryOption,
|
39 | };
|
40 | try {
|
41 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "def3d688-ddf5-4096-9024-69beea15cdbd", routeValues, queryValues);
|
42 | let url = verData.requestUrl;
|
43 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
44 | let res;
|
45 | res = yield this.rest.get(url, options);
|
46 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountMyWorkResult, false);
|
47 | resolve(ret);
|
48 | }
|
49 | catch (err) {
|
50 | reject(err);
|
51 | }
|
52 | }));
|
53 | });
|
54 | }
|
55 | |
56 |
|
57 |
|
58 |
|
59 | getRecentActivityData() {
|
60 | return __awaiter(this, void 0, void 0, function* () {
|
61 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
62 | let routeValues = {};
|
63 | try {
|
64 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "1bc988f4-c15f-4072-ad35-497c87e3a909", routeValues);
|
65 | let url = verData.requestUrl;
|
66 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
67 | let res;
|
68 | res = yield this.rest.get(url, options);
|
69 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentActivityWorkItemModel2, true);
|
70 | resolve(ret);
|
71 | }
|
72 | catch (err) {
|
73 | reject(err);
|
74 | }
|
75 | }));
|
76 | });
|
77 | }
|
78 | |
79 |
|
80 |
|
81 |
|
82 | getRecentMentions() {
|
83 | return __awaiter(this, void 0, void 0, function* () {
|
84 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
85 | let routeValues = {};
|
86 | try {
|
87 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "d60eeb6e-e18c-4478-9e94-a0094e28f41c", routeValues);
|
88 | let url = verData.requestUrl;
|
89 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
90 | let res;
|
91 | res = yield this.rest.get(url, options);
|
92 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.AccountRecentMentionWorkItemModel, true);
|
93 | resolve(ret);
|
94 | }
|
95 | catch (err) {
|
96 | reject(err);
|
97 | }
|
98 | }));
|
99 | });
|
100 | }
|
101 | |
102 |
|
103 |
|
104 |
|
105 | getWorkArtifactLinkTypes() {
|
106 | return __awaiter(this, void 0, void 0, function* () {
|
107 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
108 | let routeValues = {};
|
109 | try {
|
110 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "1a31de40-e318-41cd-a6c6-881077df52e3", routeValues);
|
111 | let url = verData.requestUrl;
|
112 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
113 | let res;
|
114 | res = yield this.rest.get(url, options);
|
115 | let ret = this.formatResponse(res.result, null, true);
|
116 | resolve(ret);
|
117 | }
|
118 | catch (err) {
|
119 | reject(err);
|
120 | }
|
121 | }));
|
122 | });
|
123 | }
|
124 | |
125 |
|
126 |
|
127 |
|
128 |
|
129 |
|
130 | queryWorkItemsForArtifactUris(artifactUriQuery, project) {
|
131 | return __awaiter(this, void 0, void 0, function* () {
|
132 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
133 | let routeValues = {
|
134 | project: project
|
135 | };
|
136 | try {
|
137 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3", routeValues);
|
138 | let url = verData.requestUrl;
|
139 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
140 | let res;
|
141 | res = yield this.rest.create(url, artifactUriQuery, options);
|
142 | let ret = this.formatResponse(res.result, null, false);
|
143 | resolve(ret);
|
144 | }
|
145 | catch (err) {
|
146 | reject(err);
|
147 | }
|
148 | }));
|
149 | });
|
150 | }
|
151 | |
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 | createAttachment(customHeaders, contentStream, fileName, uploadType, project, areaPath) {
|
161 | return __awaiter(this, void 0, void 0, function* () {
|
162 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
163 | let routeValues = {
|
164 | project: project
|
165 | };
|
166 | let queryValues = {
|
167 | fileName: fileName,
|
168 | uploadType: uploadType,
|
169 | areaPath: areaPath,
|
170 | };
|
171 | customHeaders = customHeaders || {};
|
172 | customHeaders["Content-Type"] = "application/octet-stream";
|
173 | try {
|
174 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues);
|
175 | let url = verData.requestUrl;
|
176 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
177 | options.additionalHeaders = customHeaders;
|
178 | let res;
|
179 | res = yield this.rest.uploadStream("POST", url, contentStream, options);
|
180 | let ret = this.formatResponse(res.result, null, false);
|
181 | resolve(ret);
|
182 | }
|
183 | catch (err) {
|
184 | reject(err);
|
185 | }
|
186 | }));
|
187 | });
|
188 | }
|
189 | |
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | getAttachmentContent(id, fileName, project, download) {
|
198 | return __awaiter(this, void 0, void 0, function* () {
|
199 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
200 | let routeValues = {
|
201 | project: project,
|
202 | id: id
|
203 | };
|
204 | let queryValues = {
|
205 | fileName: fileName,
|
206 | download: download,
|
207 | };
|
208 | try {
|
209 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues);
|
210 | let url = verData.requestUrl;
|
211 | let apiVersion = verData.apiVersion;
|
212 | let accept = this.createAcceptHeader("application/octet-stream", apiVersion);
|
213 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
214 | }
|
215 | catch (err) {
|
216 | reject(err);
|
217 | }
|
218 | }));
|
219 | });
|
220 | }
|
221 | |
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 | getAttachmentZip(id, fileName, project, download) {
|
230 | return __awaiter(this, void 0, void 0, function* () {
|
231 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
232 | let routeValues = {
|
233 | project: project,
|
234 | id: id
|
235 | };
|
236 | let queryValues = {
|
237 | fileName: fileName,
|
238 | download: download,
|
239 | };
|
240 | try {
|
241 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "e07b5fa4-1499-494d-a496-64b860fd64ff", routeValues, queryValues);
|
242 | let url = verData.requestUrl;
|
243 | let apiVersion = verData.apiVersion;
|
244 | let accept = this.createAcceptHeader("application/zip", apiVersion);
|
245 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
246 | }
|
247 | catch (err) {
|
248 | reject(err);
|
249 | }
|
250 | }));
|
251 | });
|
252 | }
|
253 | |
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 | getClassificationNodes(project, ids, depth, errorPolicy) {
|
262 | return __awaiter(this, void 0, void 0, function* () {
|
263 | if (ids == null) {
|
264 | throw new TypeError('ids can not be null or undefined');
|
265 | }
|
266 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
267 | let routeValues = {
|
268 | project: project
|
269 | };
|
270 | let queryValues = {
|
271 | ids: ids && ids.join(","),
|
272 | '$depth': depth,
|
273 | errorPolicy: errorPolicy,
|
274 | };
|
275 | try {
|
276 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a70579d1-f53a-48ee-a5be-7be8659023b9", routeValues, queryValues);
|
277 | let url = verData.requestUrl;
|
278 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
279 | let res;
|
280 | res = yield this.rest.get(url, options);
|
281 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, true);
|
282 | resolve(ret);
|
283 | }
|
284 | catch (err) {
|
285 | reject(err);
|
286 | }
|
287 | }));
|
288 | });
|
289 | }
|
290 | |
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | getRootNodes(project, depth) {
|
297 | return __awaiter(this, void 0, void 0, function* () {
|
298 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
299 | let routeValues = {
|
300 | project: project
|
301 | };
|
302 | let queryValues = {
|
303 | '$depth': depth,
|
304 | };
|
305 | try {
|
306 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a70579d1-f53a-48ee-a5be-7be8659023b9", routeValues, queryValues);
|
307 | let url = verData.requestUrl;
|
308 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
309 | let res;
|
310 | res = yield this.rest.get(url, options);
|
311 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, true);
|
312 | resolve(ret);
|
313 | }
|
314 | catch (err) {
|
315 | reject(err);
|
316 | }
|
317 | }));
|
318 | });
|
319 | }
|
320 | |
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 | createOrUpdateClassificationNode(postedNode, project, structureGroup, path) {
|
329 | return __awaiter(this, void 0, void 0, function* () {
|
330 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
331 | let routeValues = {
|
332 | project: project,
|
333 | structureGroup: structureGroup,
|
334 | path: path
|
335 | };
|
336 | try {
|
337 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues);
|
338 | let url = verData.requestUrl;
|
339 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
340 | let res;
|
341 | res = yield this.rest.create(url, postedNode, options);
|
342 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false);
|
343 | resolve(ret);
|
344 | }
|
345 | catch (err) {
|
346 | reject(err);
|
347 | }
|
348 | }));
|
349 | });
|
350 | }
|
351 | |
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 | deleteClassificationNode(project, structureGroup, path, reclassifyId) {
|
360 | return __awaiter(this, void 0, void 0, function* () {
|
361 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
362 | let routeValues = {
|
363 | project: project,
|
364 | structureGroup: structureGroup,
|
365 | path: path
|
366 | };
|
367 | let queryValues = {
|
368 | '$reclassifyId': reclassifyId,
|
369 | };
|
370 | try {
|
371 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues, queryValues);
|
372 | let url = verData.requestUrl;
|
373 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
374 | let res;
|
375 | res = yield this.rest.del(url, options);
|
376 | let ret = this.formatResponse(res.result, null, false);
|
377 | resolve(ret);
|
378 | }
|
379 | catch (err) {
|
380 | reject(err);
|
381 | }
|
382 | }));
|
383 | });
|
384 | }
|
385 | |
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 | getClassificationNode(project, structureGroup, path, depth) {
|
394 | return __awaiter(this, void 0, void 0, function* () {
|
395 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
396 | let routeValues = {
|
397 | project: project,
|
398 | structureGroup: structureGroup,
|
399 | path: path
|
400 | };
|
401 | let queryValues = {
|
402 | '$depth': depth,
|
403 | };
|
404 | try {
|
405 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues, queryValues);
|
406 | let url = verData.requestUrl;
|
407 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
408 | let res;
|
409 | res = yield this.rest.get(url, options);
|
410 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false);
|
411 | resolve(ret);
|
412 | }
|
413 | catch (err) {
|
414 | reject(err);
|
415 | }
|
416 | }));
|
417 | });
|
418 | }
|
419 | |
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 | updateClassificationNode(postedNode, project, structureGroup, path) {
|
428 | return __awaiter(this, void 0, void 0, function* () {
|
429 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
430 | let routeValues = {
|
431 | project: project,
|
432 | structureGroup: structureGroup,
|
433 | path: path
|
434 | };
|
435 | try {
|
436 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "5a172953-1b41-49d3-840a-33f79c3ce89f", routeValues);
|
437 | let url = verData.requestUrl;
|
438 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
439 | let res;
|
440 | res = yield this.rest.update(url, postedNode, options);
|
441 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemClassificationNode, false);
|
442 | resolve(ret);
|
443 | }
|
444 | catch (err) {
|
445 | reject(err);
|
446 | }
|
447 | }));
|
448 | });
|
449 | }
|
450 | |
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 | getEngagedUsers(project, workItemId, commentId, reactionType, top, skip) {
|
461 | return __awaiter(this, void 0, void 0, function* () {
|
462 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
463 | let routeValues = {
|
464 | project: project,
|
465 | workItemId: workItemId,
|
466 | commentId: commentId,
|
467 | reactionType: reactionType
|
468 | };
|
469 | let queryValues = {
|
470 | '$top': top,
|
471 | '$skip': skip,
|
472 | };
|
473 | try {
|
474 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "e33ca5e0-2349-4285-af3d-d72d86781c35", routeValues, queryValues);
|
475 | let url = verData.requestUrl;
|
476 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
477 | let res;
|
478 | res = yield this.rest.get(url, options);
|
479 | let ret = this.formatResponse(res.result, null, true);
|
480 | resolve(ret);
|
481 | }
|
482 | catch (err) {
|
483 | reject(err);
|
484 | }
|
485 | }));
|
486 | });
|
487 | }
|
488 | |
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 |
|
495 | addComment(request, project, workItemId) {
|
496 | return __awaiter(this, void 0, void 0, function* () {
|
497 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
498 | let routeValues = {
|
499 | project: project,
|
500 | workItemId: workItemId
|
501 | };
|
502 | try {
|
503 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues);
|
504 | let url = verData.requestUrl;
|
505 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
506 | let res;
|
507 | res = yield this.rest.create(url, request, options);
|
508 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false);
|
509 | resolve(ret);
|
510 | }
|
511 | catch (err) {
|
512 | reject(err);
|
513 | }
|
514 | }));
|
515 | });
|
516 | }
|
517 | |
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 | deleteComment(project, workItemId, commentId) {
|
525 | return __awaiter(this, void 0, void 0, function* () {
|
526 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
527 | let routeValues = {
|
528 | project: project,
|
529 | workItemId: workItemId,
|
530 | commentId: commentId
|
531 | };
|
532 | try {
|
533 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues);
|
534 | let url = verData.requestUrl;
|
535 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
536 | let res;
|
537 | res = yield this.rest.del(url, options);
|
538 | let ret = this.formatResponse(res.result, null, false);
|
539 | resolve(ret);
|
540 | }
|
541 | catch (err) {
|
542 | reject(err);
|
543 | }
|
544 | }));
|
545 | });
|
546 | }
|
547 | |
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 | getComment(project, workItemId, commentId, includeDeleted, expand) {
|
557 | return __awaiter(this, void 0, void 0, function* () {
|
558 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
559 | let routeValues = {
|
560 | project: project,
|
561 | workItemId: workItemId,
|
562 | commentId: commentId
|
563 | };
|
564 | let queryValues = {
|
565 | includeDeleted: includeDeleted,
|
566 | '$expand': expand,
|
567 | };
|
568 | try {
|
569 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues);
|
570 | let url = verData.requestUrl;
|
571 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
572 | let res;
|
573 | res = yield this.rest.get(url, options);
|
574 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false);
|
575 | resolve(ret);
|
576 | }
|
577 | catch (err) {
|
578 | reject(err);
|
579 | }
|
580 | }));
|
581 | });
|
582 | }
|
583 | |
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 |
|
594 | getComments(project, workItemId, top, continuationToken, includeDeleted, expand, order) {
|
595 | return __awaiter(this, void 0, void 0, function* () {
|
596 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
597 | let routeValues = {
|
598 | project: project,
|
599 | workItemId: workItemId
|
600 | };
|
601 | let queryValues = {
|
602 | '$top': top,
|
603 | continuationToken: continuationToken,
|
604 | includeDeleted: includeDeleted,
|
605 | '$expand': expand,
|
606 | order: order,
|
607 | };
|
608 | try {
|
609 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues);
|
610 | let url = verData.requestUrl;
|
611 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
612 | let res;
|
613 | res = yield this.rest.get(url, options);
|
614 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentList, false);
|
615 | resolve(ret);
|
616 | }
|
617 | catch (err) {
|
618 | reject(err);
|
619 | }
|
620 | }));
|
621 | });
|
622 | }
|
623 | |
624 |
|
625 |
|
626 |
|
627 |
|
628 |
|
629 |
|
630 |
|
631 |
|
632 | getCommentsBatch(project, workItemId, ids, includeDeleted, expand) {
|
633 | return __awaiter(this, void 0, void 0, function* () {
|
634 | if (ids == null) {
|
635 | throw new TypeError('ids can not be null or undefined');
|
636 | }
|
637 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
638 | let routeValues = {
|
639 | project: project,
|
640 | workItemId: workItemId
|
641 | };
|
642 | let queryValues = {
|
643 | ids: ids && ids.join(","),
|
644 | includeDeleted: includeDeleted,
|
645 | '$expand': expand,
|
646 | };
|
647 | try {
|
648 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues, queryValues);
|
649 | let url = verData.requestUrl;
|
650 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
651 | let res;
|
652 | res = yield this.rest.get(url, options);
|
653 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentList, false);
|
654 | resolve(ret);
|
655 | }
|
656 | catch (err) {
|
657 | reject(err);
|
658 | }
|
659 | }));
|
660 | });
|
661 | }
|
662 | |
663 |
|
664 |
|
665 |
|
666 |
|
667 |
|
668 |
|
669 |
|
670 | updateComment(request, project, workItemId, commentId) {
|
671 | return __awaiter(this, void 0, void 0, function* () {
|
672 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
673 | let routeValues = {
|
674 | project: project,
|
675 | workItemId: workItemId,
|
676 | commentId: commentId
|
677 | };
|
678 | try {
|
679 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "608aac0a-32e1-4493-a863-b9cf4566d257", routeValues);
|
680 | let url = verData.requestUrl;
|
681 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
682 | let res;
|
683 | res = yield this.rest.update(url, request, options);
|
684 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.Comment, false);
|
685 | resolve(ret);
|
686 | }
|
687 | catch (err) {
|
688 | reject(err);
|
689 | }
|
690 | }));
|
691 | });
|
692 | }
|
693 | |
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 | createCommentReaction(project, workItemId, commentId, reactionType) {
|
702 | return __awaiter(this, void 0, void 0, function* () {
|
703 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
704 | let routeValues = {
|
705 | project: project,
|
706 | workItemId: workItemId,
|
707 | commentId: commentId,
|
708 | reactionType: reactionType
|
709 | };
|
710 | try {
|
711 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues);
|
712 | let url = verData.requestUrl;
|
713 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
714 | let res;
|
715 | res = yield this.rest.replace(url, null, options);
|
716 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, false);
|
717 | resolve(ret);
|
718 | }
|
719 | catch (err) {
|
720 | reject(err);
|
721 | }
|
722 | }));
|
723 | });
|
724 | }
|
725 | |
726 |
|
727 |
|
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 | deleteCommentReaction(project, workItemId, commentId, reactionType) {
|
734 | return __awaiter(this, void 0, void 0, function* () {
|
735 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
736 | let routeValues = {
|
737 | project: project,
|
738 | workItemId: workItemId,
|
739 | commentId: commentId,
|
740 | reactionType: reactionType
|
741 | };
|
742 | try {
|
743 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues);
|
744 | let url = verData.requestUrl;
|
745 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
746 | let res;
|
747 | res = yield this.rest.del(url, options);
|
748 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, false);
|
749 | resolve(ret);
|
750 | }
|
751 | catch (err) {
|
752 | reject(err);
|
753 | }
|
754 | }));
|
755 | });
|
756 | }
|
757 | |
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 |
|
764 | getCommentReactions(project, workItemId, commentId) {
|
765 | return __awaiter(this, void 0, void 0, function* () {
|
766 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
767 | let routeValues = {
|
768 | project: project,
|
769 | workItemId: workItemId,
|
770 | commentId: commentId
|
771 | };
|
772 | try {
|
773 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f6cb3f27-1028-4851-af96-887e570dc21f", routeValues);
|
774 | let url = verData.requestUrl;
|
775 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
776 | let res;
|
777 | res = yield this.rest.get(url, options);
|
778 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentReaction, true);
|
779 | resolve(ret);
|
780 | }
|
781 | catch (err) {
|
782 | reject(err);
|
783 | }
|
784 | }));
|
785 | });
|
786 | }
|
787 | |
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 | getCommentVersion(project, workItemId, commentId, version) {
|
794 | return __awaiter(this, void 0, void 0, function* () {
|
795 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
796 | let routeValues = {
|
797 | project: project,
|
798 | workItemId: workItemId,
|
799 | commentId: commentId,
|
800 | version: version
|
801 | };
|
802 | try {
|
803 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "49e03b34-3be0-42e3-8a5d-e8dfb88ac954", routeValues);
|
804 | let url = verData.requestUrl;
|
805 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
806 | let res;
|
807 | res = yield this.rest.get(url, options);
|
808 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentVersion, false);
|
809 | resolve(ret);
|
810 | }
|
811 | catch (err) {
|
812 | reject(err);
|
813 | }
|
814 | }));
|
815 | });
|
816 | }
|
817 | |
818 |
|
819 |
|
820 |
|
821 |
|
822 | getCommentVersions(project, workItemId, commentId) {
|
823 | return __awaiter(this, void 0, void 0, function* () {
|
824 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
825 | let routeValues = {
|
826 | project: project,
|
827 | workItemId: workItemId,
|
828 | commentId: commentId
|
829 | };
|
830 | try {
|
831 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "49e03b34-3be0-42e3-8a5d-e8dfb88ac954", routeValues);
|
832 | let url = verData.requestUrl;
|
833 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
834 | let res;
|
835 | res = yield this.rest.get(url, options);
|
836 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.CommentVersion, true);
|
837 | resolve(ret);
|
838 | }
|
839 | catch (err) {
|
840 | reject(err);
|
841 | }
|
842 | }));
|
843 | });
|
844 | }
|
845 | |
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 | createField(workItemField, project) {
|
852 | return __awaiter(this, void 0, void 0, function* () {
|
853 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
854 | let routeValues = {
|
855 | project: project
|
856 | };
|
857 | try {
|
858 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues);
|
859 | let url = verData.requestUrl;
|
860 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
861 | let res;
|
862 | res = yield this.rest.create(url, workItemField, options);
|
863 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false);
|
864 | resolve(ret);
|
865 | }
|
866 | catch (err) {
|
867 | reject(err);
|
868 | }
|
869 | }));
|
870 | });
|
871 | }
|
872 | |
873 |
|
874 |
|
875 |
|
876 |
|
877 |
|
878 | deleteField(fieldNameOrRefName, project) {
|
879 | return __awaiter(this, void 0, void 0, function* () {
|
880 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
881 | let routeValues = {
|
882 | project: project,
|
883 | fieldNameOrRefName: fieldNameOrRefName
|
884 | };
|
885 | try {
|
886 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues);
|
887 | let url = verData.requestUrl;
|
888 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
889 | let res;
|
890 | res = yield this.rest.del(url, options);
|
891 | let ret = this.formatResponse(res.result, null, false);
|
892 | resolve(ret);
|
893 | }
|
894 | catch (err) {
|
895 | reject(err);
|
896 | }
|
897 | }));
|
898 | });
|
899 | }
|
900 | |
901 |
|
902 |
|
903 |
|
904 |
|
905 |
|
906 | getField(fieldNameOrRefName, project) {
|
907 | return __awaiter(this, void 0, void 0, function* () {
|
908 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
909 | let routeValues = {
|
910 | project: project,
|
911 | fieldNameOrRefName: fieldNameOrRefName
|
912 | };
|
913 | try {
|
914 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues);
|
915 | let url = verData.requestUrl;
|
916 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
917 | let res;
|
918 | res = yield this.rest.get(url, options);
|
919 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false);
|
920 | resolve(ret);
|
921 | }
|
922 | catch (err) {
|
923 | reject(err);
|
924 | }
|
925 | }));
|
926 | });
|
927 | }
|
928 | |
929 |
|
930 |
|
931 |
|
932 |
|
933 |
|
934 | getFields(project, expand) {
|
935 | return __awaiter(this, void 0, void 0, function* () {
|
936 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
937 | let routeValues = {
|
938 | project: project
|
939 | };
|
940 | let queryValues = {
|
941 | '$expand': expand,
|
942 | };
|
943 | try {
|
944 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues, queryValues);
|
945 | let url = verData.requestUrl;
|
946 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
947 | let res;
|
948 | res = yield this.rest.get(url, options);
|
949 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, true);
|
950 | resolve(ret);
|
951 | }
|
952 | catch (err) {
|
953 | reject(err);
|
954 | }
|
955 | }));
|
956 | });
|
957 | }
|
958 | |
959 |
|
960 |
|
961 |
|
962 |
|
963 |
|
964 |
|
965 | updateField(payload, fieldNameOrRefName, project) {
|
966 | return __awaiter(this, void 0, void 0, function* () {
|
967 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
968 | let routeValues = {
|
969 | project: project,
|
970 | fieldNameOrRefName: fieldNameOrRefName
|
971 | };
|
972 | try {
|
973 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94", routeValues);
|
974 | let url = verData.requestUrl;
|
975 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
976 | let res;
|
977 | res = yield this.rest.update(url, payload, options);
|
978 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemField, false);
|
979 | resolve(ret);
|
980 | }
|
981 | catch (err) {
|
982 | reject(err);
|
983 | }
|
984 | }));
|
985 | });
|
986 | }
|
987 | |
988 |
|
989 |
|
990 |
|
991 |
|
992 |
|
993 | migrateProjectsProcess(newProcess, project) {
|
994 | return __awaiter(this, void 0, void 0, function* () {
|
995 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
996 | let routeValues = {
|
997 | project: project
|
998 | };
|
999 | try {
|
1000 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "19801631-d4e5-47e9-8166-0330de0ff1e6", routeValues);
|
1001 | let url = verData.requestUrl;
|
1002 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1003 | let res;
|
1004 | res = yield this.rest.create(url, newProcess, options);
|
1005 | let ret = this.formatResponse(res.result, null, false);
|
1006 | resolve(ret);
|
1007 | }
|
1008 | catch (err) {
|
1009 | reject(err);
|
1010 | }
|
1011 | }));
|
1012 | });
|
1013 | }
|
1014 | |
1015 |
|
1016 |
|
1017 |
|
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 | createQuery(postedQuery, project, query, validateWiqlOnly) {
|
1023 | return __awaiter(this, void 0, void 0, function* () {
|
1024 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1025 | let routeValues = {
|
1026 | project: project,
|
1027 | query: query
|
1028 | };
|
1029 | let queryValues = {
|
1030 | validateWiqlOnly: validateWiqlOnly,
|
1031 | };
|
1032 | try {
|
1033 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues);
|
1034 | let url = verData.requestUrl;
|
1035 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1036 | let res;
|
1037 | res = yield this.rest.create(url, postedQuery, options);
|
1038 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false);
|
1039 | resolve(ret);
|
1040 | }
|
1041 | catch (err) {
|
1042 | reject(err);
|
1043 | }
|
1044 | }));
|
1045 | });
|
1046 | }
|
1047 | |
1048 |
|
1049 |
|
1050 |
|
1051 |
|
1052 |
|
1053 | deleteQuery(project, query) {
|
1054 | return __awaiter(this, void 0, void 0, function* () {
|
1055 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1056 | let routeValues = {
|
1057 | project: project,
|
1058 | query: query
|
1059 | };
|
1060 | try {
|
1061 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues);
|
1062 | let url = verData.requestUrl;
|
1063 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1064 | let res;
|
1065 | res = yield this.rest.del(url, options);
|
1066 | let ret = this.formatResponse(res.result, null, false);
|
1067 | resolve(ret);
|
1068 | }
|
1069 | catch (err) {
|
1070 | reject(err);
|
1071 | }
|
1072 | }));
|
1073 | });
|
1074 | }
|
1075 | |
1076 |
|
1077 |
|
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 | getQueries(project, expand, depth, includeDeleted) {
|
1084 | return __awaiter(this, void 0, void 0, function* () {
|
1085 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1086 | let routeValues = {
|
1087 | project: project
|
1088 | };
|
1089 | let queryValues = {
|
1090 | '$expand': expand,
|
1091 | '$depth': depth,
|
1092 | '$includeDeleted': includeDeleted,
|
1093 | };
|
1094 | try {
|
1095 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues);
|
1096 | let url = verData.requestUrl;
|
1097 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1098 | let res;
|
1099 | res = yield this.rest.get(url, options);
|
1100 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, true);
|
1101 | resolve(ret);
|
1102 | }
|
1103 | catch (err) {
|
1104 | reject(err);
|
1105 | }
|
1106 | }));
|
1107 | });
|
1108 | }
|
1109 | |
1110 |
|
1111 |
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 |
|
1118 |
|
1119 | getQuery(project, query, expand, depth, includeDeleted, useIsoDateFormat) {
|
1120 | return __awaiter(this, void 0, void 0, function* () {
|
1121 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1122 | let routeValues = {
|
1123 | project: project,
|
1124 | query: query
|
1125 | };
|
1126 | let queryValues = {
|
1127 | '$expand': expand,
|
1128 | '$depth': depth,
|
1129 | '$includeDeleted': includeDeleted,
|
1130 | '$useIsoDateFormat': useIsoDateFormat,
|
1131 | };
|
1132 | try {
|
1133 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues);
|
1134 | let url = verData.requestUrl;
|
1135 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1136 | let res;
|
1137 | res = yield this.rest.get(url, options);
|
1138 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false);
|
1139 | resolve(ret);
|
1140 | }
|
1141 | catch (err) {
|
1142 | reject(err);
|
1143 | }
|
1144 | }));
|
1145 | });
|
1146 | }
|
1147 | |
1148 |
|
1149 |
|
1150 |
|
1151 |
|
1152 |
|
1153 |
|
1154 |
|
1155 |
|
1156 | searchQueries(project, filter, top, expand, includeDeleted) {
|
1157 | return __awaiter(this, void 0, void 0, function* () {
|
1158 | if (filter == null) {
|
1159 | throw new TypeError('filter can not be null or undefined');
|
1160 | }
|
1161 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1162 | let routeValues = {
|
1163 | project: project
|
1164 | };
|
1165 | let queryValues = {
|
1166 | '$filter': filter,
|
1167 | '$top': top,
|
1168 | '$expand': expand,
|
1169 | '$includeDeleted': includeDeleted,
|
1170 | };
|
1171 | try {
|
1172 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues);
|
1173 | let url = verData.requestUrl;
|
1174 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1175 | let res;
|
1176 | res = yield this.rest.get(url, options);
|
1177 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItemsResult, false);
|
1178 | resolve(ret);
|
1179 | }
|
1180 | catch (err) {
|
1181 | reject(err);
|
1182 | }
|
1183 | }));
|
1184 | });
|
1185 | }
|
1186 | |
1187 |
|
1188 |
|
1189 |
|
1190 |
|
1191 |
|
1192 |
|
1193 |
|
1194 | updateQuery(queryUpdate, project, query, undeleteDescendants) {
|
1195 | return __awaiter(this, void 0, void 0, function* () {
|
1196 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1197 | let routeValues = {
|
1198 | project: project,
|
1199 | query: query
|
1200 | };
|
1201 | let queryValues = {
|
1202 | '$undeleteDescendants': undeleteDescendants,
|
1203 | };
|
1204 | try {
|
1205 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a67d190c-c41f-424b-814d-0e906f659301", routeValues, queryValues);
|
1206 | let url = verData.requestUrl;
|
1207 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1208 | let res;
|
1209 | res = yield this.rest.update(url, queryUpdate, options);
|
1210 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, false);
|
1211 | resolve(ret);
|
1212 | }
|
1213 | catch (err) {
|
1214 | reject(err);
|
1215 | }
|
1216 | }));
|
1217 | });
|
1218 | }
|
1219 | |
1220 |
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 | getQueriesBatch(queryGetRequest, project) {
|
1226 | return __awaiter(this, void 0, void 0, function* () {
|
1227 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1228 | let routeValues = {
|
1229 | project: project
|
1230 | };
|
1231 | try {
|
1232 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "549816f9-09b0-4e75-9e81-01fbfcd07426", routeValues);
|
1233 | let url = verData.requestUrl;
|
1234 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1235 | let res;
|
1236 | res = yield this.rest.create(url, queryGetRequest, options);
|
1237 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.QueryHierarchyItem, true);
|
1238 | resolve(ret);
|
1239 | }
|
1240 | catch (err) {
|
1241 | reject(err);
|
1242 | }
|
1243 | }));
|
1244 | });
|
1245 | }
|
1246 | |
1247 |
|
1248 |
|
1249 |
|
1250 |
|
1251 |
|
1252 | destroyWorkItem(id, project) {
|
1253 | return __awaiter(this, void 0, void 0, function* () {
|
1254 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1255 | let routeValues = {
|
1256 | project: project,
|
1257 | id: id
|
1258 | };
|
1259 | try {
|
1260 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues);
|
1261 | let url = verData.requestUrl;
|
1262 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1263 | let res;
|
1264 | res = yield this.rest.del(url, options);
|
1265 | let ret = this.formatResponse(res.result, null, false);
|
1266 | resolve(ret);
|
1267 | }
|
1268 | catch (err) {
|
1269 | reject(err);
|
1270 | }
|
1271 | }));
|
1272 | });
|
1273 | }
|
1274 | |
1275 |
|
1276 |
|
1277 |
|
1278 |
|
1279 |
|
1280 | getDeletedWorkItem(id, project) {
|
1281 | return __awaiter(this, void 0, void 0, function* () {
|
1282 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1283 | let routeValues = {
|
1284 | project: project,
|
1285 | id: id
|
1286 | };
|
1287 | try {
|
1288 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues);
|
1289 | let url = verData.requestUrl;
|
1290 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1291 | let res;
|
1292 | res = yield this.rest.get(url, options);
|
1293 | let ret = this.formatResponse(res.result, null, false);
|
1294 | resolve(ret);
|
1295 | }
|
1296 | catch (err) {
|
1297 | reject(err);
|
1298 | }
|
1299 | }));
|
1300 | });
|
1301 | }
|
1302 | |
1303 |
|
1304 |
|
1305 |
|
1306 |
|
1307 |
|
1308 | getDeletedWorkItems(ids, project) {
|
1309 | return __awaiter(this, void 0, void 0, function* () {
|
1310 | if (ids == null) {
|
1311 | throw new TypeError('ids can not be null or undefined');
|
1312 | }
|
1313 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1314 | let routeValues = {
|
1315 | project: project
|
1316 | };
|
1317 | let queryValues = {
|
1318 | ids: ids && ids.join(","),
|
1319 | };
|
1320 | try {
|
1321 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues, queryValues);
|
1322 | let url = verData.requestUrl;
|
1323 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1324 | let res;
|
1325 | res = yield this.rest.get(url, options);
|
1326 | let ret = this.formatResponse(res.result, null, true);
|
1327 | resolve(ret);
|
1328 | }
|
1329 | catch (err) {
|
1330 | reject(err);
|
1331 | }
|
1332 | }));
|
1333 | });
|
1334 | }
|
1335 | |
1336 |
|
1337 |
|
1338 |
|
1339 |
|
1340 | getDeletedWorkItemShallowReferences(project) {
|
1341 | return __awaiter(this, void 0, void 0, function* () {
|
1342 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1343 | let routeValues = {
|
1344 | project: project
|
1345 | };
|
1346 | try {
|
1347 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues);
|
1348 | let url = verData.requestUrl;
|
1349 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1350 | let res;
|
1351 | res = yield this.rest.get(url, options);
|
1352 | let ret = this.formatResponse(res.result, null, true);
|
1353 | resolve(ret);
|
1354 | }
|
1355 | catch (err) {
|
1356 | reject(err);
|
1357 | }
|
1358 | }));
|
1359 | });
|
1360 | }
|
1361 | |
1362 |
|
1363 |
|
1364 |
|
1365 |
|
1366 |
|
1367 |
|
1368 | restoreWorkItem(payload, id, project) {
|
1369 | return __awaiter(this, void 0, void 0, function* () {
|
1370 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1371 | let routeValues = {
|
1372 | project: project,
|
1373 | id: id
|
1374 | };
|
1375 | try {
|
1376 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "b70d8d39-926c-465e-b927-b1bf0e5ca0e0", routeValues);
|
1377 | let url = verData.requestUrl;
|
1378 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1379 | let res;
|
1380 | res = yield this.rest.update(url, payload, options);
|
1381 | let ret = this.formatResponse(res.result, null, false);
|
1382 | resolve(ret);
|
1383 | }
|
1384 | catch (err) {
|
1385 | reject(err);
|
1386 | }
|
1387 | }));
|
1388 | });
|
1389 | }
|
1390 | |
1391 |
|
1392 |
|
1393 |
|
1394 |
|
1395 |
|
1396 |
|
1397 |
|
1398 | getRevision(id, revisionNumber, expand, project) {
|
1399 | return __awaiter(this, void 0, void 0, function* () {
|
1400 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1401 | let routeValues = {
|
1402 | project: project,
|
1403 | id: id,
|
1404 | revisionNumber: revisionNumber
|
1405 | };
|
1406 | let queryValues = {
|
1407 | '$expand': expand,
|
1408 | };
|
1409 | try {
|
1410 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "a00c85a5-80fa-4565-99c3-bcd2181434bb", routeValues, queryValues);
|
1411 | let url = verData.requestUrl;
|
1412 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1413 | let res;
|
1414 | res = yield this.rest.get(url, options);
|
1415 | let ret = this.formatResponse(res.result, null, false);
|
1416 | resolve(ret);
|
1417 | }
|
1418 | catch (err) {
|
1419 | reject(err);
|
1420 | }
|
1421 | }));
|
1422 | });
|
1423 | }
|
1424 | |
1425 |
|
1426 |
|
1427 |
|
1428 |
|
1429 |
|
1430 |
|
1431 |
|
1432 |
|
1433 | getRevisions(id, top, skip, expand, project) {
|
1434 | return __awaiter(this, void 0, void 0, function* () {
|
1435 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1436 | let routeValues = {
|
1437 | project: project,
|
1438 | id: id
|
1439 | };
|
1440 | let queryValues = {
|
1441 | '$top': top,
|
1442 | '$skip': skip,
|
1443 | '$expand': expand,
|
1444 | };
|
1445 | try {
|
1446 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "a00c85a5-80fa-4565-99c3-bcd2181434bb", routeValues, queryValues);
|
1447 | let url = verData.requestUrl;
|
1448 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1449 | let res;
|
1450 | res = yield this.rest.get(url, options);
|
1451 | let ret = this.formatResponse(res.result, null, true);
|
1452 | resolve(ret);
|
1453 | }
|
1454 | catch (err) {
|
1455 | reject(err);
|
1456 | }
|
1457 | }));
|
1458 | });
|
1459 | }
|
1460 | |
1461 |
|
1462 |
|
1463 |
|
1464 |
|
1465 |
|
1466 | sendMail(body, project) {
|
1467 | return __awaiter(this, void 0, void 0, function* () {
|
1468 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1469 | let routeValues = {
|
1470 | project: project
|
1471 | };
|
1472 | try {
|
1473 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "12438500-2f84-4fa7-9f1a-c31871b4959d", routeValues);
|
1474 | let url = verData.requestUrl;
|
1475 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1476 | let res;
|
1477 | res = yield this.rest.create(url, body, options);
|
1478 | let ret = this.formatResponse(res.result, null, false);
|
1479 | resolve(ret);
|
1480 | }
|
1481 | catch (err) {
|
1482 | reject(err);
|
1483 | }
|
1484 | }));
|
1485 | });
|
1486 | }
|
1487 | |
1488 |
|
1489 |
|
1490 |
|
1491 | deleteTag(project, tagIdOrName) {
|
1492 | return __awaiter(this, void 0, void 0, function* () {
|
1493 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1494 | let routeValues = {
|
1495 | project: project,
|
1496 | tagIdOrName: tagIdOrName
|
1497 | };
|
1498 | try {
|
1499 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues);
|
1500 | let url = verData.requestUrl;
|
1501 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1502 | let res;
|
1503 | res = yield this.rest.del(url, options);
|
1504 | let ret = this.formatResponse(res.result, null, false);
|
1505 | resolve(ret);
|
1506 | }
|
1507 | catch (err) {
|
1508 | reject(err);
|
1509 | }
|
1510 | }));
|
1511 | });
|
1512 | }
|
1513 | |
1514 |
|
1515 |
|
1516 |
|
1517 | getTag(project, tagIdOrName) {
|
1518 | return __awaiter(this, void 0, void 0, function* () {
|
1519 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1520 | let routeValues = {
|
1521 | project: project,
|
1522 | tagIdOrName: tagIdOrName
|
1523 | };
|
1524 | try {
|
1525 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues);
|
1526 | let url = verData.requestUrl;
|
1527 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1528 | let res;
|
1529 | res = yield this.rest.get(url, options);
|
1530 | let ret = this.formatResponse(res.result, null, false);
|
1531 | resolve(ret);
|
1532 | }
|
1533 | catch (err) {
|
1534 | reject(err);
|
1535 | }
|
1536 | }));
|
1537 | });
|
1538 | }
|
1539 | |
1540 |
|
1541 |
|
1542 | getTags(project) {
|
1543 | return __awaiter(this, void 0, void 0, function* () {
|
1544 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1545 | let routeValues = {
|
1546 | project: project
|
1547 | };
|
1548 | try {
|
1549 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues);
|
1550 | let url = verData.requestUrl;
|
1551 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1552 | let res;
|
1553 | res = yield this.rest.get(url, options);
|
1554 | let ret = this.formatResponse(res.result, null, true);
|
1555 | resolve(ret);
|
1556 | }
|
1557 | catch (err) {
|
1558 | reject(err);
|
1559 | }
|
1560 | }));
|
1561 | });
|
1562 | }
|
1563 | |
1564 |
|
1565 |
|
1566 |
|
1567 |
|
1568 | updateTag(tagData, project, tagIdOrName) {
|
1569 | return __awaiter(this, void 0, void 0, function* () {
|
1570 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1571 | let routeValues = {
|
1572 | project: project,
|
1573 | tagIdOrName: tagIdOrName
|
1574 | };
|
1575 | try {
|
1576 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "bc15bc60-e7a8-43cb-ab01-2106be3983a1", routeValues);
|
1577 | let url = verData.requestUrl;
|
1578 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1579 | let res;
|
1580 | res = yield this.rest.update(url, tagData, options);
|
1581 | let ret = this.formatResponse(res.result, null, false);
|
1582 | resolve(ret);
|
1583 | }
|
1584 | catch (err) {
|
1585 | reject(err);
|
1586 | }
|
1587 | }));
|
1588 | });
|
1589 | }
|
1590 | |
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 |
|
1596 | createTemplate(template, teamContext) {
|
1597 | return __awaiter(this, void 0, void 0, function* () {
|
1598 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1599 | let project = null;
|
1600 | let team = null;
|
1601 | if (teamContext) {
|
1602 | project = teamContext.projectId || teamContext.project;
|
1603 | team = teamContext.teamId || teamContext.team;
|
1604 | }
|
1605 | let routeValues = {
|
1606 | project: project,
|
1607 | team: team
|
1608 | };
|
1609 | try {
|
1610 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "6a90345f-a676-4969-afce-8e163e1d5642", routeValues);
|
1611 | let url = verData.requestUrl;
|
1612 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1613 | let res;
|
1614 | res = yield this.rest.create(url, template, options);
|
1615 | let ret = this.formatResponse(res.result, null, false);
|
1616 | resolve(ret);
|
1617 | }
|
1618 | catch (err) {
|
1619 | reject(err);
|
1620 | }
|
1621 | }));
|
1622 | });
|
1623 | }
|
1624 | |
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 | getTemplates(teamContext, workitemtypename) {
|
1631 | return __awaiter(this, void 0, void 0, function* () {
|
1632 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1633 | let project = null;
|
1634 | let team = null;
|
1635 | if (teamContext) {
|
1636 | project = teamContext.projectId || teamContext.project;
|
1637 | team = teamContext.teamId || teamContext.team;
|
1638 | }
|
1639 | let routeValues = {
|
1640 | project: project,
|
1641 | team: team
|
1642 | };
|
1643 | let queryValues = {
|
1644 | workitemtypename: workitemtypename,
|
1645 | };
|
1646 | try {
|
1647 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "6a90345f-a676-4969-afce-8e163e1d5642", routeValues, queryValues);
|
1648 | let url = verData.requestUrl;
|
1649 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1650 | let res;
|
1651 | res = yield this.rest.get(url, options);
|
1652 | let ret = this.formatResponse(res.result, null, true);
|
1653 | resolve(ret);
|
1654 | }
|
1655 | catch (err) {
|
1656 | reject(err);
|
1657 | }
|
1658 | }));
|
1659 | });
|
1660 | }
|
1661 | |
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 | deleteTemplate(teamContext, templateId) {
|
1668 | return __awaiter(this, void 0, void 0, function* () {
|
1669 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1670 | let project = null;
|
1671 | let team = null;
|
1672 | if (teamContext) {
|
1673 | project = teamContext.projectId || teamContext.project;
|
1674 | team = teamContext.teamId || teamContext.team;
|
1675 | }
|
1676 | let routeValues = {
|
1677 | project: project,
|
1678 | team: team,
|
1679 | templateId: templateId
|
1680 | };
|
1681 | try {
|
1682 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues);
|
1683 | let url = verData.requestUrl;
|
1684 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1685 | let res;
|
1686 | res = yield this.rest.del(url, options);
|
1687 | let ret = this.formatResponse(res.result, null, false);
|
1688 | resolve(ret);
|
1689 | }
|
1690 | catch (err) {
|
1691 | reject(err);
|
1692 | }
|
1693 | }));
|
1694 | });
|
1695 | }
|
1696 | |
1697 |
|
1698 |
|
1699 |
|
1700 |
|
1701 |
|
1702 | getTemplate(teamContext, templateId) {
|
1703 | return __awaiter(this, void 0, void 0, function* () {
|
1704 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1705 | let project = null;
|
1706 | let team = null;
|
1707 | if (teamContext) {
|
1708 | project = teamContext.projectId || teamContext.project;
|
1709 | team = teamContext.teamId || teamContext.team;
|
1710 | }
|
1711 | let routeValues = {
|
1712 | project: project,
|
1713 | team: team,
|
1714 | templateId: templateId
|
1715 | };
|
1716 | try {
|
1717 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues);
|
1718 | let url = verData.requestUrl;
|
1719 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1720 | let res;
|
1721 | res = yield this.rest.get(url, options);
|
1722 | let ret = this.formatResponse(res.result, null, false);
|
1723 | resolve(ret);
|
1724 | }
|
1725 | catch (err) {
|
1726 | reject(err);
|
1727 | }
|
1728 | }));
|
1729 | });
|
1730 | }
|
1731 | |
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 | replaceTemplate(templateContent, teamContext, templateId) {
|
1739 | return __awaiter(this, void 0, void 0, function* () {
|
1740 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1741 | let project = null;
|
1742 | let team = null;
|
1743 | if (teamContext) {
|
1744 | project = teamContext.projectId || teamContext.project;
|
1745 | team = teamContext.teamId || teamContext.team;
|
1746 | }
|
1747 | let routeValues = {
|
1748 | project: project,
|
1749 | team: team,
|
1750 | templateId: templateId
|
1751 | };
|
1752 | try {
|
1753 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "fb10264a-8836-48a0-8033-1b0ccd2748d5", routeValues);
|
1754 | let url = verData.requestUrl;
|
1755 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1756 | let res;
|
1757 | res = yield this.rest.replace(url, templateContent, options);
|
1758 | let ret = this.formatResponse(res.result, null, false);
|
1759 | resolve(ret);
|
1760 | }
|
1761 | catch (err) {
|
1762 | reject(err);
|
1763 | }
|
1764 | }));
|
1765 | });
|
1766 | }
|
1767 | |
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 | getUpdate(id, updateNumber, project) {
|
1775 | return __awaiter(this, void 0, void 0, function* () {
|
1776 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1777 | let routeValues = {
|
1778 | project: project,
|
1779 | id: id,
|
1780 | updateNumber: updateNumber
|
1781 | };
|
1782 | try {
|
1783 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "6570bf97-d02c-4a91-8d93-3abe9895b1a9", routeValues);
|
1784 | let url = verData.requestUrl;
|
1785 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1786 | let res;
|
1787 | res = yield this.rest.get(url, options);
|
1788 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemUpdate, false);
|
1789 | resolve(ret);
|
1790 | }
|
1791 | catch (err) {
|
1792 | reject(err);
|
1793 | }
|
1794 | }));
|
1795 | });
|
1796 | }
|
1797 | |
1798 |
|
1799 |
|
1800 |
|
1801 |
|
1802 |
|
1803 |
|
1804 |
|
1805 | getUpdates(id, top, skip, project) {
|
1806 | return __awaiter(this, void 0, void 0, function* () {
|
1807 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1808 | let routeValues = {
|
1809 | project: project,
|
1810 | id: id
|
1811 | };
|
1812 | let queryValues = {
|
1813 | '$top': top,
|
1814 | '$skip': skip,
|
1815 | };
|
1816 | try {
|
1817 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "6570bf97-d02c-4a91-8d93-3abe9895b1a9", routeValues, queryValues);
|
1818 | let url = verData.requestUrl;
|
1819 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1820 | let res;
|
1821 | res = yield this.rest.get(url, options);
|
1822 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemUpdate, true);
|
1823 | resolve(ret);
|
1824 | }
|
1825 | catch (err) {
|
1826 | reject(err);
|
1827 | }
|
1828 | }));
|
1829 | });
|
1830 | }
|
1831 | |
1832 |
|
1833 |
|
1834 |
|
1835 |
|
1836 |
|
1837 |
|
1838 |
|
1839 | queryByWiql(wiql, teamContext, timePrecision, top) {
|
1840 | return __awaiter(this, void 0, void 0, function* () {
|
1841 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1842 | let project = null;
|
1843 | let team = null;
|
1844 | if (teamContext) {
|
1845 | project = teamContext.projectId || teamContext.project;
|
1846 | team = teamContext.teamId || teamContext.team;
|
1847 | }
|
1848 | let routeValues = {
|
1849 | project: project,
|
1850 | team: team
|
1851 | };
|
1852 | let queryValues = {
|
1853 | timePrecision: timePrecision,
|
1854 | '$top': top,
|
1855 | };
|
1856 | try {
|
1857 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "1a9c53f7-f243-4447-b110-35ef023636e4", routeValues, queryValues);
|
1858 | let url = verData.requestUrl;
|
1859 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1860 | let res;
|
1861 | res = yield this.rest.create(url, wiql, options);
|
1862 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemQueryResult, false);
|
1863 | resolve(ret);
|
1864 | }
|
1865 | catch (err) {
|
1866 | reject(err);
|
1867 | }
|
1868 | }));
|
1869 | });
|
1870 | }
|
1871 | |
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 | queryById(id, teamContext, timePrecision, top) {
|
1880 | return __awaiter(this, void 0, void 0, function* () {
|
1881 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1882 | let project = null;
|
1883 | let team = null;
|
1884 | if (teamContext) {
|
1885 | project = teamContext.projectId || teamContext.project;
|
1886 | team = teamContext.teamId || teamContext.team;
|
1887 | }
|
1888 | let routeValues = {
|
1889 | project: project,
|
1890 | team: team,
|
1891 | id: id
|
1892 | };
|
1893 | let queryValues = {
|
1894 | timePrecision: timePrecision,
|
1895 | '$top': top,
|
1896 | };
|
1897 | try {
|
1898 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "a02355f5-5f8a-4671-8e32-369d23aac83d", routeValues, queryValues);
|
1899 | let url = verData.requestUrl;
|
1900 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1901 | let res;
|
1902 | res = yield this.rest.get(url, options);
|
1903 | let ret = this.formatResponse(res.result, WorkItemTrackingInterfaces.TypeInfo.WorkItemQueryResult, false);
|
1904 | resolve(ret);
|
1905 | }
|
1906 | catch (err) {
|
1907 | reject(err);
|
1908 | }
|
1909 | }));
|
1910 | });
|
1911 | }
|
1912 | |
1913 |
|
1914 |
|
1915 |
|
1916 |
|
1917 |
|
1918 |
|
1919 | getWorkItemIconJson(icon, color, v) {
|
1920 | return __awaiter(this, void 0, void 0, function* () {
|
1921 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1922 | let routeValues = {
|
1923 | icon: icon
|
1924 | };
|
1925 | let queryValues = {
|
1926 | color: color,
|
1927 | v: v,
|
1928 | };
|
1929 | try {
|
1930 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues);
|
1931 | let url = verData.requestUrl;
|
1932 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1933 | let res;
|
1934 | res = yield this.rest.get(url, options);
|
1935 | let ret = this.formatResponse(res.result, null, false);
|
1936 | resolve(ret);
|
1937 | }
|
1938 | catch (err) {
|
1939 | reject(err);
|
1940 | }
|
1941 | }));
|
1942 | });
|
1943 | }
|
1944 | |
1945 |
|
1946 |
|
1947 |
|
1948 | getWorkItemIcons() {
|
1949 | return __awaiter(this, void 0, void 0, function* () {
|
1950 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1951 | let routeValues = {};
|
1952 | try {
|
1953 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues);
|
1954 | let url = verData.requestUrl;
|
1955 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1956 | let res;
|
1957 | res = yield this.rest.get(url, options);
|
1958 | let ret = this.formatResponse(res.result, null, true);
|
1959 | resolve(ret);
|
1960 | }
|
1961 | catch (err) {
|
1962 | reject(err);
|
1963 | }
|
1964 | }));
|
1965 | });
|
1966 | }
|
1967 | |
1968 |
|
1969 |
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 | getWorkItemIconSvg(icon, color, v) {
|
1975 | return __awaiter(this, void 0, void 0, function* () {
|
1976 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1977 | let routeValues = {
|
1978 | icon: icon
|
1979 | };
|
1980 | let queryValues = {
|
1981 | color: color,
|
1982 | v: v,
|
1983 | };
|
1984 | try {
|
1985 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues);
|
1986 | let url = verData.requestUrl;
|
1987 | let apiVersion = verData.apiVersion;
|
1988 | let accept = this.createAcceptHeader("image/svg+xml", apiVersion);
|
1989 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
1990 | }
|
1991 | catch (err) {
|
1992 | reject(err);
|
1993 | }
|
1994 | }));
|
1995 | });
|
1996 | }
|
1997 | |
1998 |
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 | getWorkItemIconXaml(icon, color, v) {
|
2005 | return __awaiter(this, void 0, void 0, function* () {
|
2006 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2007 | let routeValues = {
|
2008 | icon: icon
|
2009 | };
|
2010 | let queryValues = {
|
2011 | color: color,
|
2012 | v: v,
|
2013 | };
|
2014 | try {
|
2015 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4e1eb4a5-1970-4228-a682-ec48eb2dca30", routeValues, queryValues);
|
2016 | let url = verData.requestUrl;
|
2017 | let apiVersion = verData.apiVersion;
|
2018 | let accept = this.createAcceptHeader("image/xaml+xml", apiVersion);
|
2019 | resolve((yield this.http.get(url, { "Accept": accept })).message);
|
2020 | }
|
2021 | catch (err) {
|
2022 | reject(err);
|
2023 | }
|
2024 | }));
|
2025 | });
|
2026 | }
|
2027 | |
2028 |
|
2029 |
|
2030 |
|
2031 |
|
2032 |
|
2033 |
|
2034 |
|
2035 |
|
2036 | getReportingLinksByLinkType(project, linkTypes, types, continuationToken, startDateTime) {
|
2037 | return __awaiter(this, void 0, void 0, function* () {
|
2038 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2039 | let routeValues = {
|
2040 | project: project
|
2041 | };
|
2042 | let queryValues = {
|
2043 | linkTypes: linkTypes && linkTypes.join(","),
|
2044 | types: types && types.join(","),
|
2045 | continuationToken: continuationToken,
|
2046 | startDateTime: startDateTime,
|
2047 | };
|
2048 | try {
|
2049 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "b5b5b6d0-0308-40a1-b3f4-b9bb3c66878f", routeValues, queryValues);
|
2050 | let url = verData.requestUrl;
|
2051 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2052 | let res;
|
2053 | res = yield this.rest.get(url, options);
|
2054 | let ret = this.formatResponse(res.result, null, false);
|
2055 | resolve(ret);
|
2056 | }
|
2057 | catch (err) {
|
2058 | reject(err);
|
2059 | }
|
2060 | }));
|
2061 | });
|
2062 | }
|
2063 | |
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 | getRelationType(relation) {
|
2069 | return __awaiter(this, void 0, void 0, function* () {
|
2070 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2071 | let routeValues = {
|
2072 | relation: relation
|
2073 | };
|
2074 | try {
|
2075 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165", routeValues);
|
2076 | let url = verData.requestUrl;
|
2077 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2078 | let res;
|
2079 | res = yield this.rest.get(url, options);
|
2080 | let ret = this.formatResponse(res.result, null, false);
|
2081 | resolve(ret);
|
2082 | }
|
2083 | catch (err) {
|
2084 | reject(err);
|
2085 | }
|
2086 | }));
|
2087 | });
|
2088 | }
|
2089 | |
2090 |
|
2091 |
|
2092 |
|
2093 | getRelationTypes() {
|
2094 | return __awaiter(this, void 0, void 0, function* () {
|
2095 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2096 | let routeValues = {};
|
2097 | try {
|
2098 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165", routeValues);
|
2099 | let url = verData.requestUrl;
|
2100 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2101 | let res;
|
2102 | res = yield this.rest.get(url, options);
|
2103 | let ret = this.formatResponse(res.result, null, true);
|
2104 | resolve(ret);
|
2105 | }
|
2106 | catch (err) {
|
2107 | reject(err);
|
2108 | }
|
2109 | }));
|
2110 | });
|
2111 | }
|
2112 | |
2113 |
|
2114 |
|
2115 |
|
2116 |
|
2117 |
|
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 |
|
2128 | readReportingRevisionsGet(project, fields, types, continuationToken, startDateTime, includeIdentityRef, includeDeleted, includeTagRef, includeLatestOnly, expand, includeDiscussionChangesOnly, maxPageSize) {
|
2129 | return __awaiter(this, void 0, void 0, function* () {
|
2130 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2131 | let routeValues = {
|
2132 | project: project
|
2133 | };
|
2134 | let queryValues = {
|
2135 | fields: fields && fields.join(","),
|
2136 | types: types && types.join(","),
|
2137 | continuationToken: continuationToken,
|
2138 | startDateTime: startDateTime,
|
2139 | includeIdentityRef: includeIdentityRef,
|
2140 | includeDeleted: includeDeleted,
|
2141 | includeTagRef: includeTagRef,
|
2142 | includeLatestOnly: includeLatestOnly,
|
2143 | '$expand': expand,
|
2144 | includeDiscussionChangesOnly: includeDiscussionChangesOnly,
|
2145 | '$maxPageSize': maxPageSize,
|
2146 | };
|
2147 | try {
|
2148 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f828fe59-dd87-495d-a17c-7a8d6211ca6c", routeValues, queryValues);
|
2149 | let url = verData.requestUrl;
|
2150 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2151 | let res;
|
2152 | res = yield this.rest.get(url, options);
|
2153 | let ret = this.formatResponse(res.result, null, false);
|
2154 | resolve(ret);
|
2155 | }
|
2156 | catch (err) {
|
2157 | reject(err);
|
2158 | }
|
2159 | }));
|
2160 | });
|
2161 | }
|
2162 | |
2163 |
|
2164 |
|
2165 |
|
2166 |
|
2167 |
|
2168 |
|
2169 |
|
2170 |
|
2171 | readReportingRevisionsPost(filter, project, continuationToken, startDateTime, expand) {
|
2172 | return __awaiter(this, void 0, void 0, function* () {
|
2173 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2174 | let routeValues = {
|
2175 | project: project
|
2176 | };
|
2177 | let queryValues = {
|
2178 | continuationToken: continuationToken,
|
2179 | startDateTime: startDateTime,
|
2180 | '$expand': expand,
|
2181 | };
|
2182 | try {
|
2183 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "f828fe59-dd87-495d-a17c-7a8d6211ca6c", routeValues, queryValues);
|
2184 | let url = verData.requestUrl;
|
2185 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2186 | let res;
|
2187 | res = yield this.rest.create(url, filter, options);
|
2188 | let ret = this.formatResponse(res.result, null, false);
|
2189 | resolve(ret);
|
2190 | }
|
2191 | catch (err) {
|
2192 | reject(err);
|
2193 | }
|
2194 | }));
|
2195 | });
|
2196 | }
|
2197 | |
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 | readReportingDiscussions(project, continuationToken, maxPageSize) {
|
2203 | return __awaiter(this, void 0, void 0, function* () {
|
2204 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2205 | let routeValues = {
|
2206 | project: project
|
2207 | };
|
2208 | let queryValues = {
|
2209 | continuationToken: continuationToken,
|
2210 | '$maxPageSize': maxPageSize,
|
2211 | };
|
2212 | try {
|
2213 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "4a644469-90c5-4fcc-9a9f-be0827d369ec", routeValues, queryValues);
|
2214 | let url = verData.requestUrl;
|
2215 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2216 | let res;
|
2217 | res = yield this.rest.get(url, options);
|
2218 | let ret = this.formatResponse(res.result, null, false);
|
2219 | resolve(ret);
|
2220 | }
|
2221 | catch (err) {
|
2222 | reject(err);
|
2223 | }
|
2224 | }));
|
2225 | });
|
2226 | }
|
2227 | |
2228 |
|
2229 |
|
2230 |
|
2231 |
|
2232 |
|
2233 |
|
2234 |
|
2235 |
|
2236 |
|
2237 |
|
2238 | createWorkItem(customHeaders, document, project, type, validateOnly, bypassRules, suppressNotifications, expand) {
|
2239 | return __awaiter(this, void 0, void 0, function* () {
|
2240 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2241 | let routeValues = {
|
2242 | project: project,
|
2243 | type: type
|
2244 | };
|
2245 | let queryValues = {
|
2246 | validateOnly: validateOnly,
|
2247 | bypassRules: bypassRules,
|
2248 | suppressNotifications: suppressNotifications,
|
2249 | '$expand': expand,
|
2250 | };
|
2251 | customHeaders = customHeaders || {};
|
2252 | customHeaders["Content-Type"] = "application/json-patch+json";
|
2253 | try {
|
2254 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "62d3d110-0047-428c-ad3c-4fe872c91c74", routeValues, queryValues);
|
2255 | let url = verData.requestUrl;
|
2256 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2257 | options.additionalHeaders = customHeaders;
|
2258 | let res;
|
2259 | res = yield this.rest.create(url, document, options);
|
2260 | let ret = this.formatResponse(res.result, null, false);
|
2261 | resolve(ret);
|
2262 | }
|
2263 | catch (err) {
|
2264 | reject(err);
|
2265 | }
|
2266 | }));
|
2267 | });
|
2268 | }
|
2269 | |
2270 |
|
2271 |
|
2272 |
|
2273 |
|
2274 |
|
2275 |
|
2276 |
|
2277 |
|
2278 | getWorkItemTemplate(project, type, fields, asOf, expand) {
|
2279 | return __awaiter(this, void 0, void 0, function* () {
|
2280 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2281 | let routeValues = {
|
2282 | project: project,
|
2283 | type: type
|
2284 | };
|
2285 | let queryValues = {
|
2286 | fields: fields,
|
2287 | asOf: asOf,
|
2288 | '$expand': expand,
|
2289 | };
|
2290 | try {
|
2291 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "62d3d110-0047-428c-ad3c-4fe872c91c74", routeValues, queryValues);
|
2292 | let url = verData.requestUrl;
|
2293 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2294 | let res;
|
2295 | res = yield this.rest.get(url, options);
|
2296 | let ret = this.formatResponse(res.result, null, false);
|
2297 | resolve(ret);
|
2298 | }
|
2299 | catch (err) {
|
2300 | reject(err);
|
2301 | }
|
2302 | }));
|
2303 | });
|
2304 | }
|
2305 | |
2306 |
|
2307 |
|
2308 |
|
2309 |
|
2310 |
|
2311 |
|
2312 | deleteWorkItem(id, project, destroy) {
|
2313 | return __awaiter(this, void 0, void 0, function* () {
|
2314 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2315 | let routeValues = {
|
2316 | project: project,
|
2317 | id: id
|
2318 | };
|
2319 | let queryValues = {
|
2320 | destroy: destroy,
|
2321 | };
|
2322 | try {
|
2323 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues);
|
2324 | let url = verData.requestUrl;
|
2325 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2326 | let res;
|
2327 | res = yield this.rest.del(url, options);
|
2328 | let ret = this.formatResponse(res.result, null, false);
|
2329 | resolve(ret);
|
2330 | }
|
2331 | catch (err) {
|
2332 | reject(err);
|
2333 | }
|
2334 | }));
|
2335 | });
|
2336 | }
|
2337 | |
2338 |
|
2339 |
|
2340 |
|
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 | getWorkItem(id, fields, asOf, expand, project) {
|
2347 | return __awaiter(this, void 0, void 0, function* () {
|
2348 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2349 | let routeValues = {
|
2350 | project: project,
|
2351 | id: id
|
2352 | };
|
2353 | let queryValues = {
|
2354 | fields: fields && fields.join(","),
|
2355 | asOf: asOf,
|
2356 | '$expand': expand,
|
2357 | };
|
2358 | try {
|
2359 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues);
|
2360 | let url = verData.requestUrl;
|
2361 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2362 | let res;
|
2363 | res = yield this.rest.get(url, options);
|
2364 | let ret = this.formatResponse(res.result, null, false);
|
2365 | resolve(ret);
|
2366 | }
|
2367 | catch (err) {
|
2368 | reject(err);
|
2369 | }
|
2370 | }));
|
2371 | });
|
2372 | }
|
2373 | |
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 |
|
2380 |
|
2381 |
|
2382 |
|
2383 | getWorkItems(ids, fields, asOf, expand, errorPolicy, project) {
|
2384 | return __awaiter(this, void 0, void 0, function* () {
|
2385 | if (ids == null) {
|
2386 | throw new TypeError('ids can not be null or undefined');
|
2387 | }
|
2388 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2389 | let routeValues = {
|
2390 | project: project
|
2391 | };
|
2392 | let queryValues = {
|
2393 | ids: ids && ids.join(","),
|
2394 | fields: fields && fields.join(","),
|
2395 | asOf: asOf,
|
2396 | '$expand': expand,
|
2397 | errorPolicy: errorPolicy,
|
2398 | };
|
2399 | try {
|
2400 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues);
|
2401 | let url = verData.requestUrl;
|
2402 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2403 | let res;
|
2404 | res = yield this.rest.get(url, options);
|
2405 | let ret = this.formatResponse(res.result, null, true);
|
2406 | resolve(ret);
|
2407 | }
|
2408 | catch (err) {
|
2409 | reject(err);
|
2410 | }
|
2411 | }));
|
2412 | });
|
2413 | }
|
2414 | |
2415 |
|
2416 |
|
2417 |
|
2418 |
|
2419 |
|
2420 |
|
2421 |
|
2422 |
|
2423 |
|
2424 |
|
2425 | updateWorkItem(customHeaders, document, id, project, validateOnly, bypassRules, suppressNotifications, expand) {
|
2426 | return __awaiter(this, void 0, void 0, function* () {
|
2427 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2428 | let routeValues = {
|
2429 | project: project,
|
2430 | id: id
|
2431 | };
|
2432 | let queryValues = {
|
2433 | validateOnly: validateOnly,
|
2434 | bypassRules: bypassRules,
|
2435 | suppressNotifications: suppressNotifications,
|
2436 | '$expand': expand,
|
2437 | };
|
2438 | customHeaders = customHeaders || {};
|
2439 | customHeaders["Content-Type"] = "application/json-patch+json";
|
2440 | try {
|
2441 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "72c7ddf8-2cdc-4f60-90cd-ab71c14a399b", routeValues, queryValues);
|
2442 | let url = verData.requestUrl;
|
2443 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2444 | options.additionalHeaders = customHeaders;
|
2445 | let res;
|
2446 | res = yield this.rest.update(url, document, options);
|
2447 | let ret = this.formatResponse(res.result, null, false);
|
2448 | resolve(ret);
|
2449 | }
|
2450 | catch (err) {
|
2451 | reject(err);
|
2452 | }
|
2453 | }));
|
2454 | });
|
2455 | }
|
2456 | |
2457 |
|
2458 |
|
2459 |
|
2460 |
|
2461 |
|
2462 | getWorkItemsBatch(workItemGetRequest, project) {
|
2463 | return __awaiter(this, void 0, void 0, function* () {
|
2464 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2465 | let routeValues = {
|
2466 | project: project
|
2467 | };
|
2468 | try {
|
2469 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "908509b6-4248-4475-a1cd-829139ba419f", routeValues);
|
2470 | let url = verData.requestUrl;
|
2471 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2472 | let res;
|
2473 | res = yield this.rest.create(url, workItemGetRequest, options);
|
2474 | let ret = this.formatResponse(res.result, null, true);
|
2475 | resolve(ret);
|
2476 | }
|
2477 | catch (err) {
|
2478 | reject(err);
|
2479 | }
|
2480 | }));
|
2481 | });
|
2482 | }
|
2483 | |
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 | getWorkItemStateColors(projectNames) {
|
2489 | return __awaiter(this, void 0, void 0, function* () {
|
2490 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2491 | let routeValues = {};
|
2492 | try {
|
2493 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "0b83df8a-3496-4ddb-ba44-63634f4cda61", routeValues);
|
2494 | let url = verData.requestUrl;
|
2495 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2496 | let res;
|
2497 | res = yield this.rest.create(url, projectNames, options);
|
2498 | let ret = this.formatResponse(res.result, null, true);
|
2499 | resolve(ret);
|
2500 | }
|
2501 | catch (err) {
|
2502 | reject(err);
|
2503 | }
|
2504 | }));
|
2505 | });
|
2506 | }
|
2507 | |
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 | getWorkItemNextStatesOnCheckinAction(ids, action) {
|
2514 | return __awaiter(this, void 0, void 0, function* () {
|
2515 | if (ids == null) {
|
2516 | throw new TypeError('ids can not be null or undefined');
|
2517 | }
|
2518 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2519 | let routeValues = {};
|
2520 | let queryValues = {
|
2521 | ids: ids && ids.join(","),
|
2522 | action: action,
|
2523 | };
|
2524 | try {
|
2525 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "afae844b-e2f6-44c2-8053-17b3bb936a40", routeValues, queryValues);
|
2526 | let url = verData.requestUrl;
|
2527 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2528 | let res;
|
2529 | res = yield this.rest.get(url, options);
|
2530 | let ret = this.formatResponse(res.result, null, true);
|
2531 | resolve(ret);
|
2532 | }
|
2533 | catch (err) {
|
2534 | reject(err);
|
2535 | }
|
2536 | }));
|
2537 | });
|
2538 | }
|
2539 | |
2540 |
|
2541 |
|
2542 |
|
2543 |
|
2544 | getWorkItemTypeCategories(project) {
|
2545 | return __awaiter(this, void 0, void 0, function* () {
|
2546 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2547 | let routeValues = {
|
2548 | project: project
|
2549 | };
|
2550 | try {
|
2551 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "9b9f5734-36c8-415e-ba67-f83b45c31408", routeValues);
|
2552 | let url = verData.requestUrl;
|
2553 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2554 | let res;
|
2555 | res = yield this.rest.get(url, options);
|
2556 | let ret = this.formatResponse(res.result, null, true);
|
2557 | resolve(ret);
|
2558 | }
|
2559 | catch (err) {
|
2560 | reject(err);
|
2561 | }
|
2562 | }));
|
2563 | });
|
2564 | }
|
2565 | |
2566 |
|
2567 |
|
2568 |
|
2569 |
|
2570 |
|
2571 | getWorkItemTypeCategory(project, category) {
|
2572 | return __awaiter(this, void 0, void 0, function* () {
|
2573 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2574 | let routeValues = {
|
2575 | project: project,
|
2576 | category: category
|
2577 | };
|
2578 | try {
|
2579 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "9b9f5734-36c8-415e-ba67-f83b45c31408", routeValues);
|
2580 | let url = verData.requestUrl;
|
2581 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2582 | let res;
|
2583 | res = yield this.rest.get(url, options);
|
2584 | let ret = this.formatResponse(res.result, null, false);
|
2585 | resolve(ret);
|
2586 | }
|
2587 | catch (err) {
|
2588 | reject(err);
|
2589 | }
|
2590 | }));
|
2591 | });
|
2592 | }
|
2593 | |
2594 |
|
2595 |
|
2596 |
|
2597 |
|
2598 | getWorkItemTypeColors(projectNames) {
|
2599 | return __awaiter(this, void 0, void 0, function* () {
|
2600 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2601 | let routeValues = {};
|
2602 | try {
|
2603 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "958fde80-115e-43fb-bd65-749c48057faf", routeValues);
|
2604 | let url = verData.requestUrl;
|
2605 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2606 | let res;
|
2607 | res = yield this.rest.create(url, projectNames, options);
|
2608 | let ret = this.formatResponse(res.result, null, true);
|
2609 | resolve(ret);
|
2610 | }
|
2611 | catch (err) {
|
2612 | reject(err);
|
2613 | }
|
2614 | }));
|
2615 | });
|
2616 | }
|
2617 | |
2618 |
|
2619 |
|
2620 |
|
2621 |
|
2622 | getWorkItemTypeColorAndIcons(projectNames) {
|
2623 | return __awaiter(this, void 0, void 0, function* () {
|
2624 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2625 | let routeValues = {};
|
2626 | try {
|
2627 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "f0f8dc62-3975-48ce-8051-f636b68b52e3", routeValues);
|
2628 | let url = verData.requestUrl;
|
2629 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2630 | let res;
|
2631 | res = yield this.rest.create(url, projectNames, options);
|
2632 | let ret = this.formatResponse(res.result, null, true);
|
2633 | resolve(ret);
|
2634 | }
|
2635 | catch (err) {
|
2636 | reject(err);
|
2637 | }
|
2638 | }));
|
2639 | });
|
2640 | }
|
2641 | |
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 | getWorkItemType(project, type) {
|
2648 | return __awaiter(this, void 0, void 0, function* () {
|
2649 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2650 | let routeValues = {
|
2651 | project: project,
|
2652 | type: type
|
2653 | };
|
2654 | try {
|
2655 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues);
|
2656 | let url = verData.requestUrl;
|
2657 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2658 | let res;
|
2659 | res = yield this.rest.get(url, options);
|
2660 | let ret = this.formatResponse(res.result, null, false);
|
2661 | resolve(ret);
|
2662 | }
|
2663 | catch (err) {
|
2664 | reject(err);
|
2665 | }
|
2666 | }));
|
2667 | });
|
2668 | }
|
2669 | |
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 | getWorkItemTypes(project) {
|
2675 | return __awaiter(this, void 0, void 0, function* () {
|
2676 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2677 | let routeValues = {
|
2678 | project: project
|
2679 | };
|
2680 | try {
|
2681 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.2", "wit", "7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues);
|
2682 | let url = verData.requestUrl;
|
2683 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2684 | let res;
|
2685 | res = yield this.rest.get(url, options);
|
2686 | let ret = this.formatResponse(res.result, null, true);
|
2687 | resolve(ret);
|
2688 | }
|
2689 | catch (err) {
|
2690 | reject(err);
|
2691 | }
|
2692 | }));
|
2693 | });
|
2694 | }
|
2695 | |
2696 |
|
2697 |
|
2698 |
|
2699 |
|
2700 |
|
2701 |
|
2702 | getWorkItemTypeFieldsWithReferences(project, type, expand) {
|
2703 | return __awaiter(this, void 0, void 0, function* () {
|
2704 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2705 | let routeValues = {
|
2706 | project: project,
|
2707 | type: type
|
2708 | };
|
2709 | let queryValues = {
|
2710 | '$expand': expand,
|
2711 | };
|
2712 | try {
|
2713 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "bd293ce5-3d25-4192-8e67-e8092e879efb", routeValues, queryValues);
|
2714 | let url = verData.requestUrl;
|
2715 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2716 | let res;
|
2717 | res = yield this.rest.get(url, options);
|
2718 | let ret = this.formatResponse(res.result, null, true);
|
2719 | resolve(ret);
|
2720 | }
|
2721 | catch (err) {
|
2722 | reject(err);
|
2723 | }
|
2724 | }));
|
2725 | });
|
2726 | }
|
2727 | |
2728 |
|
2729 |
|
2730 |
|
2731 |
|
2732 |
|
2733 |
|
2734 |
|
2735 | getWorkItemTypeFieldWithReferences(project, type, field, expand) {
|
2736 | return __awaiter(this, void 0, void 0, function* () {
|
2737 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2738 | let routeValues = {
|
2739 | project: project,
|
2740 | type: type,
|
2741 | field: field
|
2742 | };
|
2743 | let queryValues = {
|
2744 | '$expand': expand,
|
2745 | };
|
2746 | try {
|
2747 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.3", "wit", "bd293ce5-3d25-4192-8e67-e8092e879efb", routeValues, queryValues);
|
2748 | let url = verData.requestUrl;
|
2749 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2750 | let res;
|
2751 | res = yield this.rest.get(url, options);
|
2752 | let ret = this.formatResponse(res.result, null, false);
|
2753 | resolve(ret);
|
2754 | }
|
2755 | catch (err) {
|
2756 | reject(err);
|
2757 | }
|
2758 | }));
|
2759 | });
|
2760 | }
|
2761 | |
2762 |
|
2763 |
|
2764 |
|
2765 |
|
2766 |
|
2767 | getWorkItemTypeStates(project, type) {
|
2768 | return __awaiter(this, void 0, void 0, function* () {
|
2769 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2770 | let routeValues = {
|
2771 | project: project,
|
2772 | type: type
|
2773 | };
|
2774 | try {
|
2775 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "7c9d7a76-4a09-43e8-b5df-bd792f4ac6aa", routeValues);
|
2776 | let url = verData.requestUrl;
|
2777 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2778 | let res;
|
2779 | res = yield this.rest.get(url, options);
|
2780 | let ret = this.formatResponse(res.result, null, true);
|
2781 | resolve(ret);
|
2782 | }
|
2783 | catch (err) {
|
2784 | reject(err);
|
2785 | }
|
2786 | }));
|
2787 | });
|
2788 | }
|
2789 | |
2790 |
|
2791 |
|
2792 |
|
2793 |
|
2794 |
|
2795 |
|
2796 | exportWorkItemTypeDefinition(project, type, exportGlobalLists) {
|
2797 | return __awaiter(this, void 0, void 0, function* () {
|
2798 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2799 | let routeValues = {
|
2800 | project: project,
|
2801 | type: type
|
2802 | };
|
2803 | let queryValues = {
|
2804 | exportGlobalLists: exportGlobalLists,
|
2805 | };
|
2806 | try {
|
2807 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "8637ac8b-5eb6-4f90-b3f7-4f2ff576a459", routeValues, queryValues);
|
2808 | let url = verData.requestUrl;
|
2809 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2810 | let res;
|
2811 | res = yield this.rest.get(url, options);
|
2812 | let ret = this.formatResponse(res.result, null, false);
|
2813 | resolve(ret);
|
2814 | }
|
2815 | catch (err) {
|
2816 | reject(err);
|
2817 | }
|
2818 | }));
|
2819 | });
|
2820 | }
|
2821 | |
2822 |
|
2823 |
|
2824 |
|
2825 |
|
2826 |
|
2827 | updateWorkItemTypeDefinition(updateModel, project) {
|
2828 | return __awaiter(this, void 0, void 0, function* () {
|
2829 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
2830 | let routeValues = {
|
2831 | project: project
|
2832 | };
|
2833 | try {
|
2834 | let verData = yield this.vsoClient.getVersioningData("7.1-preview.1", "wit", "8637ac8b-5eb6-4f90-b3f7-4f2ff576a459", routeValues);
|
2835 | let url = verData.requestUrl;
|
2836 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
2837 | let res;
|
2838 | res = yield this.rest.create(url, updateModel, options);
|
2839 | let ret = this.formatResponse(res.result, null, false);
|
2840 | resolve(ret);
|
2841 | }
|
2842 | catch (err) {
|
2843 | reject(err);
|
2844 | }
|
2845 | }));
|
2846 | });
|
2847 | }
|
2848 | }
|
2849 | exports.WorkItemTrackingApi = WorkItemTrackingApi;
|
2850 | WorkItemTrackingApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5";
|