gd-sprest 7.9.2 → 7.9.4
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/lib/search.d.ts +1 -1
- package/@types/utils/helper.d.ts +3 -0
- package/build/rest.js +1 -1
- package/build/utils/helper.js +24 -0
- package/build/utils/methodInfo.js +4 -1
- package/build/utils/request.js +2 -0
- package/dist/gd-sprest.d.ts +4 -1
- package/dist/gd-sprest.js +1 -1
- package/dist/gd-sprest.min.js +1 -1
- package/package.json +1 -1
package/@types/lib/search.d.ts
CHANGED
package/@types/utils/helper.d.ts
CHANGED
package/build/rest.js
CHANGED
package/build/utils/helper.js
CHANGED
|
@@ -370,5 +370,29 @@ exports.Helper = {
|
|
|
370
370
|
// Fix the url reference
|
|
371
371
|
targetInfo.url = targetInfo.url.split("Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.CorporateCatalogAppMetadata")[0] + "web/tenantappcatalog/availableapps/getbyid('" + base["ID"] + "')";
|
|
372
372
|
}
|
|
373
|
+
},
|
|
374
|
+
// Method to update the search results
|
|
375
|
+
updateSearchResults: function (base) {
|
|
376
|
+
var _a;
|
|
377
|
+
// See if this contains search results
|
|
378
|
+
var results = base["postquery"] && base["postquery"].results;
|
|
379
|
+
if (results == null) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
// Clear the results
|
|
383
|
+
base["results"] = base["results"] || [];
|
|
384
|
+
// Parse the results
|
|
385
|
+
for (var i = 0; i < results.PrimaryQueryResult.RelevantResults.RowCount; i++) {
|
|
386
|
+
var data = {};
|
|
387
|
+
var result = results.PrimaryQueryResult.RelevantResults.Table.Rows.results[i];
|
|
388
|
+
// Parse the cells
|
|
389
|
+
for (var j = 0; j < result.Cells.results.length; j++) {
|
|
390
|
+
var cell = result.Cells.results[j];
|
|
391
|
+
// Add the key/value
|
|
392
|
+
data[cell.Key] = cell.Value;
|
|
393
|
+
}
|
|
394
|
+
// Append the result
|
|
395
|
+
(_a = base["results"]) === null || _a === void 0 ? void 0 : _a.push(data);
|
|
396
|
+
}
|
|
373
397
|
}
|
|
374
398
|
};
|
|
@@ -172,8 +172,11 @@ var MethodInfo = /** @class */ (function () {
|
|
|
172
172
|
// Replace the argument in the template
|
|
173
173
|
this.methodInfo.data = this.methodInfo.data.replace("[[" + key + "]]", this.methodParams[key].replace(/"/g, '\\"').replace(/\n/g, ""));
|
|
174
174
|
}
|
|
175
|
+
// For custom format properties of fields, we need to escape \\quot;
|
|
176
|
+
// Replace \\" with \\\\"
|
|
177
|
+
var methodData = this.methodInfo.data.replace(/\\"/g, '\\\\"');
|
|
175
178
|
// Set the method data
|
|
176
|
-
this.methodData = JSON.parse(
|
|
179
|
+
this.methodData = JSON.parse(methodData);
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
// See if argument values exist
|
package/build/utils/request.js
CHANGED
|
@@ -570,6 +570,8 @@ exports.Request = {
|
|
|
570
570
|
helper_1.Helper.updateDataCollection(obj, data.d.results);
|
|
571
571
|
// Update the expanded properties
|
|
572
572
|
helper_1.Helper.updateExpandedProperties(obj);
|
|
573
|
+
// Update the search results
|
|
574
|
+
helper_1.Helper.updateSearchResults(obj);
|
|
573
575
|
}
|
|
574
576
|
// Else, see if this is a graph request
|
|
575
577
|
else if (data["@odata.context"]) {
|
package/dist/gd-sprest.d.ts
CHANGED
|
@@ -1654,7 +1654,7 @@ declare module 'gd-sprest/lib/search' {
|
|
|
1654
1654
|
* Method to execute a post query
|
|
1655
1655
|
* @param
|
|
1656
1656
|
*/
|
|
1657
|
-
postQuery(props: ISearchPostQuery): PromiseLike<SearchResult
|
|
1657
|
+
postQuery<T = any>(props: ISearchPostQuery): PromiseLike<SearchResult<T>>;
|
|
1658
1658
|
}
|
|
1659
1659
|
}
|
|
1660
1660
|
|
|
@@ -7103,6 +7103,9 @@ declare module 'gd-sprest/utils/helper' {
|
|
|
7103
7103
|
|
|
7104
7104
|
/** Updates the metdata uri. */
|
|
7105
7105
|
updateMetadataUri(base: IBase, metadata, targetInfo: ITargetInfoProps);
|
|
7106
|
+
|
|
7107
|
+
/** Updates the search results. */
|
|
7108
|
+
updateSearchResults(base: IBase);
|
|
7106
7109
|
}
|
|
7107
7110
|
}
|
|
7108
7111
|
|