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.
- package/@types/utils/targetInfo.d.ts +3 -0
- package/FUNDING.yml +2 -0
- package/build/rest.js +1 -1
- package/build/utils/oData.js +9 -0
- package/build/utils/request.js +17 -8
- package/dist/gd-sprest.d.ts +3 -0
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +2 -2
|
@@ -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
package/build/rest.js
CHANGED
package/build/utils/oData.js
CHANGED
|
@@ -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; },
|
package/build/utils/request.js
CHANGED
|
@@ -361,8 +361,11 @@ exports.Request = {
|
|
|
361
361
|
callback ? callback(base.response, errorFl) : null;
|
|
362
362
|
}
|
|
363
363
|
else {
|
|
364
|
-
//
|
|
365
|
-
|
|
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
|
-
//
|
|
411
|
-
|
|
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
|
-
//
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
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);
|
package/dist/gd-sprest.d.ts
CHANGED
|
@@ -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
|
|