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.NotificationApi = void 0;
|
22 | const basem = require("./ClientApiBases");
|
23 | const NotificationInterfaces = require("./interfaces/NotificationInterfaces");
|
24 | const VSSInterfaces = require("./interfaces/common/VSSInterfaces");
|
25 | class NotificationApi extends basem.ClientApiBase {
|
26 | constructor(baseUrl, handlers, options) {
|
27 | super(baseUrl, handlers, 'node-Notification-api', options);
|
28 | }
|
29 | |
30 |
|
31 |
|
32 | performBatchNotificationOperations(operation) {
|
33 | return __awaiter(this, void 0, void 0, function* () {
|
34 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
35 | let routeValues = {};
|
36 | try {
|
37 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "8f3c6ab2-5bae-4537-b16e-f84e0955599e", routeValues);
|
38 | let url = verData.requestUrl;
|
39 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
40 | let res;
|
41 | res = yield this.rest.create(url, operation, options);
|
42 | let ret = this.formatResponse(res.result, null, false);
|
43 | resolve(ret);
|
44 | }
|
45 | catch (err) {
|
46 | reject(err);
|
47 | }
|
48 | }));
|
49 | });
|
50 | }
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | listLogs(source, entryId, startTime, endTime) {
|
60 | return __awaiter(this, void 0, void 0, function* () {
|
61 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
62 | let routeValues = {
|
63 | source: source,
|
64 | entryId: entryId
|
65 | };
|
66 | let queryValues = {
|
67 | startTime: startTime,
|
68 | endTime: endTime,
|
69 | };
|
70 | try {
|
71 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "991842f3-eb16-4aea-ac81-81353ef2b75c", routeValues, queryValues);
|
72 | let url = verData.requestUrl;
|
73 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
74 | let res;
|
75 | res = yield this.rest.get(url, options);
|
76 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.INotificationDiagnosticLog, true);
|
77 | resolve(ret);
|
78 | }
|
79 | catch (err) {
|
80 | reject(err);
|
81 | }
|
82 | }));
|
83 | });
|
84 | }
|
85 | |
86 |
|
87 |
|
88 |
|
89 |
|
90 | getSubscriptionDiagnostics(subscriptionId) {
|
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 | subscriptionId: subscriptionId
|
95 | };
|
96 | try {
|
97 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "20f1929d-4be7-4c2e-a74e-d47640ff3418", 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, NotificationInterfaces.TypeInfo.SubscriptionDiagnostics, false);
|
103 | resolve(ret);
|
104 | }
|
105 | catch (err) {
|
106 | reject(err);
|
107 | }
|
108 | }));
|
109 | });
|
110 | }
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 | updateSubscriptionDiagnostics(updateParameters, subscriptionId) {
|
118 | return __awaiter(this, void 0, void 0, function* () {
|
119 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
120 | let routeValues = {
|
121 | subscriptionId: subscriptionId
|
122 | };
|
123 | try {
|
124 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "20f1929d-4be7-4c2e-a74e-d47640ff3418", routeValues);
|
125 | let url = verData.requestUrl;
|
126 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
127 | let res;
|
128 | res = yield this.rest.replace(url, updateParameters, options);
|
129 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.SubscriptionDiagnostics, false);
|
130 | resolve(ret);
|
131 | }
|
132 | catch (err) {
|
133 | reject(err);
|
134 | }
|
135 | }));
|
136 | });
|
137 | }
|
138 | |
139 |
|
140 |
|
141 |
|
142 |
|
143 | publishEvent(notificationEvent) {
|
144 | return __awaiter(this, void 0, void 0, function* () {
|
145 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
146 | let routeValues = {};
|
147 | try {
|
148 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "14c57b7a-c0e6-4555-9f51-e067188fdd8e", routeValues);
|
149 | let url = verData.requestUrl;
|
150 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
151 | let res;
|
152 | res = yield this.rest.create(url, notificationEvent, options);
|
153 | let ret = this.formatResponse(res.result, VSSInterfaces.TypeInfo.VssNotificationEvent, false);
|
154 | resolve(ret);
|
155 | }
|
156 | catch (err) {
|
157 | reject(err);
|
158 | }
|
159 | }));
|
160 | });
|
161 | }
|
162 | |
163 |
|
164 |
|
165 |
|
166 |
|
167 | transformEvent(transformRequest) {
|
168 | return __awaiter(this, void 0, void 0, function* () {
|
169 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
170 | let routeValues = {};
|
171 | try {
|
172 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "9463a800-1b44-450e-9083-f948ea174b45", routeValues);
|
173 | let url = verData.requestUrl;
|
174 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
175 | let res;
|
176 | res = yield this.rest.create(url, transformRequest, options);
|
177 | let ret = this.formatResponse(res.result, null, false);
|
178 | resolve(ret);
|
179 | }
|
180 | catch (err) {
|
181 | reject(err);
|
182 | }
|
183 | }));
|
184 | });
|
185 | }
|
186 | |
187 |
|
188 |
|
189 |
|
190 | queryEventTypes(inputValuesQuery, eventType) {
|
191 | return __awaiter(this, void 0, void 0, function* () {
|
192 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
193 | let routeValues = {
|
194 | eventType: eventType
|
195 | };
|
196 | try {
|
197 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "b5bbdd21-c178-4398-b6db-0166d910028a", routeValues);
|
198 | let url = verData.requestUrl;
|
199 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
200 | let res;
|
201 | res = yield this.rest.create(url, inputValuesQuery, options);
|
202 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventField, true);
|
203 | resolve(ret);
|
204 | }
|
205 | catch (err) {
|
206 | reject(err);
|
207 | }
|
208 | }));
|
209 | });
|
210 | }
|
211 | |
212 |
|
213 |
|
214 |
|
215 |
|
216 | getEventType(eventType) {
|
217 | return __awaiter(this, void 0, void 0, function* () {
|
218 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
219 | let routeValues = {
|
220 | eventType: eventType
|
221 | };
|
222 | try {
|
223 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21", routeValues);
|
224 | let url = verData.requestUrl;
|
225 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
226 | let res;
|
227 | res = yield this.rest.get(url, options);
|
228 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventType, false);
|
229 | resolve(ret);
|
230 | }
|
231 | catch (err) {
|
232 | reject(err);
|
233 | }
|
234 | }));
|
235 | });
|
236 | }
|
237 | |
238 |
|
239 |
|
240 |
|
241 |
|
242 | listEventTypes(publisherId) {
|
243 | return __awaiter(this, void 0, void 0, function* () {
|
244 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
245 | let routeValues = {};
|
246 | let queryValues = {
|
247 | publisherId: publisherId,
|
248 | };
|
249 | try {
|
250 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21", routeValues, queryValues);
|
251 | let url = verData.requestUrl;
|
252 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
253 | let res;
|
254 | res = yield this.rest.get(url, options);
|
255 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationEventType, true);
|
256 | resolve(ret);
|
257 | }
|
258 | catch (err) {
|
259 | reject(err);
|
260 | }
|
261 | }));
|
262 | });
|
263 | }
|
264 | |
265 |
|
266 |
|
267 | getNotificationReasons(notificationId) {
|
268 | return __awaiter(this, void 0, void 0, function* () {
|
269 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
270 | let routeValues = {
|
271 | notificationId: notificationId
|
272 | };
|
273 | try {
|
274 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "19824fa9-1c76-40e6-9cce-cf0b9ca1cb60", routeValues);
|
275 | let url = verData.requestUrl;
|
276 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
277 | let res;
|
278 | res = yield this.rest.get(url, options);
|
279 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationReason, false);
|
280 | resolve(ret);
|
281 | }
|
282 | catch (err) {
|
283 | reject(err);
|
284 | }
|
285 | }));
|
286 | });
|
287 | }
|
288 | |
289 |
|
290 |
|
291 | listNotificationReasons(notificationIds) {
|
292 | return __awaiter(this, void 0, void 0, function* () {
|
293 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
294 | let routeValues = {};
|
295 | let queryValues = {
|
296 | notificationIds: notificationIds,
|
297 | };
|
298 | try {
|
299 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "19824fa9-1c76-40e6-9cce-cf0b9ca1cb60", routeValues, queryValues);
|
300 | let url = verData.requestUrl;
|
301 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
302 | let res;
|
303 | res = yield this.rest.get(url, options);
|
304 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationReason, true);
|
305 | resolve(ret);
|
306 | }
|
307 | catch (err) {
|
308 | reject(err);
|
309 | }
|
310 | }));
|
311 | });
|
312 | }
|
313 | |
314 |
|
315 | getSettings() {
|
316 | return __awaiter(this, void 0, void 0, function* () {
|
317 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
318 | let routeValues = {};
|
319 | try {
|
320 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cbe076d8-2803-45ff-8d8d-44653686ea2a", routeValues);
|
321 | let url = verData.requestUrl;
|
322 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
323 | let res;
|
324 | res = yield this.rest.get(url, options);
|
325 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationAdminSettings, false);
|
326 | resolve(ret);
|
327 | }
|
328 | catch (err) {
|
329 | reject(err);
|
330 | }
|
331 | }));
|
332 | });
|
333 | }
|
334 | |
335 |
|
336 |
|
337 | updateSettings(updateParameters) {
|
338 | return __awaiter(this, void 0, void 0, function* () {
|
339 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
340 | let routeValues = {};
|
341 | try {
|
342 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "cbe076d8-2803-45ff-8d8d-44653686ea2a", routeValues);
|
343 | let url = verData.requestUrl;
|
344 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
345 | let res;
|
346 | res = yield this.rest.update(url, updateParameters, options);
|
347 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationAdminSettings, false);
|
348 | resolve(ret);
|
349 | }
|
350 | catch (err) {
|
351 | reject(err);
|
352 | }
|
353 | }));
|
354 | });
|
355 | }
|
356 | |
357 |
|
358 |
|
359 |
|
360 |
|
361 | getSubscriber(subscriberId) {
|
362 | return __awaiter(this, void 0, void 0, function* () {
|
363 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
364 | let routeValues = {
|
365 | subscriberId: subscriberId
|
366 | };
|
367 | try {
|
368 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "4d5caff1-25ba-430b-b808-7a1f352cc197", routeValues);
|
369 | let url = verData.requestUrl;
|
370 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
371 | let res;
|
372 | res = yield this.rest.get(url, options);
|
373 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriber, false);
|
374 | resolve(ret);
|
375 | }
|
376 | catch (err) {
|
377 | reject(err);
|
378 | }
|
379 | }));
|
380 | });
|
381 | }
|
382 | |
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 | updateSubscriber(updateParameters, subscriberId) {
|
389 | return __awaiter(this, void 0, void 0, function* () {
|
390 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
391 | let routeValues = {
|
392 | subscriberId: subscriberId
|
393 | };
|
394 | try {
|
395 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "4d5caff1-25ba-430b-b808-7a1f352cc197", routeValues);
|
396 | let url = verData.requestUrl;
|
397 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
398 | let res;
|
399 | res = yield this.rest.update(url, updateParameters, options);
|
400 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriber, false);
|
401 | resolve(ret);
|
402 | }
|
403 | catch (err) {
|
404 | reject(err);
|
405 | }
|
406 | }));
|
407 | });
|
408 | }
|
409 | |
410 |
|
411 |
|
412 |
|
413 |
|
414 | querySubscriptions(subscriptionQuery) {
|
415 | return __awaiter(this, void 0, void 0, function* () {
|
416 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
417 | let routeValues = {};
|
418 | try {
|
419 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "6864db85-08c0-4006-8e8e-cc1bebe31675", routeValues);
|
420 | let url = verData.requestUrl;
|
421 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
422 | let res;
|
423 | res = yield this.rest.create(url, subscriptionQuery, options);
|
424 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, true);
|
425 | resolve(ret);
|
426 | }
|
427 | catch (err) {
|
428 | reject(err);
|
429 | }
|
430 | }));
|
431 | });
|
432 | }
|
433 | |
434 |
|
435 |
|
436 |
|
437 |
|
438 | createSubscription(createParameters) {
|
439 | return __awaiter(this, void 0, void 0, function* () {
|
440 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
441 | let routeValues = {};
|
442 | try {
|
443 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues);
|
444 | let url = verData.requestUrl;
|
445 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
446 | let res;
|
447 | res = yield this.rest.create(url, createParameters, options);
|
448 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false);
|
449 | resolve(ret);
|
450 | }
|
451 | catch (err) {
|
452 | reject(err);
|
453 | }
|
454 | }));
|
455 | });
|
456 | }
|
457 | |
458 |
|
459 |
|
460 |
|
461 |
|
462 | deleteSubscription(subscriptionId) {
|
463 | return __awaiter(this, void 0, void 0, function* () {
|
464 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
465 | let routeValues = {
|
466 | subscriptionId: subscriptionId
|
467 | };
|
468 | try {
|
469 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues);
|
470 | let url = verData.requestUrl;
|
471 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
472 | let res;
|
473 | res = yield this.rest.del(url, options);
|
474 | let ret = this.formatResponse(res.result, null, false);
|
475 | resolve(ret);
|
476 | }
|
477 | catch (err) {
|
478 | reject(err);
|
479 | }
|
480 | }));
|
481 | });
|
482 | }
|
483 | |
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 | getSubscription(subscriptionId, queryFlags) {
|
490 | return __awaiter(this, void 0, void 0, function* () {
|
491 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
492 | let routeValues = {
|
493 | subscriptionId: subscriptionId
|
494 | };
|
495 | let queryValues = {
|
496 | queryFlags: queryFlags,
|
497 | };
|
498 | try {
|
499 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues, queryValues);
|
500 | let url = verData.requestUrl;
|
501 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
502 | let res;
|
503 | res = yield this.rest.get(url, options);
|
504 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false);
|
505 | resolve(ret);
|
506 | }
|
507 | catch (err) {
|
508 | reject(err);
|
509 | }
|
510 | }));
|
511 | });
|
512 | }
|
513 | |
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 | listSubscriptions(targetId, ids, queryFlags) {
|
521 | return __awaiter(this, void 0, void 0, function* () {
|
522 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
523 | let routeValues = {};
|
524 | let queryValues = {
|
525 | targetId: targetId,
|
526 | ids: ids && ids.join(","),
|
527 | queryFlags: queryFlags,
|
528 | };
|
529 | try {
|
530 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues, queryValues);
|
531 | let url = verData.requestUrl;
|
532 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
533 | let res;
|
534 | res = yield this.rest.get(url, options);
|
535 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, true);
|
536 | resolve(ret);
|
537 | }
|
538 | catch (err) {
|
539 | reject(err);
|
540 | }
|
541 | }));
|
542 | });
|
543 | }
|
544 | |
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 | updateSubscription(updateParameters, subscriptionId) {
|
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 | subscriptionId: subscriptionId
|
555 | };
|
556 | try {
|
557 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "70f911d6-abac-488c-85b3-a206bf57e165", routeValues);
|
558 | let url = verData.requestUrl;
|
559 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
560 | let res;
|
561 | res = yield this.rest.update(url, updateParameters, options);
|
562 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscription, false);
|
563 | resolve(ret);
|
564 | }
|
565 | catch (err) {
|
566 | reject(err);
|
567 | }
|
568 | }));
|
569 | });
|
570 | }
|
571 | |
572 |
|
573 |
|
574 |
|
575 | getSubscriptionTemplates() {
|
576 | return __awaiter(this, void 0, void 0, function* () {
|
577 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
578 | let routeValues = {};
|
579 | try {
|
580 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "fa5d24ba-7484-4f3d-888d-4ec6b1974082", routeValues);
|
581 | let url = verData.requestUrl;
|
582 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
583 | let res;
|
584 | res = yield this.rest.get(url, options);
|
585 | let ret = this.formatResponse(res.result, NotificationInterfaces.TypeInfo.NotificationSubscriptionTemplate, true);
|
586 | resolve(ret);
|
587 | }
|
588 | catch (err) {
|
589 | reject(err);
|
590 | }
|
591 | }));
|
592 | });
|
593 | }
|
594 | |
595 |
|
596 |
|
597 |
|
598 |
|
599 | publishTokenEvent(notificationEvent) {
|
600 | return __awaiter(this, void 0, void 0, function* () {
|
601 | return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
602 | let routeValues = {};
|
603 | try {
|
604 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "31dc86a2-67e8-4452-99a4-2b301ba28291", routeValues);
|
605 | let url = verData.requestUrl;
|
606 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
607 | let res;
|
608 | res = yield this.rest.create(url, notificationEvent, options);
|
609 | let ret = this.formatResponse(res.result, VSSInterfaces.TypeInfo.VssNotificationEvent, false);
|
610 | resolve(ret);
|
611 | }
|
612 | catch (err) {
|
613 | reject(err);
|
614 | }
|
615 | }));
|
616 | });
|
617 | }
|
618 | |
619 |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 |
|
625 | updateSubscriptionUserSettings(userSettings, subscriptionId, userId) {
|
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 | subscriptionId: subscriptionId,
|
630 | userId: userId
|
631 | };
|
632 | try {
|
633 | let verData = yield this.vsoClient.getVersioningData("7.2-preview.1", "notification", "ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e", routeValues);
|
634 | let url = verData.requestUrl;
|
635 | let options = this.createRequestOptions('application/json', verData.apiVersion);
|
636 | let res;
|
637 | res = yield this.rest.replace(url, userSettings, options);
|
638 | let ret = this.formatResponse(res.result, null, false);
|
639 | resolve(ret);
|
640 | }
|
641 | catch (err) {
|
642 | reject(err);
|
643 | }
|
644 | }));
|
645 | });
|
646 | }
|
647 | }
|
648 | exports.NotificationApi = NotificationApi;
|