gd-sprest 8.2.0 → 8.2.2

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.
@@ -34,6 +34,9 @@ export interface IListForm {
34
34
  */
35
35
  refreshItem(info: IListFormResult): PromiseLike<IListFormResult>;
36
36
 
37
+ /** Method to refresh the request digest value. */
38
+ refreshRequestDigest(info: IListFormResult): PromiseLike<void>;
39
+
37
40
  /**
38
41
  * Method to remove attachment from an item.
39
42
  */
@@ -438,6 +438,20 @@ exports.ListForm = {
438
438
  }, reject);
439
439
  });
440
440
  },
441
+ // Method to refresh the request digest value
442
+ refreshRequestDigest: function (info) {
443
+ // Return a promise
444
+ return new Promise(function (resolve, reject) {
445
+ // Get the context info
446
+ __1.ContextInfo.getWeb(info.webUrl).execute(function (context) {
447
+ // Update the request digest value
448
+ info.item.updateRequestDigest(context.GetContextWebInformation.FormDigestValue);
449
+ info.list.updateRequestDigest(context.GetContextWebInformation.FormDigestValue);
450
+ // Resolve the request
451
+ resolve();
452
+ }, reject);
453
+ });
454
+ },
441
455
  // Method to remove attachments from an item
442
456
  removeAttachment: function (info, fileName) {
443
457
  // Return a promise
@@ -523,7 +537,7 @@ exports.ListForm = {
523
537
  // Resolve the promise
524
538
  resolve(info);
525
539
  }, reject);
526
- });
540
+ }, reject);
527
541
  }
528
542
  else {
529
543
  // Set the metadata type
@@ -538,7 +552,7 @@ exports.ListForm = {
538
552
  exports.ListForm.refreshItem(info).then(function (info) {
539
553
  // Resolve the promise
540
554
  resolve(info);
541
- });
555
+ }, reject);
542
556
  }, reject);
543
557
  }
544
558
  });
package/build/rest.js CHANGED
@@ -9,7 +9,7 @@ var sptypes_1 = require("./sptypes");
9
9
  * SharePoint REST Library
10
10
  */
11
11
  exports.$REST = {
12
- __ver: 8.20,
12
+ __ver: 8.22,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -54,6 +54,8 @@ var Base = /** @class */ (function () {
54
54
  Base.prototype.stringify = function () { return _1.Helper.stringify(this); };
55
55
  // Method to update the metadata uri
56
56
  Base.prototype.updateMetadataUri = function (metadata, targetInfo) { return _1.Helper.updateMetadataUri(this, metadata, targetInfo); };
57
+ // Method to update the request digest value
58
+ Base.prototype.updateRequestDigest = function (value) { this.targetInfo.requestDigest = value; };
57
59
  // Method to wait for the parent requests to complete
58
60
  Base.prototype.waitForRequestsToComplete = function (callback, requestIdx) { _1.Request.waitForRequestsToComplete(this, callback, requestIdx); };
59
61
  return Base;
@@ -2401,6 +2401,9 @@ declare module 'gd-sprest/helper/listForm' {
2401
2401
  */
2402
2402
  refreshItem(info: IListFormResult): PromiseLike<IListFormResult>;
2403
2403
 
2404
+ /** Method to refresh the request digest value. */
2405
+ refreshRequestDigest(info: IListFormResult): PromiseLike<void>;
2406
+
2404
2407
  /**
2405
2408
  * Method to remove attachment from an item.
2406
2409
  */