@lindle/sharepoint_requests 0.1.9-beta.0 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -136,88 +136,6 @@ function _regeneratorDefine(e, r, n, t) {
136
136
  }, _regeneratorDefine(e, r, n, t);
137
137
  }
138
138
 
139
- var get = /*#__PURE__*/function () {
140
- var _ref2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref, options) {
141
- var instance, endpoint, _ref3, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
142
- return _regenerator().w(function (_context) {
143
- while (1) switch (_context.n) {
144
- case 0:
145
- instance = _ref.instance, endpoint = _ref.endpoint;
146
- _ref3 = options || {}, expand = _ref3.expand, orderBy = _ref3.orderBy, limit = _ref3.limit, filter = _ref3.filter, cols = _ref3.cols, skip = _ref3.skip;
147
- params = {
148
- $expand: Array.isArray(expand) ? expand.join(',') : expand,
149
- $top: limit,
150
- $skip: skip,
151
- $select: Array.isArray(cols) ? cols.join(',') : cols,
152
- $filter: filter,
153
- $orderby: Array.isArray(orderBy) ? orderBy.join(' ') : orderBy
154
- };
155
- url = new URL(endpoint, instance.defaults.baseURL);
156
- Object.entries(params).forEach(function (_ref4) {
157
- var key = _ref4[0],
158
- value = _ref4[1];
159
- if (value !== undefined && value !== null) {
160
- url.searchParams.append(key, String(value));
161
- }
162
- });
163
- _context.n = 1;
164
- return instance.request({
165
- url: endpoint,
166
- method: 'GET',
167
- params: params
168
- });
169
- case 1:
170
- response = _context.v;
171
- data = limit || !response.data.d.results ? response.data.d : response.data.d.results;
172
- meta = {
173
- url: url
174
- };
175
- return _context.a(2, {
176
- data: data,
177
- meta: meta
178
- });
179
- }
180
- }, _callee);
181
- }));
182
- return function get(_x, _x2) {
183
- return _ref2.apply(this, arguments);
184
- };
185
- }();
186
-
187
- var getDigest = /*#__PURE__*/function () {
188
- var _ref2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref) {
189
- var instance, baseURL, _response$data, response, _t;
190
- return _regenerator().w(function (_context) {
191
- while (1) switch (_context.p = _context.n) {
192
- case 0:
193
- instance = _ref.instance, baseURL = _ref.baseURL;
194
- _context.p = 1;
195
- _context.n = 2;
196
- return instance.post(baseURL + "_api/contextinfo");
197
- case 2:
198
- response = _context.v;
199
- if ((_response$data = response.data) != null && (_response$data = _response$data.d) != null && (_response$data = _response$data.GetContextWebInformation) != null && _response$data.FormDigestValue) {
200
- _context.n = 3;
201
- break;
202
- }
203
- throw new Error('Invalid response structure: Missing FormDigestValue');
204
- case 3:
205
- return _context.a(2, response.data.d.GetContextWebInformation.FormDigestValue);
206
- case 4:
207
- _context.p = 4;
208
- _t = _context.v;
209
- console.error('Failed to retrieve the Form Digest Value:', _t);
210
- throw new Error("Error retrieving Form Digest Value");
211
- case 5:
212
- return _context.a(2);
213
- }
214
- }, _callee, null, [[1, 4]]);
215
- }));
216
- return function getDigest(_x) {
217
- return _ref2.apply(this, arguments);
218
- };
219
- }();
220
-
221
139
  var HTTPSharePointRequests = /*#__PURE__*/function () {
222
140
  function HTTPSharePointRequests(baseURL) {
223
141
  var _this = this;
@@ -233,32 +151,6 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
233
151
  _this.get_v2();
234
152
  }
235
153
  };
236
- // public users(options?: Options<any>) {
237
- // this.endpoint = '_api/web/SiteUserInfoList/items';
238
- // return {
239
- // get: () => this.get_v2(options),
240
- // };
241
- // }
242
- this.users = {
243
- get: function () {
244
- var _get = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(options) {
245
- return _regenerator().w(function (_context) {
246
- while (1) switch (_context.n) {
247
- case 0:
248
- _this.endpoint = '_api/web/SiteUserInfoList/items';
249
- _context.n = 1;
250
- return _this.get_v2(options);
251
- case 1:
252
- return _context.a(2, _context.v);
253
- }
254
- }, _callee);
255
- }));
256
- function get(_x) {
257
- return _get.apply(this, arguments);
258
- }
259
- return get;
260
- }()
261
- };
262
154
  this.email = {
263
155
  /**
264
156
  * Sends an email using SharePoint's Utility.SendEmail API.
@@ -406,6 +298,15 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
406
298
  return _this3.get_files(options);
407
299
  }
408
300
  };
301
+ };
302
+ _proto.users = function users(options) {
303
+ var _this4 = this;
304
+ this.endpoint = '_api/web/SiteUserInfoList/items';
305
+ return {
306
+ get: function get() {
307
+ return _this4.get_v2(options);
308
+ }
309
+ };
409
310
  }
410
311
  /**
411
312
  * Asynchronously retrieves the Form Digest Value from the context information API.
@@ -416,32 +317,43 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
416
317
  _proto.getDigest =
417
318
  /*#__PURE__*/
418
319
  function () {
419
- var _getDigest2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
420
- var value;
421
- return _regenerator().w(function (_context2) {
422
- while (1) switch (_context2.n) {
320
+ var _getDigest = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
321
+ var _response$data, response, _t;
322
+ return _regenerator().w(function (_context) {
323
+ while (1) switch (_context.p = _context.n) {
423
324
  case 0:
424
- _context2.n = 1;
425
- return getDigest({
426
- instance: this.instance,
427
- baseURL: this.baseURL
428
- });
325
+ _context.p = 0;
326
+ _context.n = 1;
327
+ return this.instance.post(this.baseURL + "_api/contextinfo");
429
328
  case 1:
430
- value = _context2.v;
431
- return _context2.a(2, value);
329
+ response = _context.v;
330
+ if ((_response$data = response.data) != null && (_response$data = _response$data.d) != null && (_response$data = _response$data.GetContextWebInformation) != null && _response$data.FormDigestValue) {
331
+ _context.n = 2;
332
+ break;
333
+ }
334
+ throw new Error('Invalid response structure: Missing FormDigestValue');
335
+ case 2:
336
+ return _context.a(2, response.data.d.GetContextWebInformation.FormDigestValue);
337
+ case 3:
338
+ _context.p = 3;
339
+ _t = _context.v;
340
+ console.error('Failed to retrieve the Form Digest Value:', _t);
341
+ throw new Error("Error retrieving Form Digest Value");
342
+ case 4:
343
+ return _context.a(2);
432
344
  }
433
- }, _callee2, this);
345
+ }, _callee, this, [[0, 3]]);
434
346
  }));
435
- function getDigest$1() {
436
- return _getDigest2.apply(this, arguments);
347
+ function getDigest() {
348
+ return _getDigest.apply(this, arguments);
437
349
  }
438
- return getDigest$1;
350
+ return getDigest;
439
351
  }();
440
352
  _proto.get_only = /*#__PURE__*/function () {
441
- var _get_only = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
353
+ var _get_only = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
442
354
  var _ref, expand, orderBy, limit, filter, cols, skip, params, _yield$this$instance$, data;
443
- return _regenerator().w(function (_context3) {
444
- while (1) switch (_context3.n) {
355
+ return _regenerator().w(function (_context2) {
356
+ while (1) switch (_context2.n) {
445
357
  case 0:
446
358
  _ref = options || {}, expand = _ref.expand, orderBy = _ref.orderBy, limit = _ref.limit, filter = _ref.filter, cols = _ref.cols, skip = _ref.skip;
447
359
  params = {
@@ -452,33 +364,33 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
452
364
  $filter: filter,
453
365
  $orderby: Array.isArray(orderBy) ? orderBy.join(',') : orderBy
454
366
  };
455
- _context3.n = 1;
367
+ _context2.n = 1;
456
368
  return this.instance.get(this.endpoint, {
457
369
  params: params
458
370
  });
459
371
  case 1:
460
- _yield$this$instance$ = _context3.v;
372
+ _yield$this$instance$ = _context2.v;
461
373
  data = _yield$this$instance$.data;
462
374
  if (!data) {
463
- _context3.n = 2;
375
+ _context2.n = 2;
464
376
  break;
465
377
  }
466
- return _context3.a(2, data.d.results ? data.d.results : data.d);
378
+ return _context2.a(2, data.d.results ? data.d.results : data.d);
467
379
  case 2:
468
- return _context3.a(2);
380
+ return _context2.a(2);
469
381
  }
470
- }, _callee3, this);
382
+ }, _callee2, this);
471
383
  }));
472
- function get_only(_x2) {
384
+ function get_only(_x) {
473
385
  return _get_only.apply(this, arguments);
474
386
  }
475
387
  return get_only;
476
388
  }();
477
389
  _proto.get_files = /*#__PURE__*/function () {
478
- var _get_files = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(options) {
390
+ var _get_files = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
479
391
  var _ref2, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
480
- return _regenerator().w(function (_context4) {
481
- while (1) switch (_context4.n) {
392
+ return _regenerator().w(function (_context3) {
393
+ while (1) switch (_context3.n) {
482
394
  case 0:
483
395
  _ref2 = options || {}, expand = _ref2.expand, orderBy = _ref2.orderBy, limit = _ref2.limit, filter = _ref2.filter, cols = _ref2.cols, skip = _ref2.skip;
484
396
  params = {
@@ -497,79 +409,99 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
497
409
  url.searchParams.append(key, String(value));
498
410
  }
499
411
  });
500
- _context4.n = 1;
412
+ _context3.n = 1;
501
413
  return this.instance.request({
502
414
  url: this.endpoint,
503
415
  method: 'GET',
504
416
  params: params
505
417
  });
506
418
  case 1:
507
- response = _context4.v;
419
+ response = _context3.v;
508
420
  data = limit || !response.data.d.results ? response.data.d : response.data.d.results;
509
421
  meta = {
510
422
  url: url
511
423
  };
512
- return _context4.a(2, {
424
+ return _context3.a(2, {
513
425
  data: data,
514
426
  meta: meta
515
427
  });
516
428
  }
517
- }, _callee4, this);
429
+ }, _callee3, this);
518
430
  }));
519
- function get_files(_x3) {
431
+ function get_files(_x2) {
520
432
  return _get_files.apply(this, arguments);
521
433
  }
522
434
  return get_files;
523
435
  }();
524
436
  _proto.get_v2 = /*#__PURE__*/function () {
525
- var _get_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(options) {
526
- var _yield$get, data, meta;
527
- return _regenerator().w(function (_context5) {
528
- while (1) switch (_context5.n) {
437
+ var _get_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(options) {
438
+ var _ref4, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
439
+ return _regenerator().w(function (_context4) {
440
+ while (1) switch (_context4.n) {
529
441
  case 0:
530
- _context5.n = 1;
531
- return get({
532
- instance: this.instance,
533
- endpoint: this.endpoint
534
- }, options);
442
+ _ref4 = options || {}, expand = _ref4.expand, orderBy = _ref4.orderBy, limit = _ref4.limit, filter = _ref4.filter, cols = _ref4.cols, skip = _ref4.skip;
443
+ params = {
444
+ $expand: Array.isArray(expand) ? expand.join(',') : expand,
445
+ $top: limit,
446
+ $skip: skip,
447
+ $select: Array.isArray(cols) ? cols.join(',') : cols,
448
+ $filter: filter,
449
+ $orderby: Array.isArray(orderBy) ? orderBy.join(' ') : orderBy
450
+ };
451
+ url = new URL(this.endpoint, this.instance.defaults.baseURL);
452
+ Object.entries(params).forEach(function (_ref5) {
453
+ var key = _ref5[0],
454
+ value = _ref5[1];
455
+ if (value !== undefined && value !== null) {
456
+ url.searchParams.append(key, String(value));
457
+ }
458
+ });
459
+ _context4.n = 1;
460
+ return this.instance.request({
461
+ url: this.endpoint,
462
+ method: 'GET',
463
+ params: params
464
+ });
535
465
  case 1:
536
- _yield$get = _context5.v;
537
- data = _yield$get.data;
538
- meta = _yield$get.meta;
539
- return _context5.a(2, {
466
+ response = _context4.v;
467
+ data = limit || !response.data.d.results ? response.data.d : response.data.d.results;
468
+ meta = {
469
+ url: url
470
+ };
471
+ return _context4.a(2, {
540
472
  data: data,
541
473
  meta: meta
542
474
  });
543
475
  }
544
- }, _callee5, this);
476
+ }, _callee4, this);
545
477
  }));
546
- function get_v2(_x4) {
478
+ function get_v2(_x3) {
547
479
  return _get_v.apply(this, arguments);
548
480
  }
549
481
  return get_v2;
550
482
  }();
551
483
  _proto.update_2 = /*#__PURE__*/function () {
552
- var _update_ = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(id, data, digest) {
553
- var formDigestValue, url, response, _t;
554
- return _regenerator().w(function (_context6) {
555
- while (1) switch (_context6.n) {
484
+ var _update_ = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(id, data, digest) {
485
+ var formDigestValue, url, response, _t2;
486
+ return _regenerator().w(function (_context5) {
487
+ while (1) switch (_context5.n) {
556
488
  case 0:
557
- _t = digest;
558
- if (_t) {
559
- _context6.n = 2;
489
+ _t2 = digest;
490
+ if (_t2) {
491
+ _context5.n = 2;
560
492
  break;
561
493
  }
562
- _context6.n = 1;
494
+ _context5.n = 1;
563
495
  return this.getDigest();
564
496
  case 1:
565
- _t = _context6.v;
497
+ _t2 = _context5.v;
566
498
  case 2:
567
- formDigestValue = _t;
499
+ formDigestValue = _t2;
568
500
  data.__metadata = {
569
501
  type: "SP.Data." + this.listName + "ListItem"
570
502
  };
571
503
  url = "_api/lists/getbytitle('" + this.listName + "')/getItemById('" + id + "')";
572
- _context6.n = 3;
504
+ _context5.n = 3;
573
505
  return this.instance({
574
506
  url: url,
575
507
  method: 'POST',
@@ -581,130 +513,130 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
581
513
  }
582
514
  });
583
515
  case 3:
584
- response = _context6.v;
585
- return _context6.a(2, response);
516
+ response = _context5.v;
517
+ return _context5.a(2, response);
586
518
  }
587
- }, _callee6, this);
519
+ }, _callee5, this);
588
520
  }));
589
- function update_2(_x5, _x6, _x7) {
521
+ function update_2(_x4, _x5, _x6) {
590
522
  return _update_.apply(this, arguments);
591
523
  }
592
524
  return update_2;
593
525
  }();
594
526
  _proto.create_v2 = /*#__PURE__*/function () {
595
- var _create_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(listData) {
596
- var response, _t2, _t3, _t4, _t5, _t6, _t7;
597
- return _regenerator().w(function (_context7) {
598
- while (1) switch (_context7.n) {
527
+ var _create_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(listData) {
528
+ var response, _t3, _t4, _t5, _t6, _t7, _t8;
529
+ return _regenerator().w(function (_context6) {
530
+ while (1) switch (_context6.n) {
599
531
  case 0:
600
532
  this.transformArraysToEdmStrings(listData);
601
533
  listData.__metadata = {
602
534
  type: "SP.Data." + this.listName + "ListItem"
603
535
  };
604
- _t2 = this;
605
- _t3 = this.endpoint;
606
- _t4 = JSON.stringify(listData);
607
- _context7.n = 1;
536
+ _t3 = this;
537
+ _t4 = this.endpoint;
538
+ _t5 = JSON.stringify(listData);
539
+ _context6.n = 1;
608
540
  return this.getDigest();
609
541
  case 1:
610
- _t5 = _context7.v;
611
- _t6 = {
612
- 'X-RequestDigest': _t5,
542
+ _t6 = _context6.v;
543
+ _t7 = {
544
+ 'X-RequestDigest': _t6,
613
545
  'IF-MATCH': '*'
614
546
  };
615
- _t7 = {
616
- url: _t3,
547
+ _t8 = {
548
+ url: _t4,
617
549
  method: 'POST',
618
- data: _t4,
619
- headers: _t6
550
+ data: _t5,
551
+ headers: _t7
620
552
  };
621
- _context7.n = 2;
622
- return _t2.instance.call(_t2, _t7);
553
+ _context6.n = 2;
554
+ return _t3.instance.call(_t3, _t8);
623
555
  case 2:
624
- response = _context7.v;
625
- return _context7.a(2, response);
556
+ response = _context6.v;
557
+ return _context6.a(2, response);
626
558
  }
627
- }, _callee7, this);
559
+ }, _callee6, this);
628
560
  }));
629
- function create_v2(_x8) {
561
+ function create_v2(_x7) {
630
562
  return _create_v.apply(this, arguments);
631
563
  }
632
564
  return create_v2;
633
565
  }();
634
566
  _proto.createFile = /*#__PURE__*/function () {
635
- var _createFile = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(_ref4) {
636
- var file, itemId, requestUrl, res, _t8, _t9, _t0, _t1, _t10, _t11;
637
- return _regenerator().w(function (_context8) {
638
- while (1) switch (_context8.n) {
567
+ var _createFile = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref6) {
568
+ var file, itemId, requestUrl, res, _t9, _t0, _t1, _t10, _t11, _t12;
569
+ return _regenerator().w(function (_context7) {
570
+ while (1) switch (_context7.n) {
639
571
  case 0:
640
- file = _ref4.file, itemId = _ref4.itemId;
572
+ file = _ref6.file, itemId = _ref6.itemId;
641
573
  requestUrl = "_api/lists/getbytitle('" + this.listName + "')/items(" + itemId + ")/AttachmentFiles/add(FileName='" + file.name + "')";
642
- _t8 = this.instance;
643
- _t9 = requestUrl;
644
- _t0 = file;
645
- _context8.n = 1;
574
+ _t9 = this.instance;
575
+ _t0 = requestUrl;
576
+ _t1 = file;
577
+ _context7.n = 1;
646
578
  return this.getDigest();
647
579
  case 1:
648
- _t1 = _context8.v;
649
- _t10 = {
650
- 'X-RequestDigest': _t1
651
- };
580
+ _t10 = _context7.v;
652
581
  _t11 = {
653
- headers: _t10,
582
+ 'X-RequestDigest': _t10
583
+ };
584
+ _t12 = {
585
+ headers: _t11,
654
586
  withCredentials: true
655
587
  };
656
- _context8.n = 2;
657
- return _t8.post.call(_t8, _t9, _t0, _t11);
588
+ _context7.n = 2;
589
+ return _t9.post.call(_t9, _t0, _t1, _t12);
658
590
  case 2:
659
- res = _context8.v;
660
- return _context8.a(2, res);
591
+ res = _context7.v;
592
+ return _context7.a(2, res);
661
593
  }
662
- }, _callee8, this);
594
+ }, _callee7, this);
663
595
  }));
664
- function createFile(_x9) {
596
+ function createFile(_x8) {
665
597
  return _createFile.apply(this, arguments);
666
598
  }
667
599
  return createFile;
668
600
  }();
669
601
  _proto["delete"] = /*#__PURE__*/function () {
670
- var _delete2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(ID) {
602
+ var _delete2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(ID) {
671
603
  var response;
672
- return _regenerator().w(function (_context9) {
673
- while (1) switch (_context9.n) {
604
+ return _regenerator().w(function (_context8) {
605
+ while (1) switch (_context8.n) {
674
606
  case 0:
675
- _context9.n = 1;
607
+ _context8.n = 1;
676
608
  return this.instance["delete"](this.endpoint + "(" + ID + ")");
677
609
  case 1:
678
- response = _context9.v;
679
- return _context9.a(2, response);
610
+ response = _context8.v;
611
+ return _context8.a(2, response);
680
612
  }
681
- }, _callee9, this);
613
+ }, _callee8, this);
682
614
  }));
683
- function _delete(_x0) {
615
+ function _delete(_x9) {
684
616
  return _delete2.apply(this, arguments);
685
617
  }
686
618
  return _delete;
687
619
  }();
688
620
  _proto.sendEmail = /*#__PURE__*/function () {
689
- var _sendEmail = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(_ref5) {
690
- var From, To, Subject, Body, httpRequest, response, _t12, _t13, _t14, _t15, _t16, _t17;
691
- return _regenerator().w(function (_context0) {
692
- while (1) switch (_context0.n) {
621
+ var _sendEmail = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref7) {
622
+ var From, To, Subject, Body, httpRequest, response, _t13, _t14, _t15, _t16, _t17, _t18;
623
+ return _regenerator().w(function (_context9) {
624
+ while (1) switch (_context9.n) {
693
625
  case 0:
694
- From = _ref5.From, To = _ref5.To, Subject = _ref5.Subject, Body = _ref5.Body;
626
+ From = _ref7.From, To = _ref7.To, Subject = _ref7.Subject, Body = _ref7.Body;
695
627
  httpRequest = '_api/SP.Utilities.Utility.SendEmail';
696
- _t12 = this;
697
- _t13 = httpRequest;
698
- _context0.n = 1;
628
+ _t13 = this;
629
+ _t14 = httpRequest;
630
+ _context9.n = 1;
699
631
  return this.getDigest();
700
632
  case 1:
701
- _t14 = _context0.v;
702
- _t15 = {
703
- 'X-RequestDigest': _t14,
633
+ _t15 = _context9.v;
634
+ _t16 = {
635
+ 'X-RequestDigest': _t15,
704
636
  'X-Http-Method': 'POST',
705
637
  'Content-Type': 'application/json;odata=verbose'
706
638
  };
707
- _t16 = JSON.stringify({
639
+ _t17 = JSON.stringify({
708
640
  properties: {
709
641
  __metadata: {
710
642
  type: 'SP.Utilities.EmailProperties'
@@ -717,56 +649,56 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
717
649
  Subject: Subject
718
650
  }
719
651
  });
720
- _t17 = {
721
- url: _t13,
652
+ _t18 = {
653
+ url: _t14,
722
654
  method: 'POST',
723
- headers: _t15,
724
- data: _t16
655
+ headers: _t16,
656
+ data: _t17
725
657
  };
726
- _context0.n = 2;
727
- return _t12.instance.call(_t12, _t17);
658
+ _context9.n = 2;
659
+ return _t13.instance.call(_t13, _t18);
728
660
  case 2:
729
- response = _context0.v;
730
- return _context0.a(2, response);
661
+ response = _context9.v;
662
+ return _context9.a(2, response);
731
663
  }
732
- }, _callee0, this);
664
+ }, _callee9, this);
733
665
  }));
734
- function sendEmail(_x1) {
666
+ function sendEmail(_x0) {
735
667
  return _sendEmail.apply(this, arguments);
736
668
  }
737
669
  return sendEmail;
738
670
  }();
739
671
  _proto.typeAhead = /*#__PURE__*/function () {
740
- var _typeAhead = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(input, filter) {
672
+ var _typeAhead = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(input, filter) {
741
673
  var filterValue, response;
742
- return _regenerator().w(function (_context1) {
743
- while (1) switch (_context1.n) {
674
+ return _regenerator().w(function (_context0) {
675
+ while (1) switch (_context0.n) {
744
676
  case 0:
745
677
  filterValue = filter ? " and " + filter : '';
746
- _context1.n = 1;
678
+ _context0.n = 1;
747
679
  return this.instance.get("_vti_bin/listdata.svc/UserInformationList?$top=10&$filter=substringof('" + input + "',Name) or substringof('" + input + "',WorkEmail)" + filterValue);
748
680
  case 1:
749
- response = _context1.v;
750
- return _context1.a(2, response.data.d);
681
+ response = _context0.v;
682
+ return _context0.a(2, response.data.d);
751
683
  }
752
- }, _callee1, this);
684
+ }, _callee0, this);
753
685
  }));
754
- function typeAhead(_x10, _x11) {
686
+ function typeAhead(_x1, _x10) {
755
687
  return _typeAhead.apply(this, arguments);
756
688
  }
757
689
  return typeAhead;
758
690
  }();
759
691
  _proto.currentUserProperties = /*#__PURE__*/function () {
760
- var _currentUserProperties = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
692
+ var _currentUserProperties = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
761
693
  var requestUrl, profile;
762
- return _regenerator().w(function (_context10) {
763
- while (1) switch (_context10.n) {
694
+ return _regenerator().w(function (_context1) {
695
+ while (1) switch (_context1.n) {
764
696
  case 0:
765
697
  requestUrl = '_api/sp.userprofiles.peoplemanager/getmyproperties';
766
- _context10.n = 1;
698
+ _context1.n = 1;
767
699
  return this.instance.get(requestUrl);
768
700
  case 1:
769
- profile = _context10.v;
701
+ profile = _context1.v;
770
702
  profile = profile.data.d;
771
703
  profile.UserProfileProperties.results.forEach(function (prop) {
772
704
  if (prop.Key === 'FirstName') {
@@ -782,9 +714,9 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
782
714
  profile.UserName = prop.Value;
783
715
  }
784
716
  });
785
- return _context10.a(2, profile);
717
+ return _context1.a(2, profile);
786
718
  }
787
- }, _callee10, this);
719
+ }, _callee1, this);
788
720
  }));
789
721
  function currentUserProperties() {
790
722
  return _currentUserProperties.apply(this, arguments);
@@ -792,39 +724,39 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
792
724
  return currentUserProperties;
793
725
  }();
794
726
  _proto.getSiteUser = /*#__PURE__*/function () {
795
- var _getSiteUser = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(searchValue) {
727
+ var _getSiteUser = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(searchValue) {
796
728
  var requestUrl, response;
797
- return _regenerator().w(function (_context11) {
798
- while (1) switch (_context11.n) {
729
+ return _regenerator().w(function (_context10) {
730
+ while (1) switch (_context10.n) {
799
731
  case 0:
800
732
  requestUrl = "_api/web/siteusers?&$filter=substringof('" + searchValue + "', Title) or substringof('" + searchValue + "', LoginName) or substringof('" + searchValue + "', Email)&$top=50&$expand=Groups";
801
- _context11.n = 1;
733
+ _context10.n = 1;
802
734
  return this.instance.get(requestUrl);
803
735
  case 1:
804
- response = _context11.v;
805
- return _context11.a(2, response.data.d);
736
+ response = _context10.v;
737
+ return _context10.a(2, response.data.d);
806
738
  }
807
- }, _callee11, this);
739
+ }, _callee10, this);
808
740
  }));
809
- function getSiteUser(_x12) {
741
+ function getSiteUser(_x11) {
810
742
  return _getSiteUser.apply(this, arguments);
811
743
  }
812
744
  return getSiteUser;
813
745
  }();
814
746
  _proto.roleDefinitions = /*#__PURE__*/function () {
815
- var _roleDefinitions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
747
+ var _roleDefinitions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
816
748
  var requestUrl, response;
817
- return _regenerator().w(function (_context12) {
818
- while (1) switch (_context12.n) {
749
+ return _regenerator().w(function (_context11) {
750
+ while (1) switch (_context11.n) {
819
751
  case 0:
820
752
  requestUrl = "_api/Web/RoleDefinitions";
821
- _context12.n = 1;
753
+ _context11.n = 1;
822
754
  return this.instance.get(requestUrl);
823
755
  case 1:
824
- response = _context12.v;
825
- return _context12.a(2, response.data.d.results);
756
+ response = _context11.v;
757
+ return _context11.a(2, response.data.d.results);
826
758
  }
827
- }, _callee12, this);
759
+ }, _callee11, this);
828
760
  }));
829
761
  function roleDefinitions() {
830
762
  return _roleDefinitions.apply(this, arguments);
@@ -832,19 +764,19 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
832
764
  return roleDefinitions;
833
765
  }();
834
766
  _proto.getEffectiveBasePermissions = /*#__PURE__*/function () {
835
- var _getEffectiveBasePermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
767
+ var _getEffectiveBasePermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
836
768
  var requestUrl, response;
837
- return _regenerator().w(function (_context13) {
838
- while (1) switch (_context13.n) {
769
+ return _regenerator().w(function (_context12) {
770
+ while (1) switch (_context12.n) {
839
771
  case 0:
840
772
  requestUrl = "_api/Web/effectiveBasePermissions";
841
- _context13.n = 1;
773
+ _context12.n = 1;
842
774
  return this.instance.get(requestUrl);
843
775
  case 1:
844
- response = _context13.v;
845
- return _context13.a(2, response.data.d.EffectiveBasePermissions);
776
+ response = _context12.v;
777
+ return _context12.a(2, response.data.d.EffectiveBasePermissions);
846
778
  }
847
- }, _callee13, this);
779
+ }, _callee12, this);
848
780
  }));
849
781
  function getEffectiveBasePermissions() {
850
782
  return _getEffectiveBasePermissions.apply(this, arguments);
@@ -852,27 +784,27 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
852
784
  return getEffectiveBasePermissions;
853
785
  }();
854
786
  _proto.currentUserPermissions = /*#__PURE__*/function () {
855
- var _currentUserPermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14() {
787
+ var _currentUserPermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
856
788
  var _yield$this$getEffect, High, roleDefinitions, result;
857
- return _regenerator().w(function (_context14) {
858
- while (1) switch (_context14.n) {
789
+ return _regenerator().w(function (_context13) {
790
+ while (1) switch (_context13.n) {
859
791
  case 0:
860
- _context14.n = 1;
792
+ _context13.n = 1;
861
793
  return this.getEffectiveBasePermissions();
862
794
  case 1:
863
- _yield$this$getEffect = _context14.v;
795
+ _yield$this$getEffect = _context13.v;
864
796
  High = _yield$this$getEffect.High;
865
- _context14.n = 2;
797
+ _context13.n = 2;
866
798
  return this.roleDefinitions();
867
799
  case 2:
868
- roleDefinitions = _context14.v;
869
- result = roleDefinitions.find(function (_ref6) {
870
- var BasePermissions = _ref6.BasePermissions;
800
+ roleDefinitions = _context13.v;
801
+ result = roleDefinitions.find(function (_ref8) {
802
+ var BasePermissions = _ref8.BasePermissions;
871
803
  return BasePermissions.High === High;
872
804
  });
873
- return _context14.a(2, result);
805
+ return _context13.a(2, result);
874
806
  }
875
- }, _callee14, this);
807
+ }, _callee13, this);
876
808
  }));
877
809
  function currentUserPermissions() {
878
810
  return _currentUserPermissions.apply(this, arguments);