gd-sprest 8.9.5 → 8.9.7

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.
@@ -54,6 +54,9 @@ export interface ITargetInfoProps {
54
54
  /** Sets the Cache-Control header to no-cache */
55
55
  disableCache?: boolean;
56
56
 
57
+ /** True to not process the response, when dealing with querying large lists. */
58
+ disableProcessing?: boolean;
59
+
57
60
  /** The endpoint of the request. */
58
61
  endpoint?: string;
59
62
 
package/FUNDING.yml ADDED
@@ -0,0 +1,2 @@
1
+ github: [octocat, surftocat]
2
+ custom: [https://paypal.me/Dattabase, dattabase.com]
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.95,
12
+ __ver: 8.97,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,
@@ -19,6 +19,7 @@ var OData = /** @class */ (function () {
19
19
  this._search = oData && oData.Search ? oData.Search : null;
20
20
  this._select = oData && oData.Select ? oData.Select : [];
21
21
  this._skip = oData && oData.Skip ? oData.Skip : null;
22
+ this._skipToken = oData && oData.SkipToken ? oData.SkipToken : null;
22
23
  this._top = oData && oData.Top ? oData.Top : null;
23
24
  }
24
25
  Object.defineProperty(OData.prototype, "Custom", {
@@ -69,6 +70,7 @@ var OData = /** @class */ (function () {
69
70
  values.push(this.getQSValue("$orderby", this._orderBy));
70
71
  this._top ? values.push("$top=" + this._top) : null;
71
72
  this._skip ? values.push("$skip=" + this._skip) : null;
73
+ this._skipToken ? values.push("$skipToken=" + encodeURIComponent("Paged=TRUE&p_ID=" + this._skipToken)) : null;
72
74
  this._filter ? values.push("$filter=" + this._filter) : null;
73
75
  this._search ? values.push("$search=" + this._search) : null;
74
76
  values.push(this.getQSValue("$expand", this._expand));
@@ -109,6 +111,13 @@ var OData = /** @class */ (function () {
109
111
  enumerable: false,
110
112
  configurable: true
111
113
  });
114
+ Object.defineProperty(OData.prototype, "SkipToken", {
115
+ // Skip Token
116
+ get: function () { return this._skipToken; },
117
+ set: function (value) { this._skipToken = value; },
118
+ enumerable: false,
119
+ configurable: true
120
+ });
112
121
  Object.defineProperty(OData.prototype, "Top", {
113
122
  // Top
114
123
  get: function () { return this._top; },
@@ -361,8 +361,11 @@ exports.Request = {
361
361
  callback ? callback(base.response, errorFl) : null;
362
362
  }
363
363
  else {
364
- // Update the data object
365
- exports.Request.updateDataObject(base, isBatchRequest, batchIdx);
364
+ // See if we are not bypassing the processing of the response
365
+ if (base.targetInfo.disableProcessing != true) {
366
+ // Update the data object
367
+ exports.Request.updateDataObject(base, isBatchRequest, batchIdx);
368
+ }
366
369
  // Ensure this isn't a batch request
367
370
  if (!isBatchRequest) {
368
371
  // See if this is an xml response
@@ -407,8 +410,11 @@ exports.Request = {
407
410
  // Return the response
408
411
  return base.response;
409
412
  }
410
- // Update the base object
411
- exports.Request.updateDataObject(base, isBatchRequest, batchIdx);
413
+ // See if we are not bypassing the processing of the response
414
+ if (base.targetInfo.disableProcessing != true) {
415
+ // Update the base object
416
+ exports.Request.updateDataObject(base, isBatchRequest, batchIdx);
417
+ }
412
418
  // See if the base is a collection and has more results
413
419
  if (base["@odata.nextLink"] || (base["d"] && base["d"].__next)) {
414
420
  // Add the "next" method to get the next set of results
@@ -673,10 +679,13 @@ exports.Request = {
673
679
  // Convert the response and see if values were returned
674
680
  var data = JSON.parse(xhr.response);
675
681
  if (data.d || data.value) {
676
- // Update the data collection
677
- helper_1.Helper.updateDataCollection(base, ((_a = data.d) === null || _a === void 0 ? void 0 : _a.results) || data.value);
678
- // Update the expanded properties
679
- helper_1.Helper.updateExpandedProperties(base);
682
+ // See if we are not bypassing the processing of the response
683
+ if (base.targetInfo.disableProcessing != true) {
684
+ // Update the data collection
685
+ helper_1.Helper.updateDataCollection(base, ((_a = data.d) === null || _a === void 0 ? void 0 : _a.results) || data.value);
686
+ // Update the expanded properties
687
+ helper_1.Helper.updateExpandedProperties(base);
688
+ }
680
689
  // Append the raw data results
681
690
  if ((_b = base["d"]) === null || _b === void 0 ? void 0 : _b.results) {
682
691
  base["d"].results = base["d"].results.concat((_c = data.d) === null || _c === void 0 ? void 0 : _c.results);
@@ -7380,6 +7380,9 @@ declare module 'gd-sprest/utils/targetInfo' {
7380
7380
  /** Sets the Cache-Control header to no-cache */
7381
7381
  disableCache?: boolean;
7382
7382
 
7383
+ /** True to not process the response, when dealing with querying large lists. */
7384
+ disableProcessing?: boolean;
7385
+
7383
7386
  /** The endpoint of the request. */
7384
7387
  endpoint?: string;
7385
7388