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