@lindle/sharepoint_requests 0.1.10 → 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.
@@ -8,13 +8,29 @@ declare class HTTPSharePointRequests<T extends {
8
8
  private endpoint;
9
9
  private listName;
10
10
  private instance;
11
+ /**
12
+ * Creates an HTTP SharePoint requester bound to the provided base URL.
13
+ *
14
+ * @param baseURL The root SharePoint site URL (with or without trailing slash).
15
+ */
11
16
  constructor(baseURL: string);
17
+ /**
18
+ * Converts array values in a payload to the `Collection(Edm.String)` structure
19
+ * expected by SharePoint REST endpoints.
20
+ *
21
+ * @param data The list item payload to harmonise in-place.
22
+ */
12
23
  private transformArraysToEdmStrings;
13
24
  /**
14
25
  * @deprecated Use `from` instead.
15
26
  */
16
27
  list(listName: IListName<T>): this;
17
28
  readonly lists: {
29
+ /**
30
+ * Fetches all SharePoint lists available to the current site.
31
+ *
32
+ * @returns Promise resolving to the list collection response payload.
33
+ */
18
34
  get: () => Promise<{
19
35
  data: any[];
20
36
  meta: {
@@ -22,6 +38,13 @@ declare class HTTPSharePointRequests<T extends {
22
38
  };
23
39
  }>;
24
40
  };
41
+ /**
42
+ * Selects a SharePoint list and exposes list-scoped CRUD helpers.
43
+ *
44
+ * @param listName Logical list key configured in the generic type map.
45
+ * @param sharepoint_ver SharePoint version used to choose the correct REST endpoint.
46
+ * @returns Chainable helpers bound to the selected list.
47
+ */
25
48
  from<K extends Extract<keyof T['LISTS'], string>>(listName: K, sharepoint_ver?: SHAREPOINT_VER): {
26
49
  create: (data: ListData) => Promise<AxiosResponse<any, any, {}>>;
27
50
  get: (options?: Options<T['LISTS'][K]>) => Promise<{
@@ -38,9 +61,26 @@ declare class HTTPSharePointRequests<T extends {
38
61
  };
39
62
  };
40
63
  folders: {
64
+ /**
65
+ * Retrieves SharePoint folders from the default folders endpoint.
66
+ *
67
+ * @returns A promise resolving with folder metadata.
68
+ */
41
69
  get: () => void;
42
70
  };
71
+ /**
72
+ * Targets a SharePoint folder path and exposes file retrieval helpers.
73
+ *
74
+ * @param folderName Optional folder path relative to `Shared Documents`.
75
+ * @returns Helper exposing `get` to fetch files or sub-folders.
76
+ */
43
77
  folder(folderName?: string | string[]): {
78
+ /**
79
+ * Fetches files or folders from the targeted path.
80
+ *
81
+ * @param options Optional REST query options to refine the result set.
82
+ * @returns Promise resolving to folder contents and metadata.
83
+ */
44
84
  get: (options?: Folder_Options<any>) => Promise<{
45
85
  data: any;
46
86
  meta: {
@@ -48,7 +88,18 @@ declare class HTTPSharePointRequests<T extends {
48
88
  };
49
89
  }>;
50
90
  };
91
+ /**
92
+ * Retrieves user list items and exposes a get helper with optional query parameters.
93
+ *
94
+ * @param options Optional REST query options.
95
+ * @returns Helper exposing `get` returning SharePoint user rows.
96
+ */
51
97
  users(options?: Options<any>): {
98
+ /**
99
+ * Executes the user list request using the specified options.
100
+ *
101
+ * @returns Promise resolving to the SharePoint user list response.
102
+ */
52
103
  get: () => Promise<{
53
104
  data: any[];
54
105
  meta: {
@@ -63,12 +114,56 @@ declare class HTTPSharePointRequests<T extends {
63
114
  * @throws {Error} If the HTTP request fails or the response does not contain the expected data.
64
115
  */
65
116
  private getDigest;
117
+ /**
118
+ * Executes a GET request without additional metadata wrapping.
119
+ *
120
+ * @param options Optional REST query options.
121
+ * @returns SharePoint response payload or undefined when empty.
122
+ */
66
123
  private get_only;
124
+ /**
125
+ * Retrieves folder contents with optional filtering and returns the payload with metadata.
126
+ *
127
+ * @param options REST options describing expand/filter/order conditions.
128
+ * @returns Folder data and the fully resolved request URL.
129
+ */
67
130
  private get_files;
131
+ /**
132
+ * Performs a typed list read against the current endpoint.
133
+ *
134
+ * @param options Optional REST query options governing expand, filter, ordering and pagination.
135
+ * @returns SharePoint list items alongside the fully-resolved request URL.
136
+ */
68
137
  private get_v2;
138
+ /**
139
+ * Updates an item in the currently selected list.
140
+ *
141
+ * @param id Target list item identifier.
142
+ * @param data Payload with fields to update.
143
+ * @param digest Optional pre-fetched form digest to reuse.
144
+ * @returns Axios response of the update request.
145
+ */
69
146
  private update_2;
147
+ /**
148
+ * Creates a new item within the active list.
149
+ *
150
+ * @param listData SharePoint list item payload.
151
+ * @returns Axios response resolved from the create request.
152
+ */
70
153
  private create_v2;
154
+ /**
155
+ * Uploads an attachment file to an existing list item.
156
+ *
157
+ * @param props File payload and target item identifier.
158
+ * @returns Axios response describing the upload result.
159
+ */
71
160
  private createFile;
161
+ /**
162
+ * Deletes an item using the current endpoint.
163
+ *
164
+ * @param ID Identifier of the entity to remove.
165
+ * @returns Axios response from the delete call.
166
+ */
72
167
  private delete;
73
168
  email: {
74
169
  /**
@@ -102,24 +197,85 @@ declare class HTTPSharePointRequests<T extends {
102
197
  }, any, {}>>;
103
198
  };
104
199
  private sendEmail;
200
+ /**
201
+ * Queries SharePoint's people picker endpoint for matching users.
202
+ *
203
+ * @param input Free-text search term.
204
+ * @param filter Optional additional filter condition.
205
+ * @returns Promise with type-ahead results payload.
206
+ */
105
207
  private typeAhead;
208
+ /**
209
+ * Retrieves the current user profile and flattens selected properties.
210
+ *
211
+ * @returns Promise containing the current user's profile information.
212
+ */
106
213
  private currentUserProperties;
107
214
  user: {
215
+ /**
216
+ * Provides accessors for the current user's profile information.
217
+ *
218
+ * @returns Helper exposing a `get` function to retrieve profile details.
219
+ */
108
220
  properties: () => {
109
221
  get: () => Promise<UserProfile>;
110
222
  };
223
+ /**
224
+ * Searches across site users and their groups.
225
+ *
226
+ * @param searchValue Query string to match site users.
227
+ * @returns Promise resolving to matching site users.
228
+ */
111
229
  searchSiteUser: (searchValue: string) => Promise<any>;
230
+ /**
231
+ * Performs a people-picker search scoped to the current site collection.
232
+ *
233
+ * @param input Search prefix.
234
+ * @param filter Optional additional filter condition.
235
+ * @returns Promise with type-ahead person results.
236
+ */
112
237
  searchUser: (input: string, filter?: string) => Promise<PersonField>;
238
+ /**
239
+ * Fetches the currently authenticated SharePoint user.
240
+ *
241
+ * @returns Helper exposing `get` that resolves to the current user payload.
242
+ */
113
243
  current: () => {
114
244
  get: () => Promise<CurrentUser>;
115
245
  };
246
+ /**
247
+ * Retrieves calculated permission level for the current user.
248
+ *
249
+ * @returns Helper exposing `get` resolving to the user's permission definition.
250
+ */
116
251
  currentPermission: () => {
117
252
  get: () => Promise<UserPermision>;
118
253
  };
119
254
  };
255
+ /**
256
+ * Searches site users based on a substring match across common fields.
257
+ *
258
+ * @param searchValue Term to match against the SharePoint user directory.
259
+ * @returns Promise with matching site users and their groups.
260
+ */
120
261
  private getSiteUser;
262
+ /**
263
+ * Retrieves all available role definitions for the current site.
264
+ *
265
+ * @returns Promise resolving to an array of role definitions.
266
+ */
121
267
  private roleDefinitions;
268
+ /**
269
+ * Fetches the bit-encoded permissions of the current user.
270
+ *
271
+ * @returns Promise resolving to the `EffectiveBasePermissions` object.
272
+ */
122
273
  private getEffectiveBasePermissions;
274
+ /**
275
+ * Matches the current user's effective permissions against known role definitions.
276
+ *
277
+ * @returns The matching SharePoint role definition as a structured permission object.
278
+ */
123
279
  private currentUserPermissions;
124
280
  }
125
281
  export default HTTPSharePointRequests;
@@ -156,7 +156,7 @@ var instance = function instance(baseURL, config) {
156
156
  Accept: 'application/json; odata=verbose',
157
157
  'Content-Type': 'application/json; odata=verbose'
158
158
  },
159
- timeout: 1000,
159
+ timeout: 15000,
160
160
  withCredentials: true
161
161
  };
162
162
  }
@@ -166,15 +166,30 @@ var instance = function instance(baseURL, config) {
166
166
  };
167
167
 
168
168
  var HTTPSharePointRequests = /*#__PURE__*/function () {
169
+ /**
170
+ * Creates an HTTP SharePoint requester bound to the provided base URL.
171
+ *
172
+ * @param baseURL The root SharePoint site URL (with or without trailing slash).
173
+ */
169
174
  function HTTPSharePointRequests(baseURL) {
170
175
  var _this = this;
171
176
  this.lists = {
177
+ /**
178
+ * Fetches all SharePoint lists available to the current site.
179
+ *
180
+ * @returns Promise resolving to the list collection response payload.
181
+ */
172
182
  get: function get() {
173
183
  _this.endpoint = '_api/web/lists';
174
184
  return _this.get_v2();
175
185
  }
176
186
  };
177
187
  this.folders = {
188
+ /**
189
+ * Retrieves SharePoint folders from the default folders endpoint.
190
+ *
191
+ * @returns A promise resolving with folder metadata.
192
+ */
178
193
  get: function get() {
179
194
  _this.endpoint = '_api/web/folders';
180
195
  _this.get_v2();
@@ -210,6 +225,11 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
210
225
  }
211
226
  };
212
227
  this.user = {
228
+ /**
229
+ * Provides accessors for the current user's profile information.
230
+ *
231
+ * @returns Helper exposing a `get` function to retrieve profile details.
232
+ */
213
233
  properties: function properties() {
214
234
  return {
215
235
  get: function get() {
@@ -217,12 +237,30 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
217
237
  }
218
238
  };
219
239
  },
240
+ /**
241
+ * Searches across site users and their groups.
242
+ *
243
+ * @param searchValue Query string to match site users.
244
+ * @returns Promise resolving to matching site users.
245
+ */
220
246
  searchSiteUser: function searchSiteUser(searchValue) {
221
247
  return _this.getSiteUser(searchValue);
222
248
  },
249
+ /**
250
+ * Performs a people-picker search scoped to the current site collection.
251
+ *
252
+ * @param input Search prefix.
253
+ * @param filter Optional additional filter condition.
254
+ * @returns Promise with type-ahead person results.
255
+ */
223
256
  searchUser: function searchUser(input, filter) {
224
257
  return _this.typeAhead(input, filter);
225
258
  },
259
+ /**
260
+ * Fetches the currently authenticated SharePoint user.
261
+ *
262
+ * @returns Helper exposing `get` that resolves to the current user payload.
263
+ */
226
264
  current: function current() {
227
265
  _this.endpoint = '_api/web/currentUser';
228
266
  return {
@@ -231,6 +269,11 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
231
269
  }
232
270
  };
233
271
  },
272
+ /**
273
+ * Retrieves calculated permission level for the current user.
274
+ *
275
+ * @returns Helper exposing `get` resolving to the user's permission definition.
276
+ */
234
277
  currentPermission: function currentPermission() {
235
278
  return {
236
279
  get: function get() {
@@ -244,6 +287,12 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
244
287
  this.listName = '';
245
288
  this.instance = instance(this.baseURL);
246
289
  }
290
+ /**
291
+ * Converts array values in a payload to the `Collection(Edm.String)` structure
292
+ * expected by SharePoint REST endpoints.
293
+ *
294
+ * @param data The list item payload to harmonise in-place.
295
+ */
247
296
  var _proto = HTTPSharePointRequests.prototype;
248
297
  _proto.transformArraysToEdmStrings = function transformArraysToEdmStrings(data) {
249
298
  for (var key in data) {
@@ -264,7 +313,14 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
264
313
  this.listName = listName;
265
314
  this.endpoint = "_vti_bin/ListData.svc/" + listName;
266
315
  return this;
267
- };
316
+ }
317
+ /**
318
+ * Selects a SharePoint list and exposes list-scoped CRUD helpers.
319
+ *
320
+ * @param listName Logical list key configured in the generic type map.
321
+ * @param sharepoint_ver SharePoint version used to choose the correct REST endpoint.
322
+ * @returns Chainable helpers bound to the selected list.
323
+ */;
268
324
  _proto.from = function from(listName, sharepoint_ver) {
269
325
  var _this2 = this;
270
326
  if (sharepoint_ver === void 0) {
@@ -298,7 +354,13 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
298
354
  };
299
355
  }
300
356
  };
301
- };
357
+ }
358
+ /**
359
+ * Targets a SharePoint folder path and exposes file retrieval helpers.
360
+ *
361
+ * @param folderName Optional folder path relative to `Shared Documents`.
362
+ * @returns Helper exposing `get` to fetch files or sub-folders.
363
+ */;
302
364
  _proto.folder = function folder(folderName) {
303
365
  var _this3 = this;
304
366
  var filePath = ['Shared Documents'];
@@ -307,6 +369,12 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
307
369
  }
308
370
  this.endpoint = "_api/web/GetFolderByServerRelativeUrl('" + filePath.join('/') + "')";
309
371
  return {
372
+ /**
373
+ * Fetches files or folders from the targeted path.
374
+ *
375
+ * @param options Optional REST query options to refine the result set.
376
+ * @returns Promise resolving to folder contents and metadata.
377
+ */
310
378
  get: function get(options) {
311
379
  if (!(options != null && options.type)) {
312
380
  _this3.endpoint += '/Files';
@@ -316,11 +384,22 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
316
384
  return _this3.get_files(options);
317
385
  }
318
386
  };
319
- };
387
+ }
388
+ /**
389
+ * Retrieves user list items and exposes a get helper with optional query parameters.
390
+ *
391
+ * @param options Optional REST query options.
392
+ * @returns Helper exposing `get` returning SharePoint user rows.
393
+ */;
320
394
  _proto.users = function users(options) {
321
395
  var _this4 = this;
322
396
  this.endpoint = '_api/web/SiteUserInfoList/items';
323
397
  return {
398
+ /**
399
+ * Executes the user list request using the specified options.
400
+ *
401
+ * @returns Promise resolving to the SharePoint user list response.
402
+ */
324
403
  get: function get() {
325
404
  return _this4.get_v2(options);
326
405
  }
@@ -366,8 +445,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
366
445
  return _getDigest.apply(this, arguments);
367
446
  }
368
447
  return getDigest;
369
- }();
370
- _proto.get_only = /*#__PURE__*/function () {
448
+ }()
449
+ /**
450
+ * Executes a GET request without additional metadata wrapping.
451
+ *
452
+ * @param options Optional REST query options.
453
+ * @returns SharePoint response payload or undefined when empty.
454
+ */
455
+ ;
456
+ _proto.get_only =
457
+ /*#__PURE__*/
458
+ function () {
371
459
  var _get_only = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(options) {
372
460
  var _ref, expand, orderBy, limit, filter, cols, skip, params, _yield$this$instance$, data;
373
461
  return _regenerator().w(function (_context2) {
@@ -403,8 +491,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
403
491
  return _get_only.apply(this, arguments);
404
492
  }
405
493
  return get_only;
406
- }();
407
- _proto.get_files = /*#__PURE__*/function () {
494
+ }()
495
+ /**
496
+ * Retrieves folder contents with optional filtering and returns the payload with metadata.
497
+ *
498
+ * @param options REST options describing expand/filter/order conditions.
499
+ * @returns Folder data and the fully resolved request URL.
500
+ */
501
+ ;
502
+ _proto.get_files =
503
+ /*#__PURE__*/
504
+ function () {
408
505
  var _get_files = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(options) {
409
506
  var _ref2, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
410
507
  return _regenerator().w(function (_context3) {
@@ -450,8 +547,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
450
547
  return _get_files.apply(this, arguments);
451
548
  }
452
549
  return get_files;
453
- }();
454
- _proto.get_v2 = /*#__PURE__*/function () {
550
+ }()
551
+ /**
552
+ * Performs a typed list read against the current endpoint.
553
+ *
554
+ * @param options Optional REST query options governing expand, filter, ordering and pagination.
555
+ * @returns SharePoint list items alongside the fully-resolved request URL.
556
+ */
557
+ ;
558
+ _proto.get_v2 =
559
+ /*#__PURE__*/
560
+ function () {
455
561
  var _get_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(options) {
456
562
  var _ref4, expand, orderBy, limit, filter, cols, skip, params, url, response, data, meta;
457
563
  return _regenerator().w(function (_context4) {
@@ -497,8 +603,19 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
497
603
  return _get_v.apply(this, arguments);
498
604
  }
499
605
  return get_v2;
500
- }();
501
- _proto.update_2 = /*#__PURE__*/function () {
606
+ }()
607
+ /**
608
+ * Updates an item in the currently selected list.
609
+ *
610
+ * @param id Target list item identifier.
611
+ * @param data Payload with fields to update.
612
+ * @param digest Optional pre-fetched form digest to reuse.
613
+ * @returns Axios response of the update request.
614
+ */
615
+ ;
616
+ _proto.update_2 =
617
+ /*#__PURE__*/
618
+ function () {
502
619
  var _update_ = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(id, data, digest) {
503
620
  var formDigestValue, url, response, _t2;
504
621
  return _regenerator().w(function (_context5) {
@@ -540,8 +657,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
540
657
  return _update_.apply(this, arguments);
541
658
  }
542
659
  return update_2;
543
- }();
544
- _proto.create_v2 = /*#__PURE__*/function () {
660
+ }()
661
+ /**
662
+ * Creates a new item within the active list.
663
+ *
664
+ * @param listData SharePoint list item payload.
665
+ * @returns Axios response resolved from the create request.
666
+ */
667
+ ;
668
+ _proto.create_v2 =
669
+ /*#__PURE__*/
670
+ function () {
545
671
  var _create_v = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(listData) {
546
672
  var response, _t3, _t4, _t5, _t6, _t7;
547
673
  return _regenerator().w(function (_context6) {
@@ -579,8 +705,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
579
705
  return _create_v.apply(this, arguments);
580
706
  }
581
707
  return create_v2;
582
- }();
583
- _proto.createFile = /*#__PURE__*/function () {
708
+ }()
709
+ /**
710
+ * Uploads an attachment file to an existing list item.
711
+ *
712
+ * @param props File payload and target item identifier.
713
+ * @returns Axios response describing the upload result.
714
+ */
715
+ ;
716
+ _proto.createFile =
717
+ /*#__PURE__*/
718
+ function () {
584
719
  var _createFile = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(_ref6) {
585
720
  var file, itemId, requestUrl, res, _t8, _t9, _t0, _t1, _t10;
586
721
  return _regenerator().w(function (_context7) {
@@ -613,8 +748,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
613
748
  return _createFile.apply(this, arguments);
614
749
  }
615
750
  return createFile;
616
- }();
617
- _proto["delete"] = /*#__PURE__*/function () {
751
+ }()
752
+ /**
753
+ * Deletes an item using the current endpoint.
754
+ *
755
+ * @param ID Identifier of the entity to remove.
756
+ * @returns Axios response from the delete call.
757
+ */
758
+ ;
759
+ _proto["delete"] =
760
+ /*#__PURE__*/
761
+ function () {
618
762
  var _delete2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(ID) {
619
763
  var response;
620
764
  return _regenerator().w(function (_context8) {
@@ -682,8 +826,18 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
682
826
  return _sendEmail.apply(this, arguments);
683
827
  }
684
828
  return sendEmail;
685
- }();
686
- _proto.typeAhead = /*#__PURE__*/function () {
829
+ }()
830
+ /**
831
+ * Queries SharePoint's people picker endpoint for matching users.
832
+ *
833
+ * @param input Free-text search term.
834
+ * @param filter Optional additional filter condition.
835
+ * @returns Promise with type-ahead results payload.
836
+ */
837
+ ;
838
+ _proto.typeAhead =
839
+ /*#__PURE__*/
840
+ function () {
687
841
  var _typeAhead = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(input, filter) {
688
842
  var filterValue, response;
689
843
  return _regenerator().w(function (_context0) {
@@ -702,8 +856,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
702
856
  return _typeAhead.apply(this, arguments);
703
857
  }
704
858
  return typeAhead;
705
- }();
706
- _proto.currentUserProperties = /*#__PURE__*/function () {
859
+ }()
860
+ /**
861
+ * Retrieves the current user profile and flattens selected properties.
862
+ *
863
+ * @returns Promise containing the current user's profile information.
864
+ */
865
+ ;
866
+ _proto.currentUserProperties =
867
+ /*#__PURE__*/
868
+ function () {
707
869
  var _currentUserProperties = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
708
870
  var requestUrl, profile;
709
871
  return _regenerator().w(function (_context1) {
@@ -737,8 +899,17 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
737
899
  return _currentUserProperties.apply(this, arguments);
738
900
  }
739
901
  return currentUserProperties;
740
- }();
741
- _proto.getSiteUser = /*#__PURE__*/function () {
902
+ }()
903
+ /**
904
+ * Searches site users based on a substring match across common fields.
905
+ *
906
+ * @param searchValue Term to match against the SharePoint user directory.
907
+ * @returns Promise with matching site users and their groups.
908
+ */
909
+ ;
910
+ _proto.getSiteUser =
911
+ /*#__PURE__*/
912
+ function () {
742
913
  var _getSiteUser = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(searchValue) {
743
914
  var requestUrl, response;
744
915
  return _regenerator().w(function (_context10) {
@@ -757,8 +928,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
757
928
  return _getSiteUser.apply(this, arguments);
758
929
  }
759
930
  return getSiteUser;
760
- }();
761
- _proto.roleDefinitions = /*#__PURE__*/function () {
931
+ }()
932
+ /**
933
+ * Retrieves all available role definitions for the current site.
934
+ *
935
+ * @returns Promise resolving to an array of role definitions.
936
+ */
937
+ ;
938
+ _proto.roleDefinitions =
939
+ /*#__PURE__*/
940
+ function () {
762
941
  var _roleDefinitions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11() {
763
942
  var requestUrl, response;
764
943
  return _regenerator().w(function (_context11) {
@@ -777,8 +956,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
777
956
  return _roleDefinitions.apply(this, arguments);
778
957
  }
779
958
  return roleDefinitions;
780
- }();
781
- _proto.getEffectiveBasePermissions = /*#__PURE__*/function () {
959
+ }()
960
+ /**
961
+ * Fetches the bit-encoded permissions of the current user.
962
+ *
963
+ * @returns Promise resolving to the `EffectiveBasePermissions` object.
964
+ */
965
+ ;
966
+ _proto.getEffectiveBasePermissions =
967
+ /*#__PURE__*/
968
+ function () {
782
969
  var _getEffectiveBasePermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee12() {
783
970
  var requestUrl, response;
784
971
  return _regenerator().w(function (_context12) {
@@ -797,8 +984,16 @@ var HTTPSharePointRequests = /*#__PURE__*/function () {
797
984
  return _getEffectiveBasePermissions.apply(this, arguments);
798
985
  }
799
986
  return getEffectiveBasePermissions;
800
- }();
801
- _proto.currentUserPermissions = /*#__PURE__*/function () {
987
+ }()
988
+ /**
989
+ * Matches the current user's effective permissions against known role definitions.
990
+ *
991
+ * @returns The matching SharePoint role definition as a structured permission object.
992
+ */
993
+ ;
994
+ _proto.currentUserPermissions =
995
+ /*#__PURE__*/
996
+ function () {
802
997
  var _currentUserPermissions = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee13() {
803
998
  var _yield$this$getEffect, High, roleDefinitions, result;
804
999
  return _regenerator().w(function (_context13) {