gd-sprest 9.7.1 → 9.7.3
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/base.d.ts +0 -6
- package/@types/utils/helper.d.ts +3 -0
- package/build/rest.js +1 -1
- package/build/utils/base.js +0 -4
- package/build/utils/helper.js +8 -1
- package/build/utils/request.js +2 -2
- package/dist/gd-sprest.d.ts +3 -6
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +2 -2
package/@types/utils/base.d.ts
CHANGED
|
@@ -76,12 +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
|
-
/** Stops any requests for a batch or query. */
|
|
83
|
-
stop();
|
|
84
|
-
|
|
85
79
|
/** Updates the metdata uri. */
|
|
86
80
|
updateMetadataUri(metadata, targetInfo: ITargetInfoProps);
|
|
87
81
|
|
package/@types/utils/helper.d.ts
CHANGED
|
@@ -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
package/build/utils/base.js
CHANGED
|
@@ -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
|
package/build/utils/helper.js
CHANGED
|
@@ -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
|
package/build/utils/request.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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
|
package/dist/gd-sprest.d.ts
CHANGED
|
@@ -7457,12 +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
|
-
/** Stops any requests for a batch or query. */
|
|
7464
|
-
stop();
|
|
7465
|
-
|
|
7466
7460
|
/** Updates the metdata uri. */
|
|
7467
7461
|
updateMetadataUri(metadata, targetInfo: ITargetInfoProps);
|
|
7468
7462
|
|
|
@@ -7529,6 +7523,9 @@ declare module 'gd-sprest/utils/helper' {
|
|
|
7529
7523
|
/** Gets the XHR request information. */
|
|
7530
7524
|
getRequestInfo(base: IBase): IRequestInfo;
|
|
7531
7525
|
|
|
7526
|
+
/** Returns the root base object. */
|
|
7527
|
+
getRootParent(base: IBase): IBase;
|
|
7528
|
+
|
|
7532
7529
|
/** Converts the base object to a JSON string. */
|
|
7533
7530
|
stringify(base: IBase): string;
|
|
7534
7531
|
|