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.WorkItemTrackingProcessDefinitionsApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const WorkItemTrackingProcessDefinitionsInterfaces = require("./interfaces/WorkItemTrackingProcessDefinitionsInterfaces");
|
24 | class WorkItemTrackingProcessDefinitionsApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-WorkItemTracking-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | createBehavior(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.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", 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, null, false);
|
47 | resolve(ret);
|
48 | }
|
49 | catch (err) {
|
50 | reject(err);
|
51 | }
|
52 | }));
|
53 | });
|
54 | }
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | deleteBehavior(processId, behaviorId) {
|
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 | behaviorId: behaviorId
|
67 | };
|
68 | try {
|
69 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", 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 | getBehavior(processId, behaviorId) {
|
90 | return __awaiter(this, void 0, void 0, function* () {
|
91 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
92 | let routeValues = {
|
93 | processId: processId,
|
94 | behaviorId: behaviorId
|
95 | };
|
96 | try {
|
97 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues);
|
98 | let url = verData.requestUrl;
|
99 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
100 | let res;
|
101 | res = yield this.rest.get(url, options);
|
102 | let ret = this.formatResponse(res.result, null, false);
|
103 | resolve(ret);
|
104 | }
|
105 | catch (err) {
|
106 | reject(err);
|
107 | }
|
108 | }));
|
109 | });
|
110 | }
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 | getBehaviors(processId) {
|
117 | return __awaiter(this, void 0, void 0, function* () {
|
118 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
119 | let routeValues = {
|
120 | processId: processId
|
121 | };
|
122 | try {
|
123 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues);
|
124 | let url = verData.requestUrl;
|
125 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
126 | let res;
|
127 | res = yield this.rest.get(url, options);
|
128 | let ret = this.formatResponse(res.result, null, true);
|
129 | resolve(ret);
|
130 | }
|
131 | catch (err) {
|
132 | reject(err);
|
133 | }
|
134 | }));
|
135 | });
|
136 | }
|
137 | |
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | replaceBehavior(behaviorData, processId, behaviorId) {
|
145 | return __awaiter(this, void 0, void 0, function* () {
|
146 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
147 | let routeValues = {
|
148 | processId: processId,
|
149 | behaviorId: behaviorId
|
150 | };
|
151 | try {
|
152 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "47a651f4-fb70-43bf-b96b-7c0ba947142b", routeValues);
|
153 | let url = verData.requestUrl;
|
154 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
155 | let res;
|
156 | res = yield this.rest.replace(url, behaviorData, options);
|
157 | let ret = this.formatResponse(res.result, null, false);
|
158 | resolve(ret);
|
159 | }
|
160 | catch (err) {
|
161 | reject(err);
|
162 | }
|
163 | }));
|
164 | });
|
165 | }
|
166 | |
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 | addControlToGroup(control, processId, witRefName, groupId) {
|
175 | return __awaiter(this, void 0, void 0, function* () {
|
176 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
177 | let routeValues = {
|
178 | processId: processId,
|
179 | witRefName: witRefName,
|
180 | groupId: groupId
|
181 | };
|
182 | try {
|
183 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues);
|
184 | let url = verData.requestUrl;
|
185 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
186 | let res;
|
187 | res = yield this.rest.create(url, control, options);
|
188 | let ret = this.formatResponse(res.result, null, false);
|
189 | resolve(ret);
|
190 | }
|
191 | catch (err) {
|
192 | reject(err);
|
193 | }
|
194 | }));
|
195 | });
|
196 | }
|
197 | |
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 | editControl(control, processId, witRefName, groupId, controlId) {
|
207 | return __awaiter(this, void 0, void 0, function* () {
|
208 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
209 | let routeValues = {
|
210 | processId: processId,
|
211 | witRefName: witRefName,
|
212 | groupId: groupId,
|
213 | controlId: controlId
|
214 | };
|
215 | try {
|
216 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues);
|
217 | let url = verData.requestUrl;
|
218 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
219 | let res;
|
220 | res = yield this.rest.update(url, control, options);
|
221 | let ret = this.formatResponse(res.result, null, false);
|
222 | resolve(ret);
|
223 | }
|
224 | catch (err) {
|
225 | reject(err);
|
226 | }
|
227 | }));
|
228 | });
|
229 | }
|
230 | |
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 | removeControlFromGroup(processId, witRefName, groupId, controlId) {
|
239 | return __awaiter(this, void 0, void 0, function* () {
|
240 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
241 | let routeValues = {
|
242 | processId: processId,
|
243 | witRefName: witRefName,
|
244 | groupId: groupId,
|
245 | controlId: controlId
|
246 | };
|
247 | try {
|
248 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues);
|
249 | let url = verData.requestUrl;
|
250 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
251 | let res;
|
252 | res = yield this.rest.del(url, options);
|
253 | let ret = this.formatResponse(res.result, null, false);
|
254 | resolve(ret);
|
255 | }
|
256 | catch (err) {
|
257 | reject(err);
|
258 | }
|
259 | }));
|
260 | });
|
261 | }
|
262 | |
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 | setControlInGroup(control, processId, witRefName, groupId, controlId, removeFromGroupId) {
|
273 | return __awaiter(this, void 0, void 0, function* () {
|
274 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
275 | let routeValues = {
|
276 | processId: processId,
|
277 | witRefName: witRefName,
|
278 | groupId: groupId,
|
279 | controlId: controlId
|
280 | };
|
281 | let queryValues = {
|
282 | removeFromGroupId: removeFromGroupId,
|
283 | };
|
284 | try {
|
285 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "e2e3166a-627a-4e9b-85b2-d6a097bbd731", routeValues, queryValues);
|
286 | let url = verData.requestUrl;
|
287 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
288 | let res;
|
289 | res = yield this.rest.replace(url, control, options);
|
290 | let ret = this.formatResponse(res.result, null, false);
|
291 | resolve(ret);
|
292 | }
|
293 | catch (err) {
|
294 | reject(err);
|
295 | }
|
296 | }));
|
297 | });
|
298 | }
|
299 | |
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 | createField(field, processId) {
|
306 | return __awaiter(this, void 0, void 0, function* () {
|
307 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
308 | let routeValues = {
|
309 | processId: processId
|
310 | };
|
311 | try {
|
312 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "f36c66c7-911d-4163-8938-d3c5d0d7f5aa", routeValues);
|
313 | let url = verData.requestUrl;
|
314 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
315 | let res;
|
316 | res = yield this.rest.create(url, field, options);
|
317 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FieldModel, false);
|
318 | resolve(ret);
|
319 | }
|
320 | catch (err) {
|
321 | reject(err);
|
322 | }
|
323 | }));
|
324 | });
|
325 | }
|
326 | |
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 | updateField(field, processId) {
|
333 | return __awaiter(this, void 0, void 0, function* () {
|
334 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
335 | let routeValues = {
|
336 | processId: processId
|
337 | };
|
338 | try {
|
339 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "f36c66c7-911d-4163-8938-d3c5d0d7f5aa", routeValues);
|
340 | let url = verData.requestUrl;
|
341 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
342 | let res;
|
343 | res = yield this.rest.update(url, field, options);
|
344 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FieldModel, false);
|
345 | resolve(ret);
|
346 | }
|
347 | catch (err) {
|
348 | reject(err);
|
349 | }
|
350 | }));
|
351 | });
|
352 | }
|
353 | |
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 | addGroup(group, processId, witRefName, pageId, sectionId) {
|
363 | return __awaiter(this, void 0, void 0, function* () {
|
364 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
365 | let routeValues = {
|
366 | processId: processId,
|
367 | witRefName: witRefName,
|
368 | pageId: pageId,
|
369 | sectionId: sectionId
|
370 | };
|
371 | try {
|
372 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues);
|
373 | let url = verData.requestUrl;
|
374 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
375 | let res;
|
376 | res = yield this.rest.create(url, group, options);
|
377 | let ret = this.formatResponse(res.result, null, false);
|
378 | resolve(ret);
|
379 | }
|
380 | catch (err) {
|
381 | reject(err);
|
382 | }
|
383 | }));
|
384 | });
|
385 | }
|
386 | |
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 |
|
393 |
|
394 |
|
395 |
|
396 | editGroup(group, processId, witRefName, pageId, sectionId, groupId) {
|
397 | return __awaiter(this, void 0, void 0, function* () {
|
398 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
399 | let routeValues = {
|
400 | processId: processId,
|
401 | witRefName: witRefName,
|
402 | pageId: pageId,
|
403 | sectionId: sectionId,
|
404 | groupId: groupId
|
405 | };
|
406 | try {
|
407 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues);
|
408 | let url = verData.requestUrl;
|
409 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
410 | let res;
|
411 | res = yield this.rest.update(url, group, options);
|
412 | let ret = this.formatResponse(res.result, null, false);
|
413 | resolve(ret);
|
414 | }
|
415 | catch (err) {
|
416 | reject(err);
|
417 | }
|
418 | }));
|
419 | });
|
420 | }
|
421 | |
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 |
|
429 |
|
430 | removeGroup(processId, witRefName, pageId, sectionId, groupId) {
|
431 | return __awaiter(this, void 0, void 0, function* () {
|
432 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
433 | let routeValues = {
|
434 | processId: processId,
|
435 | witRefName: witRefName,
|
436 | pageId: pageId,
|
437 | sectionId: sectionId,
|
438 | groupId: groupId
|
439 | };
|
440 | try {
|
441 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues);
|
442 | let url = verData.requestUrl;
|
443 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
444 | let res;
|
445 | res = yield this.rest.del(url, options);
|
446 | let ret = this.formatResponse(res.result, null, false);
|
447 | resolve(ret);
|
448 | }
|
449 | catch (err) {
|
450 | reject(err);
|
451 | }
|
452 | }));
|
453 | });
|
454 | }
|
455 | |
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | setGroupInPage(group, processId, witRefName, pageId, sectionId, groupId, removeFromPageId, removeFromSectionId) {
|
468 | return __awaiter(this, void 0, void 0, function* () {
|
469 | if (removeFromPageId == null) {
|
470 | throw new TypeError('removeFromPageId can not be null or undefined');
|
471 | }
|
472 | if (removeFromSectionId == null) {
|
473 | throw new TypeError('removeFromSectionId can not be null or undefined');
|
474 | }
|
475 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
476 | let routeValues = {
|
477 | processId: processId,
|
478 | witRefName: witRefName,
|
479 | pageId: pageId,
|
480 | sectionId: sectionId,
|
481 | groupId: groupId
|
482 | };
|
483 | let queryValues = {
|
484 | removeFromPageId: removeFromPageId,
|
485 | removeFromSectionId: removeFromSectionId,
|
486 | };
|
487 | try {
|
488 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues, queryValues);
|
489 | let url = verData.requestUrl;
|
490 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
491 | let res;
|
492 | res = yield this.rest.replace(url, group, options);
|
493 | let ret = this.formatResponse(res.result, null, false);
|
494 | resolve(ret);
|
495 | }
|
496 | catch (err) {
|
497 | reject(err);
|
498 | }
|
499 | }));
|
500 | });
|
501 | }
|
502 | |
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 | setGroupInSection(group, processId, witRefName, pageId, sectionId, groupId, removeFromSectionId) {
|
514 | return __awaiter(this, void 0, void 0, function* () {
|
515 | if (removeFromSectionId == null) {
|
516 | throw new TypeError('removeFromSectionId can not be null or undefined');
|
517 | }
|
518 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
519 | let routeValues = {
|
520 | processId: processId,
|
521 | witRefName: witRefName,
|
522 | pageId: pageId,
|
523 | sectionId: sectionId,
|
524 | groupId: groupId
|
525 | };
|
526 | let queryValues = {
|
527 | removeFromSectionId: removeFromSectionId,
|
528 | };
|
529 | try {
|
530 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "2617828b-e850-4375-a92a-04855704d4c3", routeValues, queryValues);
|
531 | let url = verData.requestUrl;
|
532 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
533 | let res;
|
534 | res = yield this.rest.replace(url, group, options);
|
535 | let ret = this.formatResponse(res.result, null, false);
|
536 | resolve(ret);
|
537 | }
|
538 | catch (err) {
|
539 | reject(err);
|
540 | }
|
541 | }));
|
542 | });
|
543 | }
|
544 | |
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | getFormLayout(processId, witRefName) {
|
551 | return __awaiter(this, void 0, void 0, function* () {
|
552 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
553 | let routeValues = {
|
554 | processId: processId,
|
555 | witRefName: witRefName
|
556 | };
|
557 | try {
|
558 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "3eacc80a-ddca-4404-857a-6331aac99063", routeValues);
|
559 | let url = verData.requestUrl;
|
560 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
561 | let res;
|
562 | res = yield this.rest.get(url, options);
|
563 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.FormLayout, false);
|
564 | resolve(ret);
|
565 | }
|
566 | catch (err) {
|
567 | reject(err);
|
568 | }
|
569 | }));
|
570 | });
|
571 | }
|
572 | |
573 |
|
574 |
|
575 |
|
576 | getListsMetadata() {
|
577 | return __awaiter(this, void 0, void 0, function* () {
|
578 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
579 | let routeValues = {};
|
580 | try {
|
581 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "b45cc931-98e3-44a1-b1cd-2e8e9c6dc1c6", routeValues);
|
582 | let url = verData.requestUrl;
|
583 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
584 | let res;
|
585 | res = yield this.rest.get(url, options);
|
586 | let ret = this.formatResponse(res.result, null, true);
|
587 | resolve(ret);
|
588 | }
|
589 | catch (err) {
|
590 | reject(err);
|
591 | }
|
592 | }));
|
593 | });
|
594 | }
|
595 | |
596 |
|
597 |
|
598 |
|
599 |
|
600 | createList(picklist) {
|
601 | return __awaiter(this, void 0, void 0, function* () {
|
602 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
603 | let routeValues = {};
|
604 | try {
|
605 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues);
|
606 | let url = verData.requestUrl;
|
607 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
608 | let res;
|
609 | res = yield this.rest.create(url, picklist, options);
|
610 | let ret = this.formatResponse(res.result, null, false);
|
611 | resolve(ret);
|
612 | }
|
613 | catch (err) {
|
614 | reject(err);
|
615 | }
|
616 | }));
|
617 | });
|
618 | }
|
619 | |
620 |
|
621 |
|
622 |
|
623 |
|
624 | deleteList(listId) {
|
625 | return __awaiter(this, void 0, void 0, function* () {
|
626 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
627 | let routeValues = {
|
628 | listId: listId
|
629 | };
|
630 | try {
|
631 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues);
|
632 | let url = verData.requestUrl;
|
633 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
634 | let res;
|
635 | res = yield this.rest.del(url, options);
|
636 | let ret = this.formatResponse(res.result, null, false);
|
637 | resolve(ret);
|
638 | }
|
639 | catch (err) {
|
640 | reject(err);
|
641 | }
|
642 | }));
|
643 | });
|
644 | }
|
645 | |
646 |
|
647 |
|
648 |
|
649 |
|
650 | getList(listId) {
|
651 | return __awaiter(this, void 0, void 0, function* () {
|
652 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
653 | let routeValues = {
|
654 | listId: listId
|
655 | };
|
656 | try {
|
657 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues);
|
658 | let url = verData.requestUrl;
|
659 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
660 | let res;
|
661 | res = yield this.rest.get(url, options);
|
662 | let ret = this.formatResponse(res.result, null, false);
|
663 | resolve(ret);
|
664 | }
|
665 | catch (err) {
|
666 | reject(err);
|
667 | }
|
668 | }));
|
669 | });
|
670 | }
|
671 | |
672 |
|
673 |
|
674 |
|
675 |
|
676 |
|
677 | updateList(picklist, listId) {
|
678 | return __awaiter(this, void 0, void 0, function* () {
|
679 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
680 | let routeValues = {
|
681 | listId: listId
|
682 | };
|
683 | try {
|
684 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "0b6179e2-23ce-46b2-b094-2ffa5ee70286", routeValues);
|
685 | let url = verData.requestUrl;
|
686 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
687 | let res;
|
688 | res = yield this.rest.replace(url, picklist, options);
|
689 | let ret = this.formatResponse(res.result, null, false);
|
690 | resolve(ret);
|
691 | }
|
692 | catch (err) {
|
693 | reject(err);
|
694 | }
|
695 | }));
|
696 | });
|
697 | }
|
698 | |
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 | addPage(page, processId, witRefName) {
|
706 | return __awaiter(this, void 0, void 0, function* () {
|
707 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
708 | let routeValues = {
|
709 | processId: processId,
|
710 | witRefName: witRefName
|
711 | };
|
712 | try {
|
713 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues);
|
714 | let url = verData.requestUrl;
|
715 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
716 | let res;
|
717 | res = yield this.rest.create(url, page, options);
|
718 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.Page, false);
|
719 | resolve(ret);
|
720 | }
|
721 | catch (err) {
|
722 | reject(err);
|
723 | }
|
724 | }));
|
725 | });
|
726 | }
|
727 | |
728 |
|
729 |
|
730 |
|
731 |
|
732 |
|
733 |
|
734 | editPage(page, processId, witRefName) {
|
735 | return __awaiter(this, void 0, void 0, function* () {
|
736 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
737 | let routeValues = {
|
738 | processId: processId,
|
739 | witRefName: witRefName
|
740 | };
|
741 | try {
|
742 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues);
|
743 | let url = verData.requestUrl;
|
744 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
745 | let res;
|
746 | res = yield this.rest.update(url, page, options);
|
747 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.Page, false);
|
748 | resolve(ret);
|
749 | }
|
750 | catch (err) {
|
751 | reject(err);
|
752 | }
|
753 | }));
|
754 | });
|
755 | }
|
756 | |
757 |
|
758 |
|
759 |
|
760 |
|
761 |
|
762 |
|
763 | removePage(processId, witRefName, pageId) {
|
764 | return __awaiter(this, void 0, void 0, function* () {
|
765 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
766 | let routeValues = {
|
767 | processId: processId,
|
768 | witRefName: witRefName,
|
769 | pageId: pageId
|
770 | };
|
771 | try {
|
772 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1b4ac126-59b2-4f37-b4df-0a48ba807edb", routeValues);
|
773 | let url = verData.requestUrl;
|
774 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
775 | let res;
|
776 | res = yield this.rest.del(url, options);
|
777 | let ret = this.formatResponse(res.result, null, false);
|
778 | resolve(ret);
|
779 | }
|
780 | catch (err) {
|
781 | reject(err);
|
782 | }
|
783 | }));
|
784 | });
|
785 | }
|
786 | |
787 |
|
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 | createStateDefinition(stateModel, processId, witRefName) {
|
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 | processId: processId,
|
798 | witRefName: witRefName
|
799 | };
|
800 | try {
|
801 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues);
|
802 | let url = verData.requestUrl;
|
803 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
804 | let res;
|
805 | res = yield this.rest.create(url, stateModel, options);
|
806 | let ret = this.formatResponse(res.result, null, false);
|
807 | resolve(ret);
|
808 | }
|
809 | catch (err) {
|
810 | reject(err);
|
811 | }
|
812 | }));
|
813 | });
|
814 | }
|
815 | |
816 |
|
817 |
|
818 |
|
819 |
|
820 |
|
821 |
|
822 | deleteStateDefinition(processId, witRefName, stateId) {
|
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 | processId: processId,
|
827 | witRefName: witRefName,
|
828 | stateId: stateId
|
829 | };
|
830 | try {
|
831 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues);
|
832 | let url = verData.requestUrl;
|
833 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
834 | let res;
|
835 | res = yield this.rest.del(url, options);
|
836 | let ret = this.formatResponse(res.result, null, false);
|
837 | resolve(ret);
|
838 | }
|
839 | catch (err) {
|
840 | reject(err);
|
841 | }
|
842 | }));
|
843 | });
|
844 | }
|
845 | |
846 |
|
847 |
|
848 |
|
849 |
|
850 |
|
851 |
|
852 | getStateDefinition(processId, witRefName, stateId) {
|
853 | return __awaiter(this, void 0, void 0, function* () {
|
854 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
855 | let routeValues = {
|
856 | processId: processId,
|
857 | witRefName: witRefName,
|
858 | stateId: stateId
|
859 | };
|
860 | try {
|
861 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues);
|
862 | let url = verData.requestUrl;
|
863 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
864 | let res;
|
865 | res = yield this.rest.get(url, options);
|
866 | let ret = this.formatResponse(res.result, null, false);
|
867 | resolve(ret);
|
868 | }
|
869 | catch (err) {
|
870 | reject(err);
|
871 | }
|
872 | }));
|
873 | });
|
874 | }
|
875 | |
876 |
|
877 |
|
878 |
|
879 |
|
880 |
|
881 | getStateDefinitions(processId, witRefName) {
|
882 | return __awaiter(this, void 0, void 0, function* () {
|
883 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
884 | let routeValues = {
|
885 | processId: processId,
|
886 | witRefName: witRefName
|
887 | };
|
888 | try {
|
889 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues);
|
890 | let url = verData.requestUrl;
|
891 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
892 | let res;
|
893 | res = yield this.rest.get(url, options);
|
894 | let ret = this.formatResponse(res.result, null, true);
|
895 | resolve(ret);
|
896 | }
|
897 | catch (err) {
|
898 | reject(err);
|
899 | }
|
900 | }));
|
901 | });
|
902 | }
|
903 | |
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 |
|
910 |
|
911 | hideStateDefinition(hideStateModel, processId, witRefName, stateId) {
|
912 | return __awaiter(this, void 0, void 0, function* () {
|
913 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
914 | let routeValues = {
|
915 | processId: processId,
|
916 | witRefName: witRefName,
|
917 | stateId: stateId
|
918 | };
|
919 | try {
|
920 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues);
|
921 | let url = verData.requestUrl;
|
922 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
923 | let res;
|
924 | res = yield this.rest.replace(url, hideStateModel, options);
|
925 | let ret = this.formatResponse(res.result, null, false);
|
926 | resolve(ret);
|
927 | }
|
928 | catch (err) {
|
929 | reject(err);
|
930 | }
|
931 | }));
|
932 | });
|
933 | }
|
934 | |
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 | updateStateDefinition(stateModel, processId, witRefName, stateId) {
|
943 | return __awaiter(this, void 0, void 0, function* () {
|
944 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
945 | let routeValues = {
|
946 | processId: processId,
|
947 | witRefName: witRefName,
|
948 | stateId: stateId
|
949 | };
|
950 | try {
|
951 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "4303625d-08f4-4461-b14b-32c65bba5599", routeValues);
|
952 | let url = verData.requestUrl;
|
953 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
954 | let res;
|
955 | res = yield this.rest.update(url, stateModel, options);
|
956 | let ret = this.formatResponse(res.result, null, false);
|
957 | resolve(ret);
|
958 | }
|
959 | catch (err) {
|
960 | reject(err);
|
961 | }
|
962 | }));
|
963 | });
|
964 | }
|
965 | |
966 |
|
967 |
|
968 |
|
969 |
|
970 |
|
971 |
|
972 | addBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) {
|
973 | return __awaiter(this, void 0, void 0, function* () {
|
974 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
975 | let routeValues = {
|
976 | processId: processId,
|
977 | witRefNameForBehaviors: witRefNameForBehaviors
|
978 | };
|
979 | try {
|
980 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues);
|
981 | let url = verData.requestUrl;
|
982 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
983 | let res;
|
984 | res = yield this.rest.create(url, behavior, options);
|
985 | let ret = this.formatResponse(res.result, null, false);
|
986 | resolve(ret);
|
987 | }
|
988 | catch (err) {
|
989 | reject(err);
|
990 | }
|
991 | }));
|
992 | });
|
993 | }
|
994 | |
995 |
|
996 |
|
997 |
|
998 |
|
999 |
|
1000 |
|
1001 | getBehaviorForWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) {
|
1002 | return __awaiter(this, void 0, void 0, function* () {
|
1003 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1004 | let routeValues = {
|
1005 | processId: processId,
|
1006 | witRefNameForBehaviors: witRefNameForBehaviors,
|
1007 | behaviorRefName: behaviorRefName
|
1008 | };
|
1009 | try {
|
1010 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues);
|
1011 | let url = verData.requestUrl;
|
1012 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1013 | let res;
|
1014 | res = yield this.rest.get(url, options);
|
1015 | let ret = this.formatResponse(res.result, null, false);
|
1016 | resolve(ret);
|
1017 | }
|
1018 | catch (err) {
|
1019 | reject(err);
|
1020 | }
|
1021 | }));
|
1022 | });
|
1023 | }
|
1024 | |
1025 |
|
1026 |
|
1027 |
|
1028 |
|
1029 |
|
1030 | getBehaviorsForWorkItemType(processId, witRefNameForBehaviors) {
|
1031 | return __awaiter(this, void 0, void 0, function* () {
|
1032 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1033 | let routeValues = {
|
1034 | processId: processId,
|
1035 | witRefNameForBehaviors: witRefNameForBehaviors
|
1036 | };
|
1037 | try {
|
1038 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues);
|
1039 | let url = verData.requestUrl;
|
1040 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1041 | let res;
|
1042 | res = yield this.rest.get(url, options);
|
1043 | let ret = this.formatResponse(res.result, null, true);
|
1044 | resolve(ret);
|
1045 | }
|
1046 | catch (err) {
|
1047 | reject(err);
|
1048 | }
|
1049 | }));
|
1050 | });
|
1051 | }
|
1052 | |
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 | removeBehaviorFromWorkItemType(processId, witRefNameForBehaviors, behaviorRefName) {
|
1060 | return __awaiter(this, void 0, void 0, function* () {
|
1061 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1062 | let routeValues = {
|
1063 | processId: processId,
|
1064 | witRefNameForBehaviors: witRefNameForBehaviors,
|
1065 | behaviorRefName: behaviorRefName
|
1066 | };
|
1067 | try {
|
1068 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues);
|
1069 | let url = verData.requestUrl;
|
1070 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1071 | let res;
|
1072 | res = yield this.rest.del(url, options);
|
1073 | let ret = this.formatResponse(res.result, null, false);
|
1074 | resolve(ret);
|
1075 | }
|
1076 | catch (err) {
|
1077 | reject(err);
|
1078 | }
|
1079 | }));
|
1080 | });
|
1081 | }
|
1082 | |
1083 |
|
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 | updateBehaviorToWorkItemType(behavior, processId, witRefNameForBehaviors) {
|
1090 | return __awaiter(this, void 0, void 0, function* () {
|
1091 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1092 | let routeValues = {
|
1093 | processId: processId,
|
1094 | witRefNameForBehaviors: witRefNameForBehaviors
|
1095 | };
|
1096 | try {
|
1097 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "921dfb88-ef57-4c69-94e5-dd7da2d7031d", routeValues);
|
1098 | let url = verData.requestUrl;
|
1099 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1100 | let res;
|
1101 | res = yield this.rest.update(url, behavior, options);
|
1102 | let ret = this.formatResponse(res.result, null, false);
|
1103 | resolve(ret);
|
1104 | }
|
1105 | catch (err) {
|
1106 | reject(err);
|
1107 | }
|
1108 | }));
|
1109 | });
|
1110 | }
|
1111 | |
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 |
|
1117 | createWorkItemType(workItemType, processId) {
|
1118 | return __awaiter(this, void 0, void 0, function* () {
|
1119 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1120 | let routeValues = {
|
1121 | processId: processId
|
1122 | };
|
1123 | try {
|
1124 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues);
|
1125 | let url = verData.requestUrl;
|
1126 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1127 | let res;
|
1128 | res = yield this.rest.create(url, workItemType, options);
|
1129 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false);
|
1130 | resolve(ret);
|
1131 | }
|
1132 | catch (err) {
|
1133 | reject(err);
|
1134 | }
|
1135 | }));
|
1136 | });
|
1137 | }
|
1138 | |
1139 |
|
1140 |
|
1141 |
|
1142 |
|
1143 |
|
1144 | deleteWorkItemType(processId, witRefName) {
|
1145 | return __awaiter(this, void 0, void 0, function* () {
|
1146 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1147 | let routeValues = {
|
1148 | processId: processId,
|
1149 | witRefName: witRefName
|
1150 | };
|
1151 | try {
|
1152 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues);
|
1153 | let url = verData.requestUrl;
|
1154 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1155 | let res;
|
1156 | res = yield this.rest.del(url, options);
|
1157 | let ret = this.formatResponse(res.result, null, false);
|
1158 | resolve(ret);
|
1159 | }
|
1160 | catch (err) {
|
1161 | reject(err);
|
1162 | }
|
1163 | }));
|
1164 | });
|
1165 | }
|
1166 | |
1167 |
|
1168 |
|
1169 |
|
1170 |
|
1171 |
|
1172 |
|
1173 | getWorkItemType(processId, witRefName, expand) {
|
1174 | return __awaiter(this, void 0, void 0, function* () {
|
1175 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1176 | let routeValues = {
|
1177 | processId: processId,
|
1178 | witRefName: witRefName
|
1179 | };
|
1180 | let queryValues = {
|
1181 | '$expand': expand,
|
1182 | };
|
1183 | try {
|
1184 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues, queryValues);
|
1185 | let url = verData.requestUrl;
|
1186 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1187 | let res;
|
1188 | res = yield this.rest.get(url, options);
|
1189 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false);
|
1190 | resolve(ret);
|
1191 | }
|
1192 | catch (err) {
|
1193 | reject(err);
|
1194 | }
|
1195 | }));
|
1196 | });
|
1197 | }
|
1198 | |
1199 |
|
1200 |
|
1201 |
|
1202 |
|
1203 |
|
1204 | getWorkItemTypes(processId, expand) {
|
1205 | return __awaiter(this, void 0, void 0, function* () {
|
1206 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1207 | let routeValues = {
|
1208 | processId: processId
|
1209 | };
|
1210 | let queryValues = {
|
1211 | '$expand': expand,
|
1212 | };
|
1213 | try {
|
1214 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues, queryValues);
|
1215 | let url = verData.requestUrl;
|
1216 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1217 | let res;
|
1218 | res = yield this.rest.get(url, options);
|
1219 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, true);
|
1220 | resolve(ret);
|
1221 | }
|
1222 | catch (err) {
|
1223 | reject(err);
|
1224 | }
|
1225 | }));
|
1226 | });
|
1227 | }
|
1228 | |
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 | updateWorkItemType(workItemTypeUpdate, processId, witRefName) {
|
1236 | return __awaiter(this, void 0, void 0, function* () {
|
1237 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1238 | let routeValues = {
|
1239 | processId: processId,
|
1240 | witRefName: witRefName
|
1241 | };
|
1242 | try {
|
1243 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "1ce0acad-4638-49c3-969c-04aa65ba6bea", routeValues);
|
1244 | let url = verData.requestUrl;
|
1245 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1246 | let res;
|
1247 | res = yield this.rest.update(url, workItemTypeUpdate, options);
|
1248 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeModel, false);
|
1249 | resolve(ret);
|
1250 | }
|
1251 | catch (err) {
|
1252 | reject(err);
|
1253 | }
|
1254 | }));
|
1255 | });
|
1256 | }
|
1257 | |
1258 |
|
1259 |
|
1260 |
|
1261 |
|
1262 |
|
1263 |
|
1264 | addFieldToWorkItemType(field, processId, witRefNameForFields) {
|
1265 | return __awaiter(this, void 0, void 0, function* () {
|
1266 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1267 | let routeValues = {
|
1268 | processId: processId,
|
1269 | witRefNameForFields: witRefNameForFields
|
1270 | };
|
1271 | try {
|
1272 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues);
|
1273 | let url = verData.requestUrl;
|
1274 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1275 | let res;
|
1276 | res = yield this.rest.create(url, field, options);
|
1277 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false);
|
1278 | resolve(ret);
|
1279 | }
|
1280 | catch (err) {
|
1281 | reject(err);
|
1282 | }
|
1283 | }));
|
1284 | });
|
1285 | }
|
1286 | |
1287 |
|
1288 |
|
1289 |
|
1290 |
|
1291 |
|
1292 |
|
1293 | getWorkItemTypeField(processId, witRefNameForFields, fieldRefName) {
|
1294 | return __awaiter(this, void 0, void 0, function* () {
|
1295 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1296 | let routeValues = {
|
1297 | processId: processId,
|
1298 | witRefNameForFields: witRefNameForFields,
|
1299 | fieldRefName: fieldRefName
|
1300 | };
|
1301 | try {
|
1302 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues);
|
1303 | let url = verData.requestUrl;
|
1304 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1305 | let res;
|
1306 | res = yield this.rest.get(url, options);
|
1307 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false);
|
1308 | resolve(ret);
|
1309 | }
|
1310 | catch (err) {
|
1311 | reject(err);
|
1312 | }
|
1313 | }));
|
1314 | });
|
1315 | }
|
1316 | |
1317 |
|
1318 |
|
1319 |
|
1320 |
|
1321 |
|
1322 | getWorkItemTypeFields(processId, witRefNameForFields) {
|
1323 | return __awaiter(this, void 0, void 0, function* () {
|
1324 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1325 | let routeValues = {
|
1326 | processId: processId,
|
1327 | witRefNameForFields: witRefNameForFields
|
1328 | };
|
1329 | try {
|
1330 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues);
|
1331 | let url = verData.requestUrl;
|
1332 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1333 | let res;
|
1334 | res = yield this.rest.get(url, options);
|
1335 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, true);
|
1336 | resolve(ret);
|
1337 | }
|
1338 | catch (err) {
|
1339 | reject(err);
|
1340 | }
|
1341 | }));
|
1342 | });
|
1343 | }
|
1344 | |
1345 |
|
1346 |
|
1347 |
|
1348 |
|
1349 |
|
1350 |
|
1351 | removeFieldFromWorkItemType(processId, witRefNameForFields, fieldRefName) {
|
1352 | return __awaiter(this, void 0, void 0, function* () {
|
1353 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1354 | let routeValues = {
|
1355 | processId: processId,
|
1356 | witRefNameForFields: witRefNameForFields,
|
1357 | fieldRefName: fieldRefName
|
1358 | };
|
1359 | try {
|
1360 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues);
|
1361 | let url = verData.requestUrl;
|
1362 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1363 | let res;
|
1364 | res = yield this.rest.del(url, options);
|
1365 | let ret = this.formatResponse(res.result, null, false);
|
1366 | resolve(ret);
|
1367 | }
|
1368 | catch (err) {
|
1369 | reject(err);
|
1370 | }
|
1371 | }));
|
1372 | });
|
1373 | }
|
1374 | |
1375 |
|
1376 |
|
1377 |
|
1378 |
|
1379 |
|
1380 |
|
1381 | updateWorkItemTypeField(field, processId, witRefNameForFields) {
|
1382 | return __awaiter(this, void 0, void 0, function* () {
|
1383 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
1384 | let routeValues = {
|
1385 | processId: processId,
|
1386 | witRefNameForFields: witRefNameForFields
|
1387 | };
|
1388 | try {
|
1389 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "processDefinitions", "976713b4-a62e-499e-94dc-eeb869ea9126", routeValues);
|
1390 | let url = verData.requestUrl;
|
1391 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
1392 | let res;
|
1393 | res = yield this.rest.update(url, field, options);
|
1394 | let ret = this.formatResponse(res.result, WorkItemTrackingProcessDefinitionsInterfaces.TypeInfo.WorkItemTypeFieldModel2, false);
|
1395 | resolve(ret);
|
1396 | }
|
1397 | catch (err) {
|
1398 | reject(err);
|
1399 | }
|
1400 | }));
|
1401 | });
|
1402 | }
|
1403 | }
|
1404 | exports.WorkItemTrackingProcessDefinitionsApi = WorkItemTrackingProcessDefinitionsApi;
|
1405 | WorkItemTrackingProcessDefinitionsApi.RESOURCE_AREA_ID = "5264459e-e5e0-4bd8-b118-0985e68a4ec5";
|