gd-sprest 9.0.9 → 9.1.1

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.
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: 9.09,
12
+ __ver: 9.11,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -579,6 +579,14 @@ exports.Request = {
579
579
  }
580
580
  // Else, see if the data properties exists
581
581
  else if (data.d) {
582
+ // Get the endpoint method to see if it's part of the response
583
+ var endpointInfo = base.targetInfo.endpoint.split('/');
584
+ var endpointMethod = endpointInfo[endpointInfo.length - 1] || "";
585
+ endpointMethod = endpointMethod[0].toUpperCase() + endpointMethod.substring(1);
586
+ if (data.d[endpointMethod]) {
587
+ // Update the response to be that object
588
+ data.d = data.d[endpointMethod];
589
+ }
582
590
  // Save a reference to it
583
591
  obj["d"] = data.d;
584
592
  // Update the metadata
@@ -36,6 +36,11 @@ var TargetInfo = /** @class */ (function () {
36
36
  this.props.url || "",
37
37
  this.props.endpoint
38
38
  ].join('/').replace(/\/\//g, '/').replace(/\/$/, '');
39
+ // Fix the url from above, it will remove a '/' from the beginning
40
+ if (this.requestUrl.indexOf("https://") != this.requestUrl.indexOf("https:/")) {
41
+ // Fix the beginning of the url
42
+ this.requestUrl = this.requestUrl.replace("https:/", "https://");
43
+ }
39
44
  }
40
45
  }
41
46
  else {