dattatable 2.9.31 → 2.9.33

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.
Files changed (65) hide show
  1. package/build/common/itemForm.d.ts +1 -0
  2. package/build/common/itemForm.js +27 -20
  3. package/build/common/list.d.ts +3 -1
  4. package/build/common/list.js +70 -34
  5. package/build/common/listSecurity.d.ts +1 -0
  6. package/build/common/listSecurity.js +23 -15
  7. package/build/common/methods.d.ts +1 -0
  8. package/build/common/methods.js +21 -1
  9. package/build/lib.d.ts +1 -0
  10. package/dist/dattatable.js +707 -707
  11. package/dist/dattatable.min.js +1 -1
  12. package/docs/assets/navigation.js +1 -1
  13. package/docs/assets/search.js +1 -1
  14. package/docs/classes/AuditLog.html +2 -2
  15. package/docs/classes/CanvasForm.html +2 -2
  16. package/docs/classes/Comments.html +2 -2
  17. package/docs/classes/Dashboard.html +4 -4
  18. package/docs/classes/DataTable.html +3 -3
  19. package/docs/classes/Documents.html +6 -6
  20. package/docs/classes/FilterSlideout.html +2 -2
  21. package/docs/classes/Footer.html +2 -2
  22. package/docs/classes/Header.html +2 -2
  23. package/docs/classes/InstallationRequired.html +2 -2
  24. package/docs/classes/ItemForm.html +5 -4
  25. package/docs/classes/List.html +6 -4
  26. package/docs/classes/ListSecurity.html +3 -2
  27. package/docs/classes/LoadingDialog.html +2 -2
  28. package/docs/classes/Modal.html +2 -2
  29. package/docs/classes/Navigation.html +3 -3
  30. package/docs/classes/Timeout.html +2 -2
  31. package/docs/enums/ActionButtonTypes.html +2 -2
  32. package/docs/functions/formatBytes.html +1 -1
  33. package/docs/functions/formatDateValue.html +1 -1
  34. package/docs/functions/formatTimeValue.html +1 -1
  35. package/docs/functions/getContextInfo.html +1 -0
  36. package/docs/functions/getFileExt.html +1 -1
  37. package/docs/functions/waitForTheme.html +1 -1
  38. package/docs/interfaces/IAuditLogItem.html +2 -2
  39. package/docs/interfaces/IAuditLogItemCreation.html +2 -2
  40. package/docs/interfaces/IAuditLogProps.html +2 -2
  41. package/docs/interfaces/IAuditLogViewProps.html +2 -2
  42. package/docs/interfaces/ICommentsItem.html +2 -2
  43. package/docs/interfaces/IDashboardProps.html +2 -2
  44. package/docs/interfaces/IDataTable.html +2 -2
  45. package/docs/interfaces/IDataTableProps.html +2 -2
  46. package/docs/interfaces/IDocumentsProps.html +2 -2
  47. package/docs/interfaces/IFilterItem.html +2 -2
  48. package/docs/interfaces/IFilterProps.html +2 -2
  49. package/docs/interfaces/IFooterProps.html +2 -2
  50. package/docs/interfaces/IHeaderProps.html +2 -2
  51. package/docs/interfaces/IInstallProps.html +2 -2
  52. package/docs/interfaces/IItemFormCreateProps.html +2 -2
  53. package/docs/interfaces/IItemFormEditProps.html +2 -2
  54. package/docs/interfaces/IItemFormTab.html +2 -2
  55. package/docs/interfaces/IItemFormTabInfo.html +2 -2
  56. package/docs/interfaces/IItemFormViewProps.html +2 -2
  57. package/docs/interfaces/IListProps.html +2 -2
  58. package/docs/interfaces/IListSecurity.html +2 -2
  59. package/docs/interfaces/IListSecurityItem.html +2 -2
  60. package/docs/interfaces/IShowDialogProps.html +2 -2
  61. package/docs/modules.html +1 -0
  62. package/docs/variables/DattaTable.html +1 -1
  63. package/docs/variables/ListSecurityDefaultGroups.html +1 -1
  64. package/package.json +2 -2
  65. package/pnpm-lock.yaml +10 -10
@@ -76,6 +76,7 @@ export declare class ItemForm {
76
76
  private static _onShowForm?;
77
77
  private static _onSave;
78
78
  private static _onValidation;
79
+ private static _requestDigest;
79
80
  private static _tabInfo;
80
81
  private static _updateEvent;
81
82
  static set AutoClose(value: boolean);
@@ -185,28 +185,34 @@ var ItemForm = /** @class */ (function () {
185
185
  // Resolve the request
186
186
  resolve(null);
187
187
  };
188
- // See if the info already exists
189
- if (_this._info) {
190
- // Form information is already loaded
191
- onComplete();
192
- }
193
- else {
194
- // Set the list form properties
195
- var listProps = {
196
- listName: _this.ListName,
197
- itemId: itemId,
198
- webUrl: webUrl
199
- };
200
- // Call the event
201
- listProps = _this._onGetListInfo ? _this._onGetListInfo(listProps) : listProps;
202
- // Load the form info
203
- gd_sprest_bs_1.Helper.ListForm.create(listProps).then(function (info) {
204
- // Save the information
205
- _this._info = info;
188
+ // Get the context information
189
+ (0, _1.getContextInfo)(webUrl).then(function (requestDigest) {
190
+ // Set the request digest
191
+ _this._requestDigest = requestDigest;
192
+ // See if the info already exists
193
+ if (_this._info) {
206
194
  // Form information is already loaded
207
195
  onComplete();
208
- }, reject);
209
- }
196
+ }
197
+ else {
198
+ // Set the list form properties
199
+ var listProps = {
200
+ listName: _this.ListName,
201
+ itemId: itemId,
202
+ requestDigest: requestDigest,
203
+ webUrl: webUrl
204
+ };
205
+ // Call the event
206
+ listProps = _this._onGetListInfo ? _this._onGetListInfo(listProps) : listProps;
207
+ // Load the form info
208
+ gd_sprest_bs_1.Helper.ListForm.create(listProps).then(function (info) {
209
+ // Save the information
210
+ _this._info = info;
211
+ // Form information is already loaded
212
+ onComplete();
213
+ }, reject);
214
+ }
215
+ });
210
216
  });
211
217
  };
212
218
  // Renders the display form
@@ -516,6 +522,7 @@ var ItemForm = /** @class */ (function () {
516
522
  ItemForm._onShowForm = null;
517
523
  ItemForm._onSave = null;
518
524
  ItemForm._onValidation = null;
525
+ ItemForm._requestDigest = null;
519
526
  ItemForm._tabInfo = null;
520
527
  ItemForm._updateEvent = null;
521
528
  // Display Form
@@ -1,5 +1,5 @@
1
1
  import { Types } from "gd-sprest-bs";
2
- import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from "../common";
2
+ import { IItemFormCreateProps, IItemFormEditProps, IItemFormViewProps } from ".";
3
3
  /** List Properties */
4
4
  export interface IListProps<T = Types.SP.ListItem> {
5
5
  itemQuery?: Types.IODataQuery;
@@ -51,6 +51,7 @@ export declare class List<T = Types.SP.ListItem> {
51
51
  private _onLoadFormError;
52
52
  private _onRefreshItems?;
53
53
  private _onResetForm;
54
+ private _requestDigest;
54
55
  constructor(props: IListProps<T>);
55
56
  private clear;
56
57
  createItem(values: any): PromiseLike<T>;
@@ -62,6 +63,7 @@ export declare class List<T = Types.SP.ListItem> {
62
63
  private loadItemsByQuery;
63
64
  private loadItemsByView;
64
65
  refresh(query?: Types.IODataQuery): PromiseLike<T[]>;
66
+ private refreshContextInfo;
65
67
  refreshItem(itemId: number, query?: Types.IODataQuery): PromiseLike<T>;
66
68
  updateItem(itemId: number, values: any): PromiseLike<void>;
67
69
  viewForm(props: IItemFormViewProps): void;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.List = void 0;
4
4
  var gd_sprest_bs_1 = require("gd-sprest-bs");
5
- var common_1 = require("../common");
5
+ var _1 = require(".");
6
6
  /**
7
7
  * List
8
8
  */
@@ -45,6 +45,8 @@ var List = /** @class */ (function () {
45
45
  this._onRefreshItems = null;
46
46
  // Event triggered when the form is reset
47
47
  this._onResetForm = null;
48
+ // The request digest value of the target site
49
+ this._requestDigest = null;
48
50
  // Save the properties
49
51
  this._listName = props.listName;
50
52
  this._odata = props.itemQuery;
@@ -56,14 +58,25 @@ var List = /** @class */ (function () {
56
58
  this._onResetForm = props.onResetForm;
57
59
  this._viewName = props.viewName;
58
60
  this._webUrl = props.webUrl || gd_sprest_bs_1.ContextInfo.webServerRelativeUrl;
59
- // Load the list information
60
- this.init().then(function () {
61
- // Load the items
62
- _this.loadItems().then(function () {
63
- // Call the event
64
- _this._onInitialized ? _this._onInitialized() : null;
65
- // Call the items loaded event
66
- _this._onItemsLoaded ? _this._onItemsLoaded(_this.Items) : null;
61
+ // Set the context information
62
+ (0, _1.getContextInfo)(props.webUrl).then(function (requestDigest) {
63
+ _this._requestDigest = requestDigest;
64
+ // Load the list information
65
+ _this.init().then(function () {
66
+ // Load the items
67
+ _this.loadItems().then(function () {
68
+ // Call the event
69
+ _this._onInitialized ? _this._onInitialized() : null;
70
+ // Call the items loaded event
71
+ _this._onItemsLoaded ? _this._onItemsLoaded(_this.Items) : null;
72
+ }, function () {
73
+ var args = [];
74
+ for (var _i = 0; _i < arguments.length; _i++) {
75
+ args[_i] = arguments[_i];
76
+ }
77
+ // Call the init error event
78
+ _this._onInitError ? _this._onInitError.apply(_this, args) : null;
79
+ });
67
80
  }, function () {
68
81
  var args = [];
69
82
  for (var _i = 0; _i < arguments.length; _i++) {
@@ -84,13 +97,13 @@ var List = /** @class */ (function () {
84
97
  Object.defineProperty(List.prototype, "EditForm", {
85
98
  /** Public Properties */
86
99
  // Reference to the edit form
87
- get: function () { return common_1.ItemForm.EditForm; },
100
+ get: function () { return _1.ItemForm.EditForm; },
88
101
  enumerable: false,
89
102
  configurable: true
90
103
  });
91
104
  Object.defineProperty(List.prototype, "EditForms", {
92
105
  // Reference to the edit forms, if tabs are used
93
- get: function () { return common_1.ItemForm.EditForms; },
106
+ get: function () { return _1.ItemForm.EditForms; },
94
107
  enumerable: false,
95
108
  configurable: true
96
109
  });
@@ -136,13 +149,13 @@ var List = /** @class */ (function () {
136
149
  });
137
150
  Object.defineProperty(List.prototype, "ViewForm", {
138
151
  // Reference to the display form
139
- get: function () { return common_1.ItemForm.DisplayForm; },
152
+ get: function () { return _1.ItemForm.DisplayForm; },
140
153
  enumerable: false,
141
154
  configurable: true
142
155
  });
143
156
  Object.defineProperty(List.prototype, "ViewForms", {
144
157
  // Reference to the display forms, if tabs are used
145
- get: function () { return common_1.ItemForm.DisplayForms; },
158
+ get: function () { return _1.ItemForm.DisplayForms; },
146
159
  enumerable: false,
147
160
  configurable: true
148
161
  });
@@ -164,9 +177,9 @@ var List = /** @class */ (function () {
164
177
  // Clears the modal or canvas
165
178
  List.prototype.clear = function () {
166
179
  // Clear the modal/form
167
- common_1.ItemForm.UseModal ? common_1.Modal.clear() : common_1.CanvasForm.clear();
180
+ _1.ItemForm.UseModal ? _1.Modal.clear() : _1.CanvasForm.clear();
168
181
  // Set the list name
169
- common_1.ItemForm.ListName = this.ListName;
182
+ _1.ItemForm.ListName = this.ListName;
170
183
  // Call the event
171
184
  this._onResetForm ? this._onResetForm() : null;
172
185
  };
@@ -184,21 +197,21 @@ var List = /** @class */ (function () {
184
197
  // Clear the modal/canvas
185
198
  this.clear();
186
199
  // Display the form
187
- common_1.ItemForm.create(props).then(null, this._onLoadFormError);
200
+ _1.ItemForm.create(props).then(null, this._onLoadFormError);
188
201
  };
189
202
  // Displays the edit form
190
203
  List.prototype.editForm = function (props) {
191
204
  // Clear the modal/canvas
192
205
  this.clear();
193
206
  // Display the form
194
- common_1.ItemForm.edit(props).then(null, this._onLoadFormError);
207
+ _1.ItemForm.edit(props).then(null, this._onLoadFormError);
195
208
  };
196
209
  // Initializes the list component
197
210
  List.prototype.init = function () {
198
211
  var _this = this;
199
212
  // Return a promise
200
213
  return new Promise(function (resolve, reject) {
201
- var list = (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName);
214
+ var list = (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName);
202
215
  // Query the list content types
203
216
  list.execute(function (list) {
204
217
  // Save the list information
@@ -260,7 +273,7 @@ var List = /** @class */ (function () {
260
273
  // Return a promise
261
274
  return new Promise(function (resolve, reject) {
262
275
  // Query the items
263
- (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName).Items(itemId).query({
276
+ (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).Items(itemId).query({
264
277
  Custom: query ? query.Custom : null,
265
278
  Expand: query ? query.Expand : null,
266
279
  Select: query ? query.Select : null
@@ -319,7 +332,7 @@ var List = /** @class */ (function () {
319
332
  return;
320
333
  }
321
334
  // Query the items
322
- (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName).Items().query(query).execute(function (items) {
335
+ (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).Items().query(query).execute(function (items) {
323
336
  // Save the items
324
337
  _this._items = items.results;
325
338
  // Resolve the request
@@ -345,7 +358,7 @@ var List = /** @class */ (function () {
345
358
  return;
346
359
  }
347
360
  // Query the items
348
- (0, gd_sprest_bs_1.Web)(_this.WebUrl).Lists(_this.ListName).getItems(_this.ViewXml).execute(function (items) {
361
+ (0, gd_sprest_bs_1.Web)(_this.WebUrl, { requestDigest: _this._requestDigest }).Lists(_this.ListName).getItems(_this.ViewXml).execute(function (items) {
349
362
  // Save the items
350
363
  _this._items = items.results;
351
364
  // Resolve the request
@@ -368,21 +381,44 @@ var List = /** @class */ (function () {
368
381
  this._items = null;
369
382
  // Return a promise
370
383
  return new Promise(function (resolve, reject) {
371
- // Load the data
372
- _this.loadItems(query).then(function (items) {
373
- // Call the event
374
- var callback = _this._onRefreshItems ? _this._onRefreshItems(items) : null;
375
- if (callback && typeof (callback.then) === "function") {
376
- // Wait for the request to complete
377
- callback.then(resolve, reject);
378
- }
379
- else {
380
- // Resolve the request
381
- resolve(items);
382
- }
384
+ // Refresh the context information
385
+ _this.refreshContextInfo().then(function () {
386
+ // Load the data
387
+ _this.loadItems(query).then(function (items) {
388
+ // Call the event
389
+ var callback = _this._onRefreshItems ? _this._onRefreshItems(items) : null;
390
+ if (callback && typeof (callback.then) === "function") {
391
+ // Wait for the request to complete
392
+ callback.then(resolve, reject);
393
+ }
394
+ else {
395
+ // Resolve the request
396
+ resolve(items);
397
+ }
398
+ }, reject);
383
399
  }, reject);
384
400
  });
385
401
  };
402
+ // Refreshes the context information
403
+ List.prototype.refreshContextInfo = function () {
404
+ var _this = this;
405
+ // Return a promise
406
+ return new Promise(function (resolve, reject) {
407
+ // See if the request digest is set
408
+ if (_this._requestDigest) {
409
+ // Get the context information
410
+ (0, _1.getContextInfo)(_this.WebUrl).then(function (requestDigest) {
411
+ // Save the value and resolve the request
412
+ _this._requestDigest = requestDigest;
413
+ resolve();
414
+ }, reject);
415
+ }
416
+ else {
417
+ // Resolve the request
418
+ resolve();
419
+ }
420
+ });
421
+ };
386
422
  // Refresh the data
387
423
  List.prototype.refreshItem = function (itemId, query) {
388
424
  if (query === void 0) { query = this.OData; }
@@ -403,7 +439,7 @@ var List = /** @class */ (function () {
403
439
  // Clear the modal/canvas
404
440
  this.clear();
405
441
  // Display the form
406
- common_1.ItemForm.view(props).then(null, this._onLoadFormError);
442
+ _1.ItemForm.view(props).then(null, this._onLoadFormError);
407
443
  };
408
444
  return List;
409
445
  }());
@@ -27,6 +27,7 @@ export declare class ListSecurity {
27
27
  private _ddlItems;
28
28
  private _permissionTypes;
29
29
  private _props;
30
+ private _requestDigest;
30
31
  private _currentUser;
31
32
  get CurrentUser(): Types.SP.User;
32
33
  private _groups;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListSecurity = exports.ListSecurityDefaultGroups = void 0;
4
4
  var gd_sprest_bs_1 = require("gd-sprest-bs");
5
5
  var loadingDialog_1 = require("./loadingDialog");
6
+ var methods_1 = require("./methods");
6
7
  var modal_1 = require("./modal");
7
8
  // List Security Default Groups
8
9
  exports.ListSecurityDefaultGroups = {
@@ -17,9 +18,11 @@ exports.ListSecurityDefaultGroups = {
17
18
  var ListSecurity = /** @class */ (function () {
18
19
  // Constructor
19
20
  function ListSecurity(props) {
21
+ var _this = this;
20
22
  this._ddlItems = null;
21
23
  this._permissionTypes = null;
22
24
  this._props = null;
25
+ this._requestDigest = null;
23
26
  // Current User
24
27
  this._currentUser = null;
25
28
  // Security group information
@@ -28,12 +31,17 @@ var ListSecurity = /** @class */ (function () {
28
31
  this._groupUsers = {};
29
32
  // Save the properties
30
33
  this._props = props;
31
- // Get the current user information
32
- this.loadCurrentUser();
33
- // Get the permission types
34
- this.getPermissionTypes();
35
- // Load the groups
36
- this.loadGroups();
34
+ // Get the context information
35
+ (0, methods_1.getContextInfo)(this._props.webUrl).then(function (requestDigest) {
36
+ // Set the request digest value
37
+ _this._requestDigest = requestDigest;
38
+ // Get the current user information
39
+ _this.loadCurrentUser();
40
+ // Get the permission types
41
+ _this.getPermissionTypes();
42
+ // Load the groups
43
+ _this.loadGroups();
44
+ });
37
45
  }
38
46
  Object.defineProperty(ListSecurity.prototype, "CurrentUser", {
39
47
  get: function () { return this._currentUser; },
@@ -109,7 +117,7 @@ var ListSecurity = /** @class */ (function () {
109
117
  // Exists
110
118
  function (groupId) {
111
119
  // Add the group to the list
112
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {
120
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).Lists(listInfo.listName).RoleAssignments().addRoleAssignment(groupId, permissionId).execute(resolve, function () {
113
121
  // Log to the console
114
122
  console.error("[".concat(listInfo.listName, "] Error adding the group '").concat(listInfo.groupName, "' with permission ").concat(listInfo.permission, " to the list."));
115
123
  // Resolve the request
@@ -191,7 +199,7 @@ var ListSecurity = /** @class */ (function () {
191
199
  // Call the event if it exists
192
200
  props = _this._props.onGroupCreating ? _this._props.onGroupCreating(props) : props;
193
201
  // Create the group
194
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().add(props).execute(
202
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).SiteGroups().add(props).execute(
195
203
  // Successfully created the group
196
204
  function (group) {
197
205
  // Set the group id
@@ -229,7 +237,7 @@ var ListSecurity = /** @class */ (function () {
229
237
  switch (key) {
230
238
  // Default owner's group
231
239
  case exports.ListSecurityDefaultGroups.Owners:
232
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedOwnerGroup().query({
240
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).AssociatedOwnerGroup().query({
233
241
  Expand: ["Users"]
234
242
  }).execute(function (group) {
235
243
  _this.setGroup(key, group);
@@ -239,7 +247,7 @@ var ListSecurity = /** @class */ (function () {
239
247
  break;
240
248
  // Default member's group
241
249
  case exports.ListSecurityDefaultGroups.Members:
242
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedMemberGroup().query({
250
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).AssociatedMemberGroup().query({
243
251
  Expand: ["Users"]
244
252
  }).execute(function (group) {
245
253
  _this.setGroup(key, group);
@@ -249,7 +257,7 @@ var ListSecurity = /** @class */ (function () {
249
257
  break;
250
258
  // Default visitor's group
251
259
  case exports.ListSecurityDefaultGroups.Visitors:
252
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).AssociatedVisitorGroup().query({
260
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).AssociatedVisitorGroup().query({
253
261
  Expand: ["Users"]
254
262
  }).execute(function (group) {
255
263
  _this.setGroup(key, group);
@@ -260,7 +268,7 @@ var ListSecurity = /** @class */ (function () {
260
268
  // Default
261
269
  default:
262
270
  // Get the group
263
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).SiteGroups().getByName(groupName).query({
271
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).SiteGroups().getByName(groupName).query({
264
272
  Expand: ["Users"]
265
273
  }).execute(function (group) {
266
274
  _this.setGroup(key, group);
@@ -276,7 +284,7 @@ var ListSecurity = /** @class */ (function () {
276
284
  // Return a promise
277
285
  return new Promise(function (resolve) {
278
286
  // Get the definitions
279
- (0, gd_sprest_bs_1.Web)(_this._props.webUrl).RoleDefinitions().query({
287
+ (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).RoleDefinitions().query({
280
288
  OrderBy: ["Name"]
281
289
  }).execute(function (roleDefs) {
282
290
  // Clear the permissions and items
@@ -316,7 +324,7 @@ var ListSecurity = /** @class */ (function () {
316
324
  ListSecurity.prototype.loadCurrentUser = function () {
317
325
  var _this = this;
318
326
  // Load the current user
319
- (0, gd_sprest_bs_1.Web)(this._props.webUrl).CurrentUser().execute(
327
+ (0, gd_sprest_bs_1.Web)(this._props.webUrl, { requestDigest: this._requestDigest }).CurrentUser().execute(
320
328
  // Success
321
329
  function (user) {
322
330
  // Set the user
@@ -539,7 +547,7 @@ var ListSecurity = /** @class */ (function () {
539
547
  return new Promise(function (resolve) {
540
548
  // Parse the list keys
541
549
  for (var listName in lists) {
542
- var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl).Lists(listName);
550
+ var list = (0, gd_sprest_bs_1.Web)(_this._props.webUrl, { requestDigest: _this._requestDigest }).Lists(listName);
543
551
  // Reset the permissions
544
552
  list.resetRoleInheritance().execute();
545
553
  // Revert to the default
@@ -1,4 +1,5 @@
1
1
  export declare const formatBytes: (bytes: number, decimals?: number) => string;
2
2
  export declare const formatDateValue: (value: string, format?: string) => string;
3
3
  export declare const formatTimeValue: (value: string, format?: string) => string;
4
+ export declare const getContextInfo: (webUrl: string) => PromiseLike<string>;
4
5
  export declare const getFileExt: (fileName?: string) => string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFileExt = exports.formatTimeValue = exports.formatDateValue = exports.formatBytes = void 0;
3
+ exports.getFileExt = exports.getContextInfo = exports.formatTimeValue = exports.formatDateValue = exports.formatBytes = void 0;
4
+ var gd_sprest_bs_1 = require("gd-sprest-bs");
4
5
  var moment = require("moment");
5
6
  // Formats file size into human readable form
6
7
  var formatBytes = function (bytes, decimals) {
@@ -39,6 +40,25 @@ var formatTimeValue = function (value, format) {
39
40
  return "";
40
41
  };
41
42
  exports.formatTimeValue = formatTimeValue;
43
+ // Gets the context information of the target site
44
+ var getContextInfo = function (webUrl) {
45
+ // Return a promise
46
+ return new Promise(function (resolve, reject) {
47
+ // See if the web url exists
48
+ if (webUrl) {
49
+ // Get the context info of the site
50
+ gd_sprest_bs_1.ContextInfo.getWeb(webUrl).execute(function (info) {
51
+ // Resolve the request
52
+ resolve(info.GetContextWebInformation.FormDigestValue);
53
+ }, reject);
54
+ }
55
+ else {
56
+ // Resolve the request
57
+ resolve(null);
58
+ }
59
+ });
60
+ };
61
+ exports.getContextInfo = getContextInfo;
42
62
  // Returns the extension of a file name
43
63
  var getFileExt = function (fileName) {
44
64
  if (fileName === void 0) { fileName = ""; }
package/build/lib.d.ts CHANGED
@@ -29,6 +29,7 @@ export declare const DattaTable: {
29
29
  formatBytes: (bytes: number, decimals?: number) => string;
30
30
  formatDateValue: (value: string, format?: string) => string;
31
31
  formatTimeValue: (value: string, format?: string) => string;
32
+ getContextInfo: (webUrl: string) => PromiseLike<string>;
32
33
  getFileExt: (fileName?: string) => string;
33
34
  Modal: typeof Common.Modal;
34
35
  Timeout: typeof Common.Timeout;