@lindle/sharepoint_requests 0.1.9 → 0.1.11

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.
@@ -25,6 +25,15 @@ function _asyncToGenerator(n) {
25
25
  });
26
26
  };
27
27
  }
28
+ function _extends() {
29
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
30
+ for (var e = 1; e < arguments.length; e++) {
31
+ var t = arguments[e];
32
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
33
+ }
34
+ return n;
35
+ }, _extends.apply(null, arguments);
36
+ }
28
37
  function _regenerator() {
29
38
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
30
39
  var e,
@@ -120,32 +129,61 @@ function _regeneratorDefine(e, r, n, t) {
120
129
  i = 0;
121
130
  }
122
131
  _regeneratorDefine = function (e, r, n, t) {
123
- if (r) i ? i(e, r, {
132
+ function o(r, n) {
133
+ _regeneratorDefine(e, r, function (e) {
134
+ return this._invoke(r, n, e);
135
+ });
136
+ }
137
+ r ? i ? i(e, r, {
124
138
  value: n,
125
139
  enumerable: !t,
126
140
  configurable: !t,
127
141
  writable: !t
128
- }) : e[r] = n;else {
129
- function o(r, n) {
130
- _regeneratorDefine(e, r, function (e) {
131
- return this._invoke(r, n, e);
132
- });
133
- }
134
- o("next", 0), o("throw", 1), o("return", 2);
135
- }
142
+ }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
136
143
  }, _regeneratorDefine(e, r, n, t);
137
144
  }
138
145
 
146
+ var instance = function instance(baseURL, config) {
147
+ if (config === void 0) {
148
+ config = {
149
+ headers: {
150
+ Accept: 'application/json; odata=verbose',
151
+ 'Content-Type': 'application/json; odata=verbose'
152
+ },
153
+ timeout: 15000,
154
+ withCredentials: true
155
+ };
156
+ }
157
+ return axios.create(_extends({
158
+ baseURL: baseURL
159
+ }, config));
160
+ };
161
+
139
162
  var HTTPSharePointRequests = /*#__PURE__*/function () {
163
+ /**
164
+ * Creates an HTTP SharePoint requester bound to the provided base URL.
165
+ *
166
+ * @param baseURL The root SharePoint site URL (with or without trailing slash).
167
+ */
140
168
  function HTTPSharePointRequests(baseURL) {
141
169
  var _this = this;
142
170
  this.lists = {
171
+ /**
172
+ * Fetches all SharePoint lists available to the current site.
173
+ *
174
+ * @returns Promise resolving to the list collection response payload.
175
+ */
143
176
  get: function get() {
144
177
  _this.endpoint = '_api/web/lists';
145
178
  return _this.get_v2();
146
179
  }
147
180
  };
148
181
  this.folders = {
182
+ /**
183
+ * Retrieves SharePoint folders from the default folders endpoint.
184
+ *
185
+ * @returns A promise resolving with folder metadata.
186
+ */
149
187
  get: function get() {
150
188
  _this.endpoint = '_api/web/folders';
151
189
  _this.get_v2();
@@ -181,6 +219,11 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
181
219
  }
182
220
  };
183
221
  this.user = {
222
+ /**
223
+ * Provides accessors for the current user's profile information.
224
+ *
225
+ * @returns Helper exposing a `get` function to retrieve profile details.
226
+ */
184
227
  properties: function properties() {
185
228
  return {
186
229
  get: function get() {
@@ -188,12 +231,30 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
188
231
  }
189
232
  };
190
233
  },
234
+ /**
235
+ * Searches across site users and their groups.
236
+ *
237
+ * @param searchValue Query string to match site users.
238
+ * @returns Promise resolving to matching site users.
239
+ */
191
240
  searchSiteUser: function searchSiteUser(searchValue) {
192
241
  return _this.getSiteUser(searchValue);
193
242
  },
243
+ /**
244
+ * Performs a people-picker search scoped to the current site collection.
245
+ *
246
+ * @param input Search prefix.
247
+ * @param filter Optional additional filter condition.
248
+ * @returns Promise with type-ahead person results.
249
+ */
194
250
  searchUser: function searchUser(input, filter) {
195
251
  return _this.typeAhead(input, filter);
196
252
  },
253
+ /**
254
+ * Fetches the currently authenticated SharePoint user.
255
+ *
256
+ * @returns Helper exposing `get` that resolves to the current user payload.
257
+ */
197
258
  current: function current() {
198
259
  _this.endpoint = '_api/web/currentUser';
199
260
  return {
@@ -202,6 +263,11 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
202
263
  }
203
264
  };
204
265
  },
266
+ /**
267
+ * Retrieves calculated permission level for the current user.
268
+ *
269
+ * @returns Helper exposing `get` resolving to the user's permission definition.
270
+ */
205
271
  currentPermission: function currentPermission() {
206
272
  return {
207
273
  get: function get() {
@@ -213,19 +279,14 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
213
279
  this.baseURL = baseURL.endsWith('/') ? baseURL : baseURL + "/";
214
280
  this.endpoint = '/api';
215
281
  this.listName = '';
216
- var headers = {
217
- Accept: 'application/json; odata=verbose',
218
- 'Content-Type': 'application/json; odata=verbose'
219
- };
220
- this.instance = axios.create({
221
- baseURL: "" + this.baseURL,
222
- withCredentials: true,
223
- headers: {
224
- common: headers,
225
- post: headers
226
- }
227
- });
282
+ this.instance = instance(this.baseURL);
228
283
  }
284
+ /**
285
+ * Converts array values in a payload to the `Collection(Edm.String)` structure
286
+ * expected by SharePoint REST endpoints.
287
+ *
288
+ * @param data The list item payload to harmonise in-place.
289
+ */
229
290
  var _proto = HTTPSharePointRequests.prototype;
230
291
  _proto.transformArraysToEdmStrings = function transformArraysToEdmStrings(data) {
231
292
  for (var key in data) {
@@ -246,7 +307,14 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
246
307
  this.listName = listName;
247
308
  this.endpoint = "_vti_bin/ListData.svc/" + listName;
248
309
  return this;
249
- };
310
+ }
311
+ /**
312
+ * Selects a SharePoint list and exposes list-scoped CRUD helpers.
313
+ *
314
+ * @param listName Logical list key configured in the generic type map.
315
+ * @param sharepoint_ver SharePoint version used to choose the correct REST endpoint.
316
+ * @returns Chainable helpers bound to the selected list.
317
+ */;
250
318
  _proto.from = function from(listName, sharepoint_ver) {
251
319
  var _this2 = this;
252
320
  if (sharepoint_ver === void 0) {
@@ -280,7 +348,13 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
280
348
  };
281
349
  }
282
350
  };
283
- };
351
+ }
352
+ /**
353
+ * Targets a SharePoint folder path and exposes file retrieval helpers.
354
+ *
355
+ * @param folderName Optional folder path relative to `Shared Documents`.
356
+ * @returns Helper exposing `get` to fetch files or sub-folders.
357
+ */;
284
358
  _proto.folder = function folder(folderName) {
285
359
  var _this3 = this;
286
360
  var filePath = ['Shared Documents'];
@@ -289,6 +363,12 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
289
363
  }
290
364
  this.endpoint = "_api/web/GetFolderByServerRelativeUrl('" + filePath.join('/') + "')";
291
365
  return {
366
+ /**
367
+ * Fetches files or folders from the targeted path.
368
+ *
369
+ * @param options Optional REST query options to refine the result set.
370
+ * @returns Promise resolving to folder contents and metadata.
371
+ */
292
372
  get: function get(options) {
293
373
  if (!(options != null && options.type)) {
294
374
  _this3.endpoint += '/Files';
@@ -298,11 +378,22 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
298
378
  return _this3.get_files(options);
299
379
  }
300
380
  };
301
- };
381
+ }
382
+ /**
383
+ * Retrieves user list items and exposes a get helper with optional query parameters.
384
+ *
385
+ * @param options Optional REST query options.
386
+ * @returns Helper exposing `get` returning SharePoint user rows.
387
+ */;
302
388
  _proto.users = function users(options) {
303
389
  var _this4 = this;
304
390
  this.endpoint = '_api/web/SiteUserInfoList/items';
305
391
  return {
392
+ /**
393
+ * Executes the user list request using the specified options.
394
+ *
395
+ * @returns Promise resolving to the SharePoint user list response.
396
+ */
306
397
  get: function get() {
307
398
  return _this4.get_v2(options);
308
399
  }
@@ -348,8 +439,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
348
439
  return _getDigest.apply(this, arguments);
349
440
  }
350
441
  return getDigest;
351
- }();
352
- _proto.get_only = /*#__PURE__*/function () {
442
+ }()
443
+ /**
444
+ * Executes a GET request without additional metadata wrapping.
445
+ *
446
+ * @param options Optional REST query options.
447
+ * @returns SharePoint response payload or undefined when empty.
448
+ */
449
+ ;
450
+ _proto.get_only =
451
+ /*#__PURE__*/
452
+ function () {
353
453
  var _get_only = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
354
454
  var _ref, expand, orderBy, limit, filter, cols, skip, params, _yield$this$instance$, data;
355
455
  return _regenerator().w(function (_context2) {
@@ -385,8 +485,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
385
485
  return _get_only.apply(this, arguments);
386
486
  }
387
487
  return get_only;
388
- }();
389
- _proto.get_files = /*#__PURE__*/function () {
488
+ }()
489
+ /**
490
+ * Retrieves folder contents with optional filtering and returns the payload with metadata.
491
+ *
492
+ * @param options REST options describing expand/filter/order conditions.
493
+ * @returns Folder data and the fully resolved request URL.
494
+ */
495
+ ;
496
+ _proto.get_files =
497
+ /*#__PURE__*/
498
+ function () {
390
499
  var _get_files = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
391
500
  var _ref2, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
392
501
  return _regenerator().w(function (_context3) {
@@ -432,8 +541,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
432
541
  return _get_files.apply(this, arguments);
433
542
  }
434
543
  return get_files;
435
- }();
436
- _proto.get_v2 = /*#__PURE__*/function () {
544
+ }()
545
+ /**
546
+ * Performs a typed list read against the current endpoint.
547
+ *
548
+ * @param options Optional REST query options governing expand, filter, ordering and pagination.
549
+ * @returns SharePoint list items alongside the fully-resolved request URL.
550
+ */
551
+ ;
552
+ _proto.get_v2 =
553
+ /*#__PURE__*/
554
+ function () {
437
555
  var _get_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(options) {
438
556
  var _ref4, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
439
557
  return _regenerator().w(function (_context4) {
@@ -479,8 +597,19 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
479
597
  return _get_v.apply(this, arguments);
480
598
  }
481
599
  return get_v2;
482
- }();
483
- _proto.update_2 = /*#__PURE__*/function () {
600
+ }()
601
+ /**
602
+ * Updates an item in the currently selected list.
603
+ *
604
+ * @param id Target list item identifier.
605
+ * @param data Payload with fields to update.
606
+ * @param digest Optional pre-fetched form digest to reuse.
607
+ * @returns Axios response of the update request.
608
+ */
609
+ ;
610
+ _proto.update_2 =
611
+ /*#__PURE__*/
612
+ function () {
484
613
  var _update_ = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(id, data, digest) {
485
614
  var formDigestValue, url, response, _t2;
486
615
  return _regenerator().w(function (_context5) {
@@ -522,10 +651,19 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
522
651
  return _update_.apply(this, arguments);
523
652
  }
524
653
  return update_2;
525
- }();
526
- _proto.create_v2 = /*#__PURE__*/function () {
654
+ }()
655
+ /**
656
+ * Creates a new item within the active list.
657
+ *
658
+ * @param listData SharePoint list item payload.
659
+ * @returns Axios response resolved from the create request.
660
+ */
661
+ ;
662
+ _proto.create_v2 =
663
+ /*#__PURE__*/
664
+ function () {
527
665
  var _create_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(listData) {
528
- var response, _t3, _t4, _t5, _t6, _t7, _t8;
666
+ var response, _t3, _t4, _t5, _t6, _t7;
529
667
  return _regenerator().w(function (_context6) {
530
668
  while (1) switch (_context6.n) {
531
669
  case 0:
@@ -544,14 +682,13 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
544
682
  'X-RequestDigest': _t6,
545
683
  'IF-MATCH': '*'
546
684
  };
547
- _t8 = {
685
+ _context6.n = 2;
686
+ return _t3.instance.call(_t3, {
548
687
  url: _t4,
549
688
  method: 'POST',
550
689
  data: _t5,
551
690
  headers: _t7
552
- };
553
- _context6.n = 2;
554
- return _t3.instance.call(_t3, _t8);
691
+ });
555
692
  case 2:
556
693
  response = _context6.v;
557
694
  return _context6.a(2, response);
@@ -562,31 +699,39 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
562
699
  return _create_v.apply(this, arguments);
563
700
  }
564
701
  return create_v2;
565
- }();
566
- _proto.createFile = /*#__PURE__*/function () {
702
+ }()
703
+ /**
704
+ * Uploads an attachment file to an existing list item.
705
+ *
706
+ * @param props File payload and target item identifier.
707
+ * @returns Axios response describing the upload result.
708
+ */
709
+ ;
710
+ _proto.createFile =
711
+ /*#__PURE__*/
712
+ function () {
567
713
  var _createFile = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref6) {
568
- var file, itemId, requestUrl, res, _t9, _t0, _t1, _t10, _t11, _t12;
714
+ var file, itemId, requestUrl, res, _t8, _t9, _t0, _t1, _t10;
569
715
  return _regenerator().w(function (_context7) {
570
716
  while (1) switch (_context7.n) {
571
717
  case 0:
572
718
  file = _ref6.file, itemId = _ref6.itemId;
573
719
  requestUrl = "_api/lists/getbytitle('" + this.listName + "')/items(" + itemId + ")/AttachmentFiles/add(FileName='" + file.name + "')";
574
- _t9 = this.instance;
575
- _t0 = requestUrl;
576
- _t1 = file;
720
+ _t8 = this.instance;
721
+ _t9 = requestUrl;
722
+ _t0 = file;
577
723
  _context7.n = 1;
578
724
  return this.getDigest();
579
725
  case 1:
580
- _t10 = _context7.v;
581
- _t11 = {
582
- 'X-RequestDigest': _t10
583
- };
584
- _t12 = {
585
- headers: _t11,
586
- withCredentials: true
726
+ _t1 = _context7.v;
727
+ _t10 = {
728
+ 'X-RequestDigest': _t1
587
729
  };
588
730
  _context7.n = 2;
589
- return _t9.post.call(_t9, _t0, _t1, _t12);
731
+ return _t8.post.call(_t8, _t9, _t0, {
732
+ headers: _t10,
733
+ withCredentials: true
734
+ });
590
735
  case 2:
591
736
  res = _context7.v;
592
737
  return _context7.a(2, res);
@@ -597,8 +742,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
597
742
  return _createFile.apply(this, arguments);
598
743
  }
599
744
  return createFile;
600
- }();
601
- _proto["delete"] = /*#__PURE__*/function () {
745
+ }()
746
+ /**
747
+ * Deletes an item using the current endpoint.
748
+ *
749
+ * @param ID Identifier of the entity to remove.
750
+ * @returns Axios response from the delete call.
751
+ */
752
+ ;
753
+ _proto["delete"] =
754
+ /*#__PURE__*/
755
+ function () {
602
756
  var _delete2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(ID) {
603
757
  var response;
604
758
  return _regenerator().w(function (_context8) {
@@ -619,24 +773,24 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
619
773
  }();
620
774
  _proto.sendEmail = /*#__PURE__*/function () {
621
775
  var _sendEmail = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(_ref7) {
622
- var From, To, Subject, Body, httpRequest, response, _t13, _t14, _t15, _t16, _t17, _t18;
776
+ var From, To, Subject, Body, httpRequest, response, _t11, _t12, _t13, _t14, _t15;
623
777
  return _regenerator().w(function (_context9) {
624
778
  while (1) switch (_context9.n) {
625
779
  case 0:
626
780
  From = _ref7.From, To = _ref7.To, Subject = _ref7.Subject, Body = _ref7.Body;
627
781
  httpRequest = '_api/SP.Utilities.Utility.SendEmail';
628
- _t13 = this;
629
- _t14 = httpRequest;
782
+ _t11 = this;
783
+ _t12 = httpRequest;
630
784
  _context9.n = 1;
631
785
  return this.getDigest();
632
786
  case 1:
633
- _t15 = _context9.v;
634
- _t16 = {
635
- 'X-RequestDigest': _t15,
787
+ _t13 = _context9.v;
788
+ _t14 = {
789
+ 'X-RequestDigest': _t13,
636
790
  'X-Http-Method': 'POST',
637
791
  'Content-Type': 'application/json;odata=verbose'
638
792
  };
639
- _t17 = JSON.stringify({
793
+ _t15 = JSON.stringify({
640
794
  properties: {
641
795
  __metadata: {
642
796
  type: 'SP.Utilities.EmailProperties'
@@ -649,14 +803,13 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
649
803
  Subject: Subject
650
804
  }
651
805
  });
652
- _t18 = {
653
- url: _t14,
654
- method: 'POST',
655
- headers: _t16,
656
- data: _t17
657
- };
658
806
  _context9.n = 2;
659
- return _t13.instance.call(_t13, _t18);
807
+ return _t11.instance.call(_t11, {
808
+ url: _t12,
809
+ method: 'POST',
810
+ headers: _t14,
811
+ data: _t15
812
+ });
660
813
  case 2:
661
814
  response = _context9.v;
662
815
  return _context9.a(2, response);
@@ -667,8 +820,18 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
667
820
  return _sendEmail.apply(this, arguments);
668
821
  }
669
822
  return sendEmail;
670
- }();
671
- _proto.typeAhead = /*#__PURE__*/function () {
823
+ }()
824
+ /**
825
+ * Queries SharePoint's people picker endpoint for matching users.
826
+ *
827
+ * @param input Free-text search term.
828
+ * @param filter Optional additional filter condition.
829
+ * @returns Promise with type-ahead results payload.
830
+ */
831
+ ;
832
+ _proto.typeAhead =
833
+ /*#__PURE__*/
834
+ function () {
672
835
  var _typeAhead = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(input, filter) {
673
836
  var filterValue, response;
674
837
  return _regenerator().w(function (_context0) {
@@ -687,8 +850,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
687
850
  return _typeAhead.apply(this, arguments);
688
851
  }
689
852
  return typeAhead;
690
- }();
691
- _proto.currentUserProperties = /*#__PURE__*/function () {
853
+ }()
854
+ /**
855
+ * Retrieves the current user profile and flattens selected properties.
856
+ *
857
+ * @returns Promise containing the current user's profile information.
858
+ */
859
+ ;
860
+ _proto.currentUserProperties =
861
+ /*#__PURE__*/
862
+ function () {
692
863
  var _currentUserProperties = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
693
864
  var requestUrl, profile;
694
865
  return _regenerator().w(function (_context1) {
@@ -722,8 +893,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
722
893
  return _currentUserProperties.apply(this, arguments);
723
894
  }
724
895
  return currentUserProperties;
725
- }();
726
- _proto.getSiteUser = /*#__PURE__*/function () {
896
+ }()
897
+ /**
898
+ * Searches site users based on a substring match across common fields.
899
+ *
900
+ * @param searchValue Term to match against the SharePoint user directory.
901
+ * @returns Promise with matching site users and their groups.
902
+ */
903
+ ;
904
+ _proto.getSiteUser =
905
+ /*#__PURE__*/
906
+ function () {
727
907
  var _getSiteUser = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(searchValue) {
728
908
  var requestUrl, response;
729
909
  return _regenerator().w(function (_context10) {
@@ -742,8 +922,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
742
922
  return _getSiteUser.apply(this, arguments);
743
923
  }
744
924
  return getSiteUser;
745
- }();
746
- _proto.roleDefinitions = /*#__PURE__*/function () {
925
+ }()
926
+ /**
927
+ * Retrieves all available role definitions for the current site.
928
+ *
929
+ * @returns Promise resolving to an array of role definitions.
930
+ */
931
+ ;
932
+ _proto.roleDefinitions =
933
+ /*#__PURE__*/
934
+ function () {
747
935
  var _roleDefinitions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
748
936
  var requestUrl, response;
749
937
  return _regenerator().w(function (_context11) {
@@ -762,8 +950,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
762
950
  return _roleDefinitions.apply(this, arguments);
763
951
  }
764
952
  return roleDefinitions;
765
- }();
766
- _proto.getEffectiveBasePermissions = /*#__PURE__*/function () {
953
+ }()
954
+ /**
955
+ * Fetches the bit-encoded permissions of the current user.
956
+ *
957
+ * @returns Promise resolving to the `EffectiveBasePermissions` object.
958
+ */
959
+ ;
960
+ _proto.getEffectiveBasePermissions =
961
+ /*#__PURE__*/
962
+ function () {
767
963
  var _getEffectiveBasePermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
768
964
  var requestUrl, response;
769
965
  return _regenerator().w(function (_context12) {
@@ -782,8 +978,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
782
978
  return _getEffectiveBasePermissions.apply(this, arguments);
783
979
  }
784
980
  return getEffectiveBasePermissions;
785
- }();
786
- _proto.currentUserPermissions = /*#__PURE__*/function () {
981
+ }()
982
+ /**
983
+ * Matches the current user's effective permissions against known role definitions.
984
+ *
985
+ * @returns The matching SharePoint role definition as a structured permission object.
986
+ */
987
+ ;
988
+ _proto.currentUserPermissions =
989
+ /*#__PURE__*/
990
+ function () {
787
991
  var _currentUserPermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
788
992
  var _yield$this$getEffect, High, roleDefinitions, result;
789
993
  return _regenerator().w(function (_context13) {