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.WorkItemTrackingProcessApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const WorkItemTrackingProcessInterfaces = require("./interfaces/WorkItemTrackingProcessInterfaces");
|
24 | class WorkItemTrackingProcessApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-WorkItemTracking-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | createProcessBehavior(behavior, processId) {
|
35 | return __awaiter(this, void 0, void 0, function* () {
|
36 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
37 | let routeValues = {
|
38 | processId: processId
|
39 | };
|
40 | try {
|
41 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues);
|
42 | let url = verData.requestUrl;
|
43 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
44 | let res;
|
45 | res = yield this.rest.create(url, behavior, options);
|
46 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false);
|
47 | resolve(ret);
|
48 | }
|
49 | catch (err) {
|
50 | reject(err);
|
51 | }
|
52 | }));
|
53 | });
|
54 | }
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | deleteProcessBehavior(processId, behaviorRefName) {
|
62 | return __awaiter(this, void 0, void 0, function* () {
|
63 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
64 | let routeValues = {
|
65 | processId: processId,
|
66 | behaviorRefName: behaviorRefName
|
67 | };
|
68 | try {
|
69 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues);
|
70 | let url = verData.requestUrl;
|
71 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
72 | let res;
|
73 | res = yield this.rest.del(url, options);
|
74 | let ret = this.formatResponse(res.result, null, false);
|
75 | resolve(ret);
|
76 | }
|
77 | catch (err) {
|
78 | reject(err);
|
79 | }
|
80 | }));
|
81 | });
|
82 | }
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 | getProcessBehavior(processId, behaviorRefName, expand) {
|
91 | return __awaiter(this, void 0, void 0, function* () {
|
92 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
93 | let routeValues = {
|
94 | processId: processId,
|
95 | behaviorRefName: behaviorRefName
|
96 | };
|
97 | let queryValues = {
|
98 | '$expand': expand,
|
99 | };
|
100 | try {
|
101 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues, queryValues);
|
102 | let url = verData.requestUrl;
|
103 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
104 | let res;
|
105 | res = yield this.rest.get(url, options);
|
106 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false);
|
107 | resolve(ret);
|
108 | }
|
109 | catch (err) {
|
110 | reject(err);
|
111 | }
|
112 | }));
|
113 | });
|
114 | }
|
115 | |
116 |
|
117 |
|
118 |
|
119 |
|
120 |
|
121 | getProcessBehaviors(processId, expand) {
|
122 | return __awaiter(this, void 0, void 0, function* () {
|
123 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
124 | let routeValues = {
|
125 | processId: processId
|
126 | };
|
127 | let queryValues = {
|
128 | '$expand': expand,
|
129 | };
|
130 | try {
|
131 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues, queryValues);
|
132 | let url = verData.requestUrl;
|
133 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
134 | let res;
|
135 | res = yield this.rest.get(url, options);
|
136 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, true);
|
137 | resolve(ret);
|
138 | }
|
139 | catch (err) {
|
140 | reject(err);
|
141 | }
|
142 | }));
|
143 | });
|
144 | }
|
145 | |
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 | updateProcessBehavior(behaviorData, processId, behaviorRefName) {
|
153 | return __awaiter(this, void 0, void 0, function* () {
|
154 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
155 | let routeValues = {
|
156 | processId: processId,
|
157 | behaviorRefName: behaviorRefName
|
158 | };
|
159 | try {
|
160 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "d1800200-f184-4e75-a5f2-ad0b04b4373e", routeValues);
|
161 | let url = verData.requestUrl;
|
162 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
163 | let res;
|
164 | res = yield this.rest.replace(url, behaviorData, options);
|
165 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessBehavior, false);
|
166 | resolve(ret);
|
167 | }
|
168 | catch (err) {
|
169 | reject(err);
|
170 | }
|
171 | }));
|
172 | });
|
173 | }
|
174 | |
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 | createControlInGroup(control, processId, witRefName, groupId) {
|
183 | return __awaiter(this, void 0, void 0, function* () {
|
184 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
185 | let routeValues = {
|
186 | processId: processId,
|
187 | witRefName: witRefName,
|
188 | groupId: groupId
|
189 | };
|
190 | try {
|
191 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues);
|
192 | let url = verData.requestUrl;
|
193 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
194 | let res;
|
195 | res = yield this.rest.create(url, control, options);
|
196 | let ret = this.formatResponse(res.result, null, false);
|
197 | resolve(ret);
|
198 | }
|
199 | catch (err) {
|
200 | reject(err);
|
201 | }
|
202 | }));
|
203 | });
|
204 | }
|
205 | |
206 |
|
207 |
|
208 |
|
209 |
|
210 |
|
211 |
|
212 |
|
213 |
|
214 |
|
215 | moveControlToGroup(control, processId, witRefName, groupId, controlId, removeFromGroupId) {
|
216 | return __awaiter(this, void 0, void 0, function* () {
|
217 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
218 | let routeValues = {
|
219 | processId: processId,
|
220 | witRefName: witRefName,
|
221 | groupId: groupId,
|
222 | controlId: controlId
|
223 | };
|
224 | let queryValues = {
|
225 | removeFromGroupId: removeFromGroupId,
|
226 | };
|
227 | try {
|
228 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues, queryValues);
|
229 | let url = verData.requestUrl;
|
230 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
231 | let res;
|
232 | res = yield this.rest.replace(url, control, options);
|
233 | let ret = this.formatResponse(res.result, null, false);
|
234 | resolve(ret);
|
235 | }
|
236 | catch (err) {
|
237 | reject(err);
|
238 | }
|
239 | }));
|
240 | });
|
241 | }
|
242 | |
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 | removeControlFromGroup(processId, witRefName, groupId, controlId) {
|
251 | return __awaiter(this, void 0, void 0, function* () {
|
252 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
253 | let routeValues = {
|
254 | processId: processId,
|
255 | witRefName: witRefName,
|
256 | groupId: groupId,
|
257 | controlId: controlId
|
258 | };
|
259 | try {
|
260 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues);
|
261 | let url = verData.requestUrl;
|
262 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
263 | let res;
|
264 | res = yield this.rest.del(url, options);
|
265 | let ret = this.formatResponse(res.result, null, false);
|
266 | resolve(ret);
|
267 | }
|
268 | catch (err) {
|
269 | reject(err);
|
270 | }
|
271 | }));
|
272 | });
|
273 | }
|
274 | |
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 | updateControl(control, processId, witRefName, groupId, controlId) {
|
284 | return __awaiter(this, void 0, void 0, function* () {
|
285 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
286 | let routeValues = {
|
287 | processId: processId,
|
288 | witRefName: witRefName,
|
289 | groupId: groupId,
|
290 | controlId: controlId
|
291 | };
|
292 | try {
|
293 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58", routeValues);
|
294 | let url = verData.requestUrl;
|
295 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
296 | let res;
|
297 | res = yield this.rest.update(url, control, options);
|
298 | let ret = this.formatResponse(res.result, null, false);
|
299 | resolve(ret);
|
300 | }
|
301 | catch (err) {
|
302 | reject(err);
|
303 | }
|
304 | }));
|
305 | });
|
306 | }
|
307 | |
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 | addFieldToWorkItemType(field, processId, witRefName) {
|
315 | return __awaiter(this, void 0, void 0, function* () {
|
316 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
317 | let routeValues = {
|
318 | processId: processId,
|
319 | witRefName: witRefName
|
320 | };
|
321 | try {
|
322 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues);
|
323 | let url = verData.requestUrl;
|
324 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
325 | let res;
|
326 | res = yield this.rest.create(url, field, options);
|
327 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false);
|
328 | resolve(ret);
|
329 | }
|
330 | catch (err) {
|
331 | reject(err);
|
332 | }
|
333 | }));
|
334 | });
|
335 | }
|
336 | |
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 | getAllWorkItemTypeFields(processId, witRefName) {
|
343 | return __awaiter(this, void 0, void 0, function* () {
|
344 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
345 | let routeValues = {
|
346 | processId: processId,
|
347 | witRefName: witRefName
|
348 | };
|
349 | try {
|
350 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues);
|
351 | let url = verData.requestUrl;
|
352 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
353 | let res;
|
354 | res = yield this.rest.get(url, options);
|
355 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, true);
|
356 | resolve(ret);
|
357 | }
|
358 | catch (err) {
|
359 | reject(err);
|
360 | }
|
361 | }));
|
362 | });
|
363 | }
|
364 | |
365 |
|
366 |
|
367 |
|
368 |
|
369 |
|
370 |
|
371 |
|
372 | getWorkItemTypeField(processId, witRefName, fieldRefName, expand) {
|
373 | return __awaiter(this, void 0, void 0, function* () {
|
374 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
375 | let routeValues = {
|
376 | processId: processId,
|
377 | witRefName: witRefName,
|
378 | fieldRefName: fieldRefName
|
379 | };
|
380 | let queryValues = {
|
381 | '$expand': expand,
|
382 | };
|
383 | try {
|
384 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues, queryValues);
|
385 | let url = verData.requestUrl;
|
386 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
387 | let res;
|
388 | res = yield this.rest.get(url, options);
|
389 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false);
|
390 | resolve(ret);
|
391 | }
|
392 | catch (err) {
|
393 | reject(err);
|
394 | }
|
395 | }));
|
396 | });
|
397 | }
|
398 | |
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 | removeWorkItemTypeField(processId, witRefName, fieldRefName) {
|
406 | return __awaiter(this, void 0, void 0, function* () {
|
407 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
408 | let routeValues = {
|
409 | processId: processId,
|
410 | witRefName: witRefName,
|
411 | fieldRefName: fieldRefName
|
412 | };
|
413 | try {
|
414 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues);
|
415 | let url = verData.requestUrl;
|
416 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
417 | let res;
|
418 | res = yield this.rest.del(url, options);
|
419 | let ret = this.formatResponse(res.result, null, false);
|
420 | resolve(ret);
|
421 | }
|
422 | catch (err) {
|
423 | reject(err);
|
424 | }
|
425 | }));
|
426 | });
|
427 | }
|
428 | |
429 |
|
430 |
|
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | updateWorkItemTypeField(field, processId, witRefName, fieldRefName) {
|
437 | return __awaiter(this, void 0, void 0, function* () {
|
438 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
439 | let routeValues = {
|
440 | processId: processId,
|
441 | witRefName: witRefName,
|
442 | fieldRefName: fieldRefName
|
443 | };
|
444 | try {
|
445 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "bc0ad8dc-e3f3-46b0-b06c-5bf861793196", routeValues);
|
446 | let url = verData.requestUrl;
|
447 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
448 | let res;
|
449 | res = yield this.rest.update(url, field, options);
|
450 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemTypeField, false);
|
451 | resolve(ret);
|
452 | }
|
453 | catch (err) {
|
454 | reject(err);
|
455 | }
|
456 | }));
|
457 | });
|
458 | }
|
459 | |
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 | addGroup(group, processId, witRefName, pageId, sectionId) {
|
469 | return __awaiter(this, void 0, void 0, function* () {
|
470 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
471 | let routeValues = {
|
472 | processId: processId,
|
473 | witRefName: witRefName,
|
474 | pageId: pageId,
|
475 | sectionId: sectionId
|
476 | };
|
477 | try {
|
478 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues);
|
479 | let url = verData.requestUrl;
|
480 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
481 | let res;
|
482 | res = yield this.rest.create(url, group, options);
|
483 | let ret = this.formatResponse(res.result, null, false);
|
484 | resolve(ret);
|
485 | }
|
486 | catch (err) {
|
487 | reject(err);
|
488 | }
|
489 | }));
|
490 | });
|
491 | }
|
492 | |
493 |
|
494 |
|
495 |
|
496 |
|
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 | moveGroupToPage(group, processId, witRefName, pageId, sectionId, groupId, removeFromPageId, removeFromSectionId) {
|
505 | return __awaiter(this, void 0, void 0, function* () {
|
506 | if (removeFromPageId == null) {
|
507 | throw new TypeError('removeFromPageId can not be null or undefined');
|
508 | }
|
509 | if (removeFromSectionId == null) {
|
510 | throw new TypeError('removeFromSectionId can not be null or undefined');
|
511 | }
|
512 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
513 | let routeValues = {
|
514 | processId: processId,
|
515 | witRefName: witRefName,
|
516 | pageId: pageId,
|
517 | sectionId: sectionId,
|
518 | groupId: groupId
|
519 | };
|
520 | let queryValues = {
|
521 | removeFromPageId: removeFromPageId,
|
522 | removeFromSectionId: removeFromSectionId,
|
523 | };
|
524 | try {
|
525 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues, queryValues);
|
526 | let url = verData.requestUrl;
|
527 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
528 | let res;
|
529 | res = yield this.rest.replace(url, group, options);
|
530 | let ret = this.formatResponse(res.result, null, false);
|
531 | resolve(ret);
|
532 | }
|
533 | catch (err) {
|
534 | reject(err);
|
535 | }
|
536 | }));
|
537 | });
|
538 | }
|
539 | |
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | moveGroupToSection(group, processId, witRefName, pageId, sectionId, groupId, removeFromSectionId) {
|
551 | return __awaiter(this, void 0, void 0, function* () {
|
552 | if (removeFromSectionId == null) {
|
553 | throw new TypeError('removeFromSectionId can not be null or undefined');
|
554 | }
|
555 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
556 | let routeValues = {
|
557 | processId: processId,
|
558 | witRefName: witRefName,
|
559 | pageId: pageId,
|
560 | sectionId: sectionId,
|
561 | groupId: groupId
|
562 | };
|
563 | let queryValues = {
|
564 | removeFromSectionId: removeFromSectionId,
|
565 | };
|
566 | try {
|
567 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues, queryValues);
|
568 | let url = verData.requestUrl;
|
569 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
570 | let res;
|
571 | res = yield this.rest.replace(url, group, options);
|
572 | let ret = this.formatResponse(res.result, null, false);
|
573 | resolve(ret);
|
574 | }
|
575 | catch (err) {
|
576 | reject(err);
|
577 | }
|
578 | }));
|
579 | });
|
580 | }
|
581 | |
582 |
|
583 |
|
584 |
|
585 |
|
586 |
|
587 |
|
588 |
|
589 |
|
590 | removeGroup(processId, witRefName, pageId, sectionId, groupId) {
|
591 | return __awaiter(this, void 0, void 0, function* () {
|
592 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
593 | let routeValues = {
|
594 | processId: processId,
|
595 | witRefName: witRefName,
|
596 | pageId: pageId,
|
597 | sectionId: sectionId,
|
598 | groupId: groupId
|
599 | };
|
600 | try {
|
601 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues);
|
602 | let url = verData.requestUrl;
|
603 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
604 | let res;
|
605 | res = yield this.rest.del(url, options);
|
606 | let ret = this.formatResponse(res.result, null, false);
|
607 | resolve(ret);
|
608 | }
|
609 | catch (err) {
|
610 | reject(err);
|
611 | }
|
612 | }));
|
613 | });
|
614 | }
|
615 | |
616 |
|
617 |
|
618 |
|
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 | updateGroup(group, processId, witRefName, pageId, sectionId, groupId) {
|
626 | return __awaiter(this, void 0, void 0, function* () {
|
627 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
628 | let routeValues = {
|
629 | processId: processId,
|
630 | witRefName: witRefName,
|
631 | pageId: pageId,
|
632 | sectionId: sectionId,
|
633 | groupId: groupId
|
634 | };
|
635 | try {
|
636 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "766e44e1-36a8-41d7-9050-c343ff02f7a5", routeValues);
|
637 | let url = verData.requestUrl;
|
638 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
639 | let res;
|
640 | res = yield this.rest.update(url, group, options);
|
641 | let ret = this.formatResponse(res.result, null, false);
|
642 | resolve(ret);
|
643 | }
|
644 | catch (err) {
|
645 | reject(err);
|
646 | }
|
647 | }));
|
648 | });
|
649 | }
|
650 | |
651 |
|
652 |
|
653 |
|
654 |
|
655 |
|
656 | getFormLayout(processId, witRefName) {
|
657 | return __awaiter(this, void 0, void 0, function* () {
|
658 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
659 | let routeValues = {
|
660 | processId: processId,
|
661 | witRefName: witRefName
|
662 | };
|
663 | try {
|
664 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "fa8646eb-43cd-4b71-9564-40106fd63e40", routeValues);
|
665 | let url = verData.requestUrl;
|
666 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
667 | let res;
|
668 | res = yield this.rest.get(url, options);
|
669 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.FormLayout, false);
|
670 | resolve(ret);
|
671 | }
|
672 | catch (err) {
|
673 | reject(err);
|
674 | }
|
675 | }));
|
676 | });
|
677 | }
|
678 | |
679 |
|
680 |
|
681 |
|
682 |
|
683 | createList(picklist) {
|
684 | return __awaiter(this, void 0, void 0, function* () {
|
685 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
686 | let routeValues = {};
|
687 | try {
|
688 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues);
|
689 | let url = verData.requestUrl;
|
690 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
691 | let res;
|
692 | res = yield this.rest.create(url, picklist, options);
|
693 | let ret = this.formatResponse(res.result, null, false);
|
694 | resolve(ret);
|
695 | }
|
696 | catch (err) {
|
697 | reject(err);
|
698 | }
|
699 | }));
|
700 | });
|
701 | }
|
702 | |
703 |
|
704 |
|
705 |
|
706 |
|
707 | deleteList(listId) {
|
708 | return __awaiter(this, void 0, void 0, function* () {
|
709 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
710 | let routeValues = {
|
711 | listId: listId
|
712 | };
|
713 | try {
|
714 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues);
|
715 | let url = verData.requestUrl;
|
716 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
717 | let res;
|
718 | res = yield this.rest.del(url, options);
|
719 | let ret = this.formatResponse(res.result, null, false);
|
720 | resolve(ret);
|
721 | }
|
722 | catch (err) {
|
723 | reject(err);
|
724 | }
|
725 | }));
|
726 | });
|
727 | }
|
728 | |
729 |
|
730 |
|
731 |
|
732 |
|
733 | getList(listId) {
|
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 | listId: listId
|
738 | };
|
739 | try {
|
740 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues);
|
741 | let url = verData.requestUrl;
|
742 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
743 | let res;
|
744 | res = yield this.rest.get(url, options);
|
745 | let ret = this.formatResponse(res.result, null, false);
|
746 | resolve(ret);
|
747 | }
|
748 | catch (err) {
|
749 | reject(err);
|
750 | }
|
751 | }));
|
752 | });
|
753 | }
|
754 | |
755 |
|
756 |
|
757 |
|
758 | getListsMetadata() {
|
759 | return __awaiter(this, void 0, void 0, function* () {
|
760 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
761 | let routeValues = {};
|
762 | try {
|
763 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues);
|
764 | let url = verData.requestUrl;
|
765 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
766 | let res;
|
767 | res = yield this.rest.get(url, options);
|
768 | let ret = this.formatResponse(res.result, null, true);
|
769 | resolve(ret);
|
770 | }
|
771 | catch (err) {
|
772 | reject(err);
|
773 | }
|
774 | }));
|
775 | });
|
776 | }
|
777 | |
778 |
|
779 |
|
780 |
|
781 |
|
782 |
|
783 | updateList(picklist, listId) {
|
784 | return __awaiter(this, void 0, void 0, function* () {
|
785 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
786 | let routeValues = {
|
787 | listId: listId
|
788 | };
|
789 | try {
|
790 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "01e15468-e27c-4e20-a974-bd957dcccebc", routeValues);
|
791 | let url = verData.requestUrl;
|
792 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
793 | let res;
|
794 | res = yield this.rest.replace(url, picklist, options);
|
795 | let ret = this.formatResponse(res.result, null, false);
|
796 | resolve(ret);
|
797 | }
|
798 | catch (err) {
|
799 | reject(err);
|
800 | }
|
801 | }));
|
802 | });
|
803 | }
|
804 | |
805 |
|
806 |
|
807 |
|
808 |
|
809 |
|
810 |
|
811 | addPage(page, processId, witRefName) {
|
812 | return __awaiter(this, void 0, void 0, function* () {
|
813 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
814 | let routeValues = {
|
815 | processId: processId,
|
816 | witRefName: witRefName
|
817 | };
|
818 | try {
|
819 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues);
|
820 | let url = verData.requestUrl;
|
821 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
822 | let res;
|
823 | res = yield this.rest.create(url, page, options);
|
824 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.Page, false);
|
825 | resolve(ret);
|
826 | }
|
827 | catch (err) {
|
828 | reject(err);
|
829 | }
|
830 | }));
|
831 | });
|
832 | }
|
833 | |
834 |
|
835 |
|
836 |
|
837 |
|
838 |
|
839 |
|
840 | removePage(processId, witRefName, pageId) {
|
841 | return __awaiter(this, void 0, void 0, function* () {
|
842 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
843 | let routeValues = {
|
844 | processId: processId,
|
845 | witRefName: witRefName,
|
846 | pageId: pageId
|
847 | };
|
848 | try {
|
849 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues);
|
850 | let url = verData.requestUrl;
|
851 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
852 | let res;
|
853 | res = yield this.rest.del(url, options);
|
854 | let ret = this.formatResponse(res.result, null, false);
|
855 | resolve(ret);
|
856 | }
|
857 | catch (err) {
|
858 | reject(err);
|
859 | }
|
860 | }));
|
861 | });
|
862 | }
|
863 | |
864 |
|
865 |
|
866 |
|
867 |
|
868 |
|
869 |
|
870 | updatePage(page, processId, witRefName) {
|
871 | return __awaiter(this, void 0, void 0, function* () {
|
872 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
873 | let routeValues = {
|
874 | processId: processId,
|
875 | witRefName: witRefName
|
876 | };
|
877 | try {
|
878 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "1cc7b29f-6697-4d9d-b0a1-2650d3e1d584", routeValues);
|
879 | let url = verData.requestUrl;
|
880 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
881 | let res;
|
882 | res = yield this.rest.update(url, page, options);
|
883 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.Page, false);
|
884 | resolve(ret);
|
885 | }
|
886 | catch (err) {
|
887 | reject(err);
|
888 | }
|
889 | }));
|
890 | });
|
891 | }
|
892 | |
893 |
|
894 |
|
895 |
|
896 |
|
897 | createNewProcess(createRequest) {
|
898 | return __awaiter(this, void 0, void 0, function* () {
|
899 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
900 | let routeValues = {};
|
901 | try {
|
902 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues);
|
903 | let url = verData.requestUrl;
|
904 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
905 | let res;
|
906 | res = yield this.rest.create(url, createRequest, options);
|
907 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false);
|
908 | resolve(ret);
|
909 | }
|
910 | catch (err) {
|
911 | reject(err);
|
912 | }
|
913 | }));
|
914 | });
|
915 | }
|
916 | |
917 |
|
918 |
|
919 |
|
920 |
|
921 | deleteProcessById(processTypeId) {
|
922 | return __awaiter(this, void 0, void 0, function* () {
|
923 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
924 | let routeValues = {
|
925 | processTypeId: processTypeId
|
926 | };
|
927 | try {
|
928 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues);
|
929 | let url = verData.requestUrl;
|
930 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
931 | let res;
|
932 | res = yield this.rest.del(url, options);
|
933 | let ret = this.formatResponse(res.result, null, false);
|
934 | resolve(ret);
|
935 | }
|
936 | catch (err) {
|
937 | reject(err);
|
938 | }
|
939 | }));
|
940 | });
|
941 | }
|
942 | |
943 |
|
944 |
|
945 |
|
946 |
|
947 |
|
948 | editProcess(updateRequest, processTypeId) {
|
949 | return __awaiter(this, void 0, void 0, function* () {
|
950 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
951 | let routeValues = {
|
952 | processTypeId: processTypeId
|
953 | };
|
954 | try {
|
955 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues);
|
956 | let url = verData.requestUrl;
|
957 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
958 | let res;
|
959 | res = yield this.rest.update(url, updateRequest, options);
|
960 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false);
|
961 | resolve(ret);
|
962 | }
|
963 | catch (err) {
|
964 | reject(err);
|
965 | }
|
966 | }));
|
967 | });
|
968 | }
|
969 | |
970 |
|
971 |
|
972 |
|
973 |
|
974 | getListOfProcesses(expand) {
|
975 | return __awaiter(this, void 0, void 0, function* () {
|
976 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
977 | let routeValues = {};
|
978 | let queryValues = {
|
979 | '$expand': expand,
|
980 | };
|
981 | try {
|
982 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues, queryValues);
|
983 | let url = verData.requestUrl;
|
984 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
985 | let res;
|
986 | res = yield this.rest.get(url, options);
|
987 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, true);
|
988 | resolve(ret);
|
989 | }
|
990 | catch (err) {
|
991 | reject(err);
|
992 | }
|
993 | }));
|
994 | });
|
995 | }
|
996 | |
997 |
|
998 |
|
999 |
|
1000 |
|
1001 |
|
1002 | getProcessByItsId(processTypeId, expand) {
|
1003 | return __awaiter(this, void 0, void 0, function* () {
|
1004 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1005 | let routeValues = {
|
1006 | processTypeId: processTypeId
|
1007 | };
|
1008 | let queryValues = {
|
1009 | '$expand': expand,
|
1010 | };
|
1011 | try {
|
1012 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "02cc6a73-5cfb-427d-8c8e-b49fb086e8af", routeValues, queryValues);
|
1013 | let url = verData.requestUrl;
|
1014 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1015 | let res;
|
1016 | res = yield this.rest.get(url, options);
|
1017 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessInfo, false);
|
1018 | resolve(ret);
|
1019 | }
|
1020 | catch (err) {
|
1021 | reject(err);
|
1022 | }
|
1023 | }));
|
1024 | });
|
1025 | }
|
1026 | |
1027 |
|
1028 |
|
1029 |
|
1030 |
|
1031 |
|
1032 |
|
1033 | addProcessWorkItemTypeRule(processRuleCreate, processId, witRefName) {
|
1034 | return __awaiter(this, void 0, void 0, function* () {
|
1035 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1036 | let routeValues = {
|
1037 | processId: processId,
|
1038 | witRefName: witRefName
|
1039 | };
|
1040 | try {
|
1041 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues);
|
1042 | let url = verData.requestUrl;
|
1043 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1044 | let res;
|
1045 | res = yield this.rest.create(url, processRuleCreate, options);
|
1046 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false);
|
1047 | resolve(ret);
|
1048 | }
|
1049 | catch (err) {
|
1050 | reject(err);
|
1051 | }
|
1052 | }));
|
1053 | });
|
1054 | }
|
1055 | |
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 | deleteProcessWorkItemTypeRule(processId, witRefName, ruleId) {
|
1063 | return __awaiter(this, void 0, void 0, function* () {
|
1064 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1065 | let routeValues = {
|
1066 | processId: processId,
|
1067 | witRefName: witRefName,
|
1068 | ruleId: ruleId
|
1069 | };
|
1070 | try {
|
1071 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues);
|
1072 | let url = verData.requestUrl;
|
1073 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1074 | let res;
|
1075 | res = yield this.rest.del(url, options);
|
1076 | let ret = this.formatResponse(res.result, null, false);
|
1077 | resolve(ret);
|
1078 | }
|
1079 | catch (err) {
|
1080 | reject(err);
|
1081 | }
|
1082 | }));
|
1083 | });
|
1084 | }
|
1085 | |
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 | getProcessWorkItemTypeRule(processId, witRefName, ruleId) {
|
1093 | return __awaiter(this, void 0, void 0, function* () {
|
1094 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1095 | let routeValues = {
|
1096 | processId: processId,
|
1097 | witRefName: witRefName,
|
1098 | ruleId: ruleId
|
1099 | };
|
1100 | try {
|
1101 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues);
|
1102 | let url = verData.requestUrl;
|
1103 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1104 | let res;
|
1105 | res = yield this.rest.get(url, options);
|
1106 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false);
|
1107 | resolve(ret);
|
1108 | }
|
1109 | catch (err) {
|
1110 | reject(err);
|
1111 | }
|
1112 | }));
|
1113 | });
|
1114 | }
|
1115 | |
1116 |
|
1117 |
|
1118 |
|
1119 |
|
1120 |
|
1121 | getProcessWorkItemTypeRules(processId, witRefName) {
|
1122 | return __awaiter(this, void 0, void 0, function* () {
|
1123 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1124 | let routeValues = {
|
1125 | processId: processId,
|
1126 | witRefName: witRefName
|
1127 | };
|
1128 | try {
|
1129 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues);
|
1130 | let url = verData.requestUrl;
|
1131 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1132 | let res;
|
1133 | res = yield this.rest.get(url, options);
|
1134 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, true);
|
1135 | resolve(ret);
|
1136 | }
|
1137 | catch (err) {
|
1138 | reject(err);
|
1139 | }
|
1140 | }));
|
1141 | });
|
1142 | }
|
1143 | |
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 | updateProcessWorkItemTypeRule(processRule, processId, witRefName, ruleId) {
|
1152 | return __awaiter(this, void 0, void 0, function* () {
|
1153 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1154 | let routeValues = {
|
1155 | processId: processId,
|
1156 | witRefName: witRefName,
|
1157 | ruleId: ruleId
|
1158 | };
|
1159 | try {
|
1160 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "76fe3432-d825-479d-a5f6-983bbb78b4f3", routeValues);
|
1161 | let url = verData.requestUrl;
|
1162 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1163 | let res;
|
1164 | res = yield this.rest.replace(url, processRule, options);
|
1165 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessRule, false);
|
1166 | resolve(ret);
|
1167 | }
|
1168 | catch (err) {
|
1169 | reject(err);
|
1170 | }
|
1171 | }));
|
1172 | });
|
1173 | }
|
1174 | |
1175 |
|
1176 |
|
1177 |
|
1178 |
|
1179 |
|
1180 |
|
1181 | createStateDefinition(stateModel, processId, witRefName) {
|
1182 | return __awaiter(this, void 0, void 0, function* () {
|
1183 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1184 | let routeValues = {
|
1185 | processId: processId,
|
1186 | witRefName: witRefName
|
1187 | };
|
1188 | try {
|
1189 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues);
|
1190 | let url = verData.requestUrl;
|
1191 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1192 | let res;
|
1193 | res = yield this.rest.create(url, stateModel, options);
|
1194 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false);
|
1195 | resolve(ret);
|
1196 | }
|
1197 | catch (err) {
|
1198 | reject(err);
|
1199 | }
|
1200 | }));
|
1201 | });
|
1202 | }
|
1203 | |
1204 |
|
1205 |
|
1206 |
|
1207 |
|
1208 |
|
1209 |
|
1210 | deleteStateDefinition(processId, witRefName, stateId) {
|
1211 | return __awaiter(this, void 0, void 0, function* () {
|
1212 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1213 | let routeValues = {
|
1214 | processId: processId,
|
1215 | witRefName: witRefName,
|
1216 | stateId: stateId
|
1217 | };
|
1218 | try {
|
1219 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues);
|
1220 | let url = verData.requestUrl;
|
1221 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1222 | let res;
|
1223 | res = yield this.rest.del(url, options);
|
1224 | let ret = this.formatResponse(res.result, null, false);
|
1225 | resolve(ret);
|
1226 | }
|
1227 | catch (err) {
|
1228 | reject(err);
|
1229 | }
|
1230 | }));
|
1231 | });
|
1232 | }
|
1233 | |
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 | getStateDefinition(processId, witRefName, stateId) {
|
1241 | return __awaiter(this, void 0, void 0, function* () {
|
1242 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1243 | let routeValues = {
|
1244 | processId: processId,
|
1245 | witRefName: witRefName,
|
1246 | stateId: stateId
|
1247 | };
|
1248 | try {
|
1249 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues);
|
1250 | let url = verData.requestUrl;
|
1251 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1252 | let res;
|
1253 | res = yield this.rest.get(url, options);
|
1254 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false);
|
1255 | resolve(ret);
|
1256 | }
|
1257 | catch (err) {
|
1258 | reject(err);
|
1259 | }
|
1260 | }));
|
1261 | });
|
1262 | }
|
1263 | |
1264 |
|
1265 |
|
1266 |
|
1267 |
|
1268 |
|
1269 | getStateDefinitions(processId, witRefName) {
|
1270 | return __awaiter(this, void 0, void 0, function* () {
|
1271 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1272 | let routeValues = {
|
1273 | processId: processId,
|
1274 | witRefName: witRefName
|
1275 | };
|
1276 | try {
|
1277 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues);
|
1278 | let url = verData.requestUrl;
|
1279 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1280 | let res;
|
1281 | res = yield this.rest.get(url, options);
|
1282 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, true);
|
1283 | resolve(ret);
|
1284 | }
|
1285 | catch (err) {
|
1286 | reject(err);
|
1287 | }
|
1288 | }));
|
1289 | });
|
1290 | }
|
1291 | |
1292 |
|
1293 |
|
1294 |
|
1295 |
|
1296 |
|
1297 |
|
1298 |
|
1299 | hideStateDefinition(hideStateModel, processId, witRefName, stateId) {
|
1300 | return __awaiter(this, void 0, void 0, function* () {
|
1301 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1302 | let routeValues = {
|
1303 | processId: processId,
|
1304 | witRefName: witRefName,
|
1305 | stateId: stateId
|
1306 | };
|
1307 | try {
|
1308 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues);
|
1309 | let url = verData.requestUrl;
|
1310 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1311 | let res;
|
1312 | res = yield this.rest.replace(url, hideStateModel, options);
|
1313 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false);
|
1314 | resolve(ret);
|
1315 | }
|
1316 | catch (err) {
|
1317 | reject(err);
|
1318 | }
|
1319 | }));
|
1320 | });
|
1321 | }
|
1322 | |
1323 |
|
1324 |
|
1325 |
|
1326 |
|
1327 |
|
1328 |
|
1329 |
|
1330 | updateStateDefinition(stateModel, processId, witRefName, stateId) {
|
1331 | return __awaiter(this, void 0, void 0, function* () {
|
1332 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1333 | let routeValues = {
|
1334 | processId: processId,
|
1335 | witRefName: witRefName,
|
1336 | stateId: stateId
|
1337 | };
|
1338 | try {
|
1339 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "31015d57-2dff-4a46-adb3-2fb4ee3dcec9", routeValues);
|
1340 | let url = verData.requestUrl;
|
1341 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1342 | let res;
|
1343 | res = yield this.rest.update(url, stateModel, options);
|
1344 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.WorkItemStateResultModel, false);
|
1345 | resolve(ret);
|
1346 | }
|
1347 | catch (err) {
|
1348 | reject(err);
|
1349 | }
|
1350 | }));
|
1351 | });
|
1352 | }
|
1353 | |
1354 |
|
1355 |
|
1356 |
|
1357 |
|
1358 |
|
1359 |
|
1360 | deleteSystemControl(processId, witRefName, controlId) {
|
1361 | return __awaiter(this, void 0, void 0, function* () {
|
1362 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1363 | let routeValues = {
|
1364 | processId: processId,
|
1365 | witRefName: witRefName,
|
1366 | controlId: controlId
|
1367 | };
|
1368 | try {
|
1369 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues);
|
1370 | let url = verData.requestUrl;
|
1371 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1372 | let res;
|
1373 | res = yield this.rest.del(url, options);
|
1374 | let ret = this.formatResponse(res.result, null, true);
|
1375 | resolve(ret);
|
1376 | }
|
1377 | catch (err) {
|
1378 | reject(err);
|
1379 | }
|
1380 | }));
|
1381 | });
|
1382 | }
|
1383 | |
1384 |
|
1385 |
|
1386 |
|
1387 |
|
1388 |
|
1389 | getSystemControls(processId, witRefName) {
|
1390 | return __awaiter(this, void 0, void 0, function* () {
|
1391 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1392 | let routeValues = {
|
1393 | processId: processId,
|
1394 | witRefName: witRefName
|
1395 | };
|
1396 | try {
|
1397 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues);
|
1398 | let url = verData.requestUrl;
|
1399 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1400 | let res;
|
1401 | res = yield this.rest.get(url, options);
|
1402 | let ret = this.formatResponse(res.result, null, true);
|
1403 | resolve(ret);
|
1404 | }
|
1405 | catch (err) {
|
1406 | reject(err);
|
1407 | }
|
1408 | }));
|
1409 | });
|
1410 | }
|
1411 | |
1412 |
|
1413 |
|
1414 |
|
1415 |
|
1416 |
|
1417 |
|
1418 |
|
1419 | updateSystemControl(control, processId, witRefName, controlId) {
|
1420 | return __awaiter(this, void 0, void 0, function* () {
|
1421 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1422 | let routeValues = {
|
1423 | processId: processId,
|
1424 | witRefName: witRefName,
|
1425 | controlId: controlId
|
1426 | };
|
1427 | try {
|
1428 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "ff9a3d2c-32b7-4c6c-991c-d5a251fb9098", routeValues);
|
1429 | let url = verData.requestUrl;
|
1430 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1431 | let res;
|
1432 | res = yield this.rest.update(url, control, options);
|
1433 | let ret = this.formatResponse(res.result, null, false);
|
1434 | resolve(ret);
|
1435 | }
|
1436 | catch (err) {
|
1437 | reject(err);
|
1438 | }
|
1439 | }));
|
1440 | });
|
1441 | }
|
1442 | |
1443 |
|
1444 |
|
1445 |
|
1446 |
|
1447 |
|
1448 | createProcessWorkItemType(workItemType, processId) {
|
1449 | return __awaiter(this, void 0, void 0, function* () {
|
1450 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1451 | let routeValues = {
|
1452 | processId: processId
|
1453 | };
|
1454 | try {
|
1455 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues);
|
1456 | let url = verData.requestUrl;
|
1457 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1458 | let res;
|
1459 | res = yield this.rest.create(url, workItemType, options);
|
1460 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false);
|
1461 | resolve(ret);
|
1462 | }
|
1463 | catch (err) {
|
1464 | reject(err);
|
1465 | }
|
1466 | }));
|
1467 | });
|
1468 | }
|
1469 | |
1470 |
|
1471 |
|
1472 |
|
1473 |
|
1474 |
|
1475 | deleteProcessWorkItemType(processId, witRefName) {
|
1476 | return __awaiter(this, void 0, void 0, function* () {
|
1477 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1478 | let routeValues = {
|
1479 | processId: processId,
|
1480 | witRefName: witRefName
|
1481 | };
|
1482 | try {
|
1483 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues);
|
1484 | let url = verData.requestUrl;
|
1485 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1486 | let res;
|
1487 | res = yield this.rest.del(url, options);
|
1488 | let ret = this.formatResponse(res.result, null, false);
|
1489 | resolve(ret);
|
1490 | }
|
1491 | catch (err) {
|
1492 | reject(err);
|
1493 | }
|
1494 | }));
|
1495 | });
|
1496 | }
|
1497 | |
1498 |
|
1499 |
|
1500 |
|
1501 |
|
1502 |
|
1503 |
|
1504 | getProcessWorkItemType(processId, witRefName, expand) {
|
1505 | return __awaiter(this, void 0, void 0, function* () {
|
1506 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1507 | let routeValues = {
|
1508 | processId: processId,
|
1509 | witRefName: witRefName
|
1510 | };
|
1511 | let queryValues = {
|
1512 | '$expand': expand,
|
1513 | };
|
1514 | try {
|
1515 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues, queryValues);
|
1516 | let url = verData.requestUrl;
|
1517 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1518 | let res;
|
1519 | res = yield this.rest.get(url, options);
|
1520 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false);
|
1521 | resolve(ret);
|
1522 | }
|
1523 | catch (err) {
|
1524 | reject(err);
|
1525 | }
|
1526 | }));
|
1527 | });
|
1528 | }
|
1529 | |
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 |
|
1535 | getProcessWorkItemTypes(processId, expand) {
|
1536 | return __awaiter(this, void 0, void 0, function* () {
|
1537 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1538 | let routeValues = {
|
1539 | processId: processId
|
1540 | };
|
1541 | let queryValues = {
|
1542 | '$expand': expand,
|
1543 | };
|
1544 | try {
|
1545 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues, queryValues);
|
1546 | let url = verData.requestUrl;
|
1547 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1548 | let res;
|
1549 | res = yield this.rest.get(url, options);
|
1550 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, true);
|
1551 | resolve(ret);
|
1552 | }
|
1553 | catch (err) {
|
1554 | reject(err);
|
1555 | }
|
1556 | }));
|
1557 | });
|
1558 | }
|
1559 | |
1560 |
|
1561 |
|
1562 |
|
1563 |
|
1564 |
|
1565 |
|
1566 | updateProcessWorkItemType(workItemTypeUpdate, processId, witRefName) {
|
1567 | return __awaiter(this, void 0, void 0, function* () {
|
1568 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1569 | let routeValues = {
|
1570 | processId: processId,
|
1571 | witRefName: witRefName
|
1572 | };
|
1573 | try {
|
1574 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.2", "processes", "e2e9d1a6-432d-4062-8870-bfcb8c324ad7", routeValues);
|
1575 | let url = verData.requestUrl;
|
1576 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1577 | let res;
|
1578 | res = yield this.rest.update(url, workItemTypeUpdate, options);
|
1579 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessInterfaces.TypeInfo.ProcessWorkItemType, false);
|
1580 | resolve(ret);
|
1581 | }
|
1582 | catch (err) {
|
1583 | reject(err);
|
1584 | }
|
1585 | }));
|
1586 | });
|
1587 | }
|
1588 | |
1589 |
|
1590 |
|
1591 |
|
1592 |
|
1593 |
|
1594 |
|
1595 | addBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) {
|
1596 | return __awaiter(this, void 0, void 0, function* () {
|
1597 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1598 | let routeValues = {
|
1599 | processId: processId,
|
1600 | witRefNameForBehaviors: witRefNameForBehaviors
|
1601 | };
|
1602 | try {
|
1603 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues);
|
1604 | let url = verData.requestUrl;
|
1605 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1606 | let res;
|
1607 | res = yield this.rest.create(url, behavior, options);
|
1608 | let ret = this.formatResponse(res.result, null, false);
|
1609 | resolve(ret);
|
1610 | }
|
1611 | catch (err) {
|
1612 | reject(err);
|
1613 | }
|
1614 | }));
|
1615 | });
|
1616 | }
|
1617 | |
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 |
|
1623 |
|
1624 | getBehaviorForWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) {
|
1625 | return __awaiter(this, void 0, void 0, function* () {
|
1626 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1627 | let routeValues = {
|
1628 | processId: processId,
|
1629 | witRefNameForBehaviors: witRefNameForBehaviors,
|
1630 | behaviorRefName: behaviorRefName
|
1631 | };
|
1632 | try {
|
1633 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues);
|
1634 | let url = verData.requestUrl;
|
1635 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1636 | let res;
|
1637 | res = yield this.rest.get(url, options);
|
1638 | let ret = this.formatResponse(res.result, null, false);
|
1639 | resolve(ret);
|
1640 | }
|
1641 | catch (err) {
|
1642 | reject(err);
|
1643 | }
|
1644 | }));
|
1645 | });
|
1646 | }
|
1647 | |
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 | getBehaviorsForWorkItemType(processId, witRefNameForBehaviors) {
|
1654 | return __awaiter(this, void 0, void 0, function* () {
|
1655 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1656 | let routeValues = {
|
1657 | processId: processId,
|
1658 | witRefNameForBehaviors: witRefNameForBehaviors
|
1659 | };
|
1660 | try {
|
1661 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues);
|
1662 | let url = verData.requestUrl;
|
1663 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1664 | let res;
|
1665 | res = yield this.rest.get(url, options);
|
1666 | let ret = this.formatResponse(res.result, null, true);
|
1667 | resolve(ret);
|
1668 | }
|
1669 | catch (err) {
|
1670 | reject(err);
|
1671 | }
|
1672 | }));
|
1673 | });
|
1674 | }
|
1675 | |
1676 |
|
1677 |
|
1678 |
|
1679 |
|
1680 |
|
1681 |
|
1682 | removeBehaviorFromWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) {
|
1683 | return __awaiter(this, void 0, void 0, function* () {
|
1684 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1685 | let routeValues = {
|
1686 | processId: processId,
|
1687 | witRefNameForBehaviors: witRefNameForBehaviors,
|
1688 | behaviorRefName: behaviorRefName
|
1689 | };
|
1690 | try {
|
1691 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues);
|
1692 | let url = verData.requestUrl;
|
1693 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1694 | let res;
|
1695 | res = yield this.rest.del(url, options);
|
1696 | let ret = this.formatResponse(res.result, null, false);
|
1697 | resolve(ret);
|
1698 | }
|
1699 | catch (err) {
|
1700 | reject(err);
|
1701 | }
|
1702 | }));
|
1703 | });
|
1704 | }
|
1705 | |
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 | updateBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) {
|
1713 | return __awaiter(this, void 0, void 0, function* () {
|
1714 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1715 | let routeValues = {
|
1716 | processId: processId,
|
1717 | witRefNameForBehaviors: witRefNameForBehaviors
|
1718 | };
|
1719 | try {
|
1720 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processes", "6d765a2e-4e1b-4b11-be93-f953be676024", routeValues);
|
1721 | let url = verData.requestUrl;
|
1722 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1723 | let res;
|
1724 | res = yield this.rest.update(url, behavior, options);
|
1725 | let ret = this.formatResponse(res.result, null, false);
|
1726 | resolve(ret);
|
1727 | }
|
1728 | catch (err) {
|
1729 | reject(err);
|
1730 | }
|
1731 | }));
|
1732 | });
|
1733 | }
|
1734 | }
|
1735 | exports.WorkItemTrackingProcessApi = WorkItemTrackingProcessApi;
|
1736 | WorkItemTrackingProcessApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5";
|