gd-sprest 9.7.1 → 9.7.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.
@@ -76,9 +76,6 @@ export interface IBase<Type = any, Result = Type, QueryResult = Result> extends
76
76
  /** Gets the property. */
77
77
  getProperty(propertyName: string, requestType?: string);
78
78
 
79
- /** Returns the root base object. */
80
- root(): IBase;
81
-
82
79
  /** Stops any requests for a batch or query. */
83
80
  stop();
84
81
 
@@ -27,6 +27,9 @@ export interface IBaseHelper {
27
27
  /** Gets the XHR request information. */
28
28
  getRequestInfo(base: IBase): IRequestInfo;
29
29
 
30
+ /** Returns the root base object. */
31
+ getRootParent(base: IBase): IBase;
32
+
30
33
  /** Converts the base object to a JSON string. */
31
34
  stringify(base: IBase): string;
32
35
 
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.71,
12
+ __ver: 9.72,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -52,10 +52,6 @@ var Base = /** @class */ (function () {
52
52
  Base.prototype.getProperty = function (propertyName, requestType) { return _1.Helper.getProperty(this, propertyName, requestType); };
53
53
  // Method to get the request digest value
54
54
  Base.prototype.getRequestDigest = function () { return this.targetInfo.requestDigest; };
55
- // Returns the root base object
56
- Base.prototype.root = function () { var root = this; while (root.parent) {
57
- root = root.parent;
58
- } return root; };
59
55
  // Method to stop any requests related to getting all items with the query
60
56
  Base.prototype.stop = function () { this.stopFl = true; };
61
57
  // Method to stringify the object
@@ -21,7 +21,6 @@ exports.Helper = {
21
21
  obj["getCollection"] = base.getCollection;
22
22
  obj["getProperty"] = base.getProperty;
23
23
  obj["parent"] = base;
24
- obj["root"] = base.root;
25
24
  obj["stop"] = base.stop;
26
25
  obj["targetInfo"] = base.targetInfo;
27
26
  obj["updateMetadataUri"] = base.updateMetadataUri;
@@ -227,6 +226,14 @@ exports.Helper = {
227
226
  // Return the request information
228
227
  return xhr.requestInfo;
229
228
  },
229
+ getRootParent: function (base) {
230
+ // Find the root base object and return it
231
+ var root = base;
232
+ while (root.parent) {
233
+ root = root.parent;
234
+ }
235
+ return root;
236
+ },
230
237
  // Method to stringify the object
231
238
  stringify: function (base) {
232
239
  // Stringify the object
@@ -435,7 +435,7 @@ exports.Request = {
435
435
  var isBatchRequest = base.base && base.base.batchRequests && base.base.batchRequests.length > 0;
436
436
  if (isBatchRequest) {
437
437
  var batchIdx_1 = 0;
438
- var root_1 = base.root();
438
+ var root_1 = helper_1.Helper.getRootParent(base);
439
439
  // Parse the requests
440
440
  (0, executor_1.Executor)(base.base.batchRequests, function (batchRequest) {
441
441
  // Do nothing if the stop flag is set
@@ -708,7 +708,7 @@ exports.Request = {
708
708
  // See if there are more items to get
709
709
  if (base.nextFl) {
710
710
  // Get the root base object
711
- var root = base.root();
711
+ var root = helper_1.Helper.getRootParent(base);
712
712
  // See if we are getting all items in the base request
713
713
  if (base.getAllItemsFl && root.stopFl != true) {
714
714
  // Create the target information to query the next set of results
@@ -7457,9 +7457,6 @@ declare module 'gd-sprest/utils/base' {
7457
7457
  /** Gets the property. */
7458
7458
  getProperty(propertyName: string, requestType?: string);
7459
7459
 
7460
- /** Returns the root base object. */
7461
- root(): IBase;
7462
-
7463
7460
  /** Stops any requests for a batch or query. */
7464
7461
  stop();
7465
7462
 
@@ -7529,6 +7526,9 @@ declare module 'gd-sprest/utils/helper' {
7529
7526
  /** Gets the XHR request information. */
7530
7527
  getRequestInfo(base: IBase): IRequestInfo;
7531
7528
 
7529
+ /** Returns the root base object. */
7530
+ getRootParent(base: IBase): IBase;
7531
+
7532
7532
  /** Converts the base object to a JSON string. */
7533
7533
  stringify(base: IBase): string;
7534
7534