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.ManagementApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const ManagementInterfaces = require("./interfaces/ManagementInterfaces");
|
24 | class ManagementApi extends basem.ClientApiBase {
|
25 | constructor(baseUrl, handlers, options) {
|
26 | super(baseUrl, handlers, 'node-Management-api', options);
|
27 | }
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 | deleteBillingInfo(organizationId) {
|
34 | return __awaiter(this, void 0, void 0, function* () {
|
35 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
36 | let routeValues = {
|
37 | action: "Default",
|
38 | organizationId: organizationId
|
39 | };
|
40 | try {
|
41 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "de45fbc6-60fd-46e2-95ef-490ad08d656a", routeValues);
|
42 | let url = verData.requestUrl;
|
43 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
44 | let res;
|
45 | res = yield this.rest.del(url, 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 | deleteMeterUsageHistory(organizationId) {
|
61 | return __awaiter(this, void 0, void 0, function* () {
|
62 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
63 | let routeValues = {
|
64 | action: "MeterUsageHistory",
|
65 | organizationId: organizationId
|
66 | };
|
67 | try {
|
68 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "de45fbc6-60fd-46e2-95ef-490ad08d656a", routeValues);
|
69 | let url = verData.requestUrl;
|
70 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
71 | let res;
|
72 | res = yield this.rest.del(url, options);
|
73 | let ret = this.formatResponse(res.result, null, false);
|
74 | resolve(ret);
|
75 | }
|
76 | catch (err) {
|
77 | reject(err);
|
78 | }
|
79 | }));
|
80 | });
|
81 | }
|
82 | |
83 |
|
84 |
|
85 |
|
86 |
|
87 | getBillingInfo(organizationId) {
|
88 | return __awaiter(this, void 0, void 0, function* () {
|
89 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
90 | let routeValues = {
|
91 | action: "Default",
|
92 | organizationId: organizationId
|
93 | };
|
94 | try {
|
95 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "de45fbc6-60fd-46e2-95ef-490ad08d656a", routeValues);
|
96 | let url = verData.requestUrl;
|
97 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
98 | let res;
|
99 | res = yield this.rest.get(url, options);
|
100 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.BillingInfo, false);
|
101 | resolve(ret);
|
102 | }
|
103 | catch (err) {
|
104 | reject(err);
|
105 | }
|
106 | }));
|
107 | });
|
108 | }
|
109 | |
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 | saveBillingInfo(billingInfo, organizationId) {
|
116 | return __awaiter(this, void 0, void 0, function* () {
|
117 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
118 | let routeValues = {
|
119 | action: "Default",
|
120 | organizationId: organizationId
|
121 | };
|
122 | try {
|
123 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "de45fbc6-60fd-46e2-95ef-490ad08d656a", routeValues);
|
124 | let url = verData.requestUrl;
|
125 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
126 | let res;
|
127 | res = yield this.rest.create(url, billingInfo, options);
|
128 | let ret = this.formatResponse(res.result, null, false);
|
129 | resolve(ret);
|
130 | }
|
131 | catch (err) {
|
132 | reject(err);
|
133 | }
|
134 | }));
|
135 | });
|
136 | }
|
137 | |
138 |
|
139 |
|
140 |
|
141 |
|
142 | createBillingSnapshot(meterUsage) {
|
143 | return __awaiter(this, void 0, void 0, function* () {
|
144 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
145 | let routeValues = {
|
146 | action: "Default",
|
147 | };
|
148 | try {
|
149 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues);
|
150 | let url = verData.requestUrl;
|
151 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
152 | let res;
|
153 | res = yield this.rest.create(url, meterUsage, options);
|
154 | let ret = this.formatResponse(res.result, null, false);
|
155 | resolve(ret);
|
156 | }
|
157 | catch (err) {
|
158 | reject(err);
|
159 | }
|
160 | }));
|
161 | });
|
162 | }
|
163 | |
164 |
|
165 |
|
166 |
|
167 |
|
168 | getBillableCommitterDetails(billingDate) {
|
169 | return __awaiter(this, void 0, void 0, function* () {
|
170 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
171 | let routeValues = {
|
172 | action: "Details",
|
173 | };
|
174 | let queryValues = {
|
175 | billingDate: billingDate,
|
176 | };
|
177 | try {
|
178 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues, queryValues);
|
179 | let url = verData.requestUrl;
|
180 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
181 | let res;
|
182 | res = yield this.rest.get(url, options);
|
183 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.BillableCommitterDetails, true);
|
184 | resolve(ret);
|
185 | }
|
186 | catch (err) {
|
187 | reject(err);
|
188 | }
|
189 | }));
|
190 | });
|
191 | }
|
192 | |
193 |
|
194 | getLastMeterUsage() {
|
195 | return __awaiter(this, void 0, void 0, function* () {
|
196 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
197 | let routeValues = {
|
198 | action: "Last",
|
199 | };
|
200 | try {
|
201 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues);
|
202 | let url = verData.requestUrl;
|
203 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
204 | let res;
|
205 | res = yield this.rest.get(url, options);
|
206 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.MeterUsage, false);
|
207 | resolve(ret);
|
208 | }
|
209 | catch (err) {
|
210 | reject(err);
|
211 | }
|
212 | }));
|
213 | });
|
214 | }
|
215 | |
216 |
|
217 |
|
218 |
|
219 |
|
220 | getMeterUsage(billingDate) {
|
221 | return __awaiter(this, void 0, void 0, function* () {
|
222 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
223 | let routeValues = {
|
224 | action: "Default",
|
225 | };
|
226 | let queryValues = {
|
227 | billingDate: billingDate,
|
228 | };
|
229 | try {
|
230 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "e58d8091-3d07-48b1-9527-7d6295fd4081", routeValues, queryValues);
|
231 | let url = verData.requestUrl;
|
232 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
233 | let res;
|
234 | res = yield this.rest.get(url, options);
|
235 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.MeterUsage, false);
|
236 | resolve(ret);
|
237 | }
|
238 | catch (err) {
|
239 | reject(err);
|
240 | }
|
241 | }));
|
242 | });
|
243 | }
|
244 | |
245 |
|
246 |
|
247 |
|
248 |
|
249 | getOrgEnablementStatus(includeAllProperties) {
|
250 | return __awaiter(this, void 0, void 0, function* () {
|
251 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
252 | let routeValues = {};
|
253 | let queryValues = {
|
254 | includeAllProperties: includeAllProperties,
|
255 | };
|
256 | try {
|
257 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d0c0450f-8882-46f4-a5a8-e48fea3095b0", routeValues, queryValues);
|
258 | let url = verData.requestUrl;
|
259 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
260 | let res;
|
261 | res = yield this.rest.get(url, options);
|
262 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.AdvSecEnablementSettings, false);
|
263 | resolve(ret);
|
264 | }
|
265 | catch (err) {
|
266 | reject(err);
|
267 | }
|
268 | }));
|
269 | });
|
270 | }
|
271 | |
272 |
|
273 |
|
274 |
|
275 |
|
276 | updateOrgEnablementStatus(savedAdvSecEnablementStatus) {
|
277 | return __awaiter(this, void 0, void 0, function* () {
|
278 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
279 | let routeValues = {};
|
280 | try {
|
281 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d0c0450f-8882-46f4-a5a8-e48fea3095b0", routeValues);
|
282 | let url = verData.requestUrl;
|
283 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
284 | let res;
|
285 | res = yield this.rest.update(url, savedAdvSecEnablementStatus, options);
|
286 | let ret = this.formatResponse(res.result, null, false);
|
287 | resolve(ret);
|
288 | }
|
289 | catch (err) {
|
290 | reject(err);
|
291 | }
|
292 | }));
|
293 | });
|
294 | }
|
295 | |
296 |
|
297 |
|
298 |
|
299 | getEstimatedOrgBillablePushers() {
|
300 | return __awaiter(this, void 0, void 0, function* () {
|
301 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
302 | let routeValues = {};
|
303 | try {
|
304 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "10a9e9c3-89bf-4312-92ed-139ddbcd2e28", routeValues);
|
305 | let url = verData.requestUrl;
|
306 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
307 | let res;
|
308 | res = yield this.rest.get(url, options);
|
309 | let ret = this.formatResponse(res.result, null, true);
|
310 | resolve(ret);
|
311 | }
|
312 | catch (err) {
|
313 | reject(err);
|
314 | }
|
315 | }));
|
316 | });
|
317 | }
|
318 | |
319 |
|
320 |
|
321 |
|
322 |
|
323 |
|
324 | getProjectEnablementStatus(project, includeAllProperties) {
|
325 | return __awaiter(this, void 0, void 0, function* () {
|
326 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
327 | let routeValues = {
|
328 | project: project
|
329 | };
|
330 | let queryValues = {
|
331 | includeAllProperties: includeAllProperties,
|
332 | };
|
333 | try {
|
334 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "6b9a4b47-5f2d-40f3-8286-b0152079074d", routeValues, queryValues);
|
335 | let url = verData.requestUrl;
|
336 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
337 | let res;
|
338 | res = yield this.rest.get(url, options);
|
339 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.AdvSecEnablementSettings, false);
|
340 | resolve(ret);
|
341 | }
|
342 | catch (err) {
|
343 | reject(err);
|
344 | }
|
345 | }));
|
346 | });
|
347 | }
|
348 | |
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 | updateProjectEnablementStatus(savedAdvSecEnablementStatus, project) {
|
355 | return __awaiter(this, void 0, void 0, function* () {
|
356 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
357 | let routeValues = {
|
358 | project: project
|
359 | };
|
360 | try {
|
361 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "6b9a4b47-5f2d-40f3-8286-b0152079074d", routeValues);
|
362 | let url = verData.requestUrl;
|
363 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
364 | let res;
|
365 | res = yield this.rest.update(url, savedAdvSecEnablementStatus, options);
|
366 | let ret = this.formatResponse(res.result, null, false);
|
367 | resolve(ret);
|
368 | }
|
369 | catch (err) {
|
370 | reject(err);
|
371 | }
|
372 | }));
|
373 | });
|
374 | }
|
375 | |
376 |
|
377 |
|
378 |
|
379 |
|
380 | getEstimatedProjectBillablePushers(project) {
|
381 | return __awaiter(this, void 0, void 0, function* () {
|
382 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
383 | let routeValues = {
|
384 | project: project
|
385 | };
|
386 | try {
|
387 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "bf09cb40-ecf4-4496-8cf7-9ec60c64fd3e", routeValues);
|
388 | let url = verData.requestUrl;
|
389 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
390 | let res;
|
391 | res = yield this.rest.get(url, options);
|
392 | let ret = this.formatResponse(res.result, null, true);
|
393 | resolve(ret);
|
394 | }
|
395 | catch (err) {
|
396 | reject(err);
|
397 | }
|
398 | }));
|
399 | });
|
400 | }
|
401 | |
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 | getRepoEnablementStatus(project, repository, includeAllProperties) {
|
409 | return __awaiter(this, void 0, void 0, function* () {
|
410 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
411 | let routeValues = {
|
412 | project: project,
|
413 | repository: repository
|
414 | };
|
415 | let queryValues = {
|
416 | includeAllProperties: includeAllProperties,
|
417 | };
|
418 | try {
|
419 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d11a1c2b-b904-43dc-b970-bf42486262db", routeValues, queryValues);
|
420 | let url = verData.requestUrl;
|
421 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
422 | let res;
|
423 | res = yield this.rest.get(url, options);
|
424 | let ret = this.formatResponse(res.result, ManagementInterfaces.TypeInfo.AdvSecEnablementStatus, false);
|
425 | resolve(ret);
|
426 | }
|
427 | catch (err) {
|
428 | reject(err);
|
429 | }
|
430 | }));
|
431 | });
|
432 | }
|
433 | |
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 | updateRepoAdvSecEnablementStatus(savedAdvSecEnablementStatus, project, repository) {
|
441 | return __awaiter(this, void 0, void 0, function* () {
|
442 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
443 | let routeValues = {
|
444 | project: project,
|
445 | repository: repository
|
446 | };
|
447 | try {
|
448 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "d11a1c2b-b904-43dc-b970-bf42486262db", routeValues);
|
449 | let url = verData.requestUrl;
|
450 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
451 | let res;
|
452 | res = yield this.rest.update(url, savedAdvSecEnablementStatus, options);
|
453 | let ret = this.formatResponse(res.result, null, false);
|
454 | resolve(ret);
|
455 | }
|
456 | catch (err) {
|
457 | reject(err);
|
458 | }
|
459 | }));
|
460 | });
|
461 | }
|
462 | |
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 | getEstimatedRepoBillableCommitters(project, repository) {
|
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 | project: project,
|
473 | repository: repository
|
474 | };
|
475 | try {
|
476 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "Management", "b60f1ebf-ae77-4557-bd7f-ae3d5598dd1f", routeValues);
|
477 | let url = verData.requestUrl;
|
478 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
479 | let res;
|
480 | res = yield this.rest.get(url, options);
|
481 | let ret = this.formatResponse(res.result, null, true);
|
482 | resolve(ret);
|
483 | }
|
484 | catch (err) {
|
485 | reject(err);
|
486 | }
|
487 | }));
|
488 | });
|
489 | }
|
490 | }
|
491 | exports.ManagementApi = ManagementApi;
|