@microsoft/sp-search-extensibility 1.17.4 → 1.18.0-beta.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.
- package/dist/4958ea79-6ff3-4480-8291-0932dd010869.manifest.json +6 -6
- package/dist/{sp-search-extensibility_none_a61ae5acaa5d9eeaaec5.js → sp-search-extensibility_none_03617cff226ab88343b0.js} +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/lib-commonjs/SearchQueryExtensionManager.js +1 -1
- package/lib-commonjs/SearchQueryExtensionManager.test.js +5 -6
- package/lib-commonjs/tab/SearchQueryModifier.js +7 -5
- package/package.json +14 -14
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"id": "4958ea79-6ff3-4480-8291-0932dd010869",
|
|
4
4
|
"alias": "SPSearchExtensibility",
|
|
5
5
|
"componentType": "Library",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.18.0",
|
|
7
7
|
"loaderConfig": {
|
|
8
8
|
"internalModuleBaseUrls": [
|
|
9
9
|
"https://localhost:4321/dist/"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"scriptResources": {
|
|
13
13
|
"sp-search-extensibility": {
|
|
14
14
|
"type": "path",
|
|
15
|
-
"path": "sp-search-
|
|
15
|
+
"path": "sp-search-extensibility_none_03617cff226ab88343b0.js"
|
|
16
16
|
},
|
|
17
17
|
"tslib": {
|
|
18
18
|
"type": "component",
|
|
@@ -22,22 +22,22 @@
|
|
|
22
22
|
"@microsoft/sp-loader": {
|
|
23
23
|
"type": "component",
|
|
24
24
|
"id": "1c6c9123-7aac-41f3-a376-3caea41ed83f",
|
|
25
|
-
"version": "1.
|
|
25
|
+
"version": "1.18.0"
|
|
26
26
|
},
|
|
27
27
|
"@microsoft/sp-core-library": {
|
|
28
28
|
"type": "component",
|
|
29
29
|
"id": "7263c7d0-1d6a-45ec-8d85-d4d1d234171b",
|
|
30
|
-
"version": "1.
|
|
30
|
+
"version": "1.18.0"
|
|
31
31
|
},
|
|
32
32
|
"@microsoft/sp-extension-base": {
|
|
33
33
|
"type": "component",
|
|
34
34
|
"id": "0773bd53-a69e-4293-87e6-ba80ea4d614b",
|
|
35
|
-
"version": "1.
|
|
35
|
+
"version": "1.18.0"
|
|
36
36
|
},
|
|
37
37
|
"@microsoft/sp-diagnostics": {
|
|
38
38
|
"type": "component",
|
|
39
39
|
"id": "78359e4b-07c2-43c6-8d0b-d060b4d577e8",
|
|
40
|
-
"version": "1.
|
|
40
|
+
"version": "1.18.0"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
define("4958ea79-6ff3-4480-8291-0932dd010869_1.
|
|
1
|
+
define("4958ea79-6ff3-4480-8291-0932dd010869_1.18.0",["tslib","@microsoft/sp-loader","@microsoft/sp-core-library","@microsoft/sp-extension-base","@microsoft/sp-diagnostics"],function(n,a,i,r,o){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="mwqp")}({"17wl":function(e,t){e.exports=n},I6O9:function(e,t){e.exports=a},UWqr:function(e,t){e.exports=i},ZFc5:function(e,t){e.exports=r},mwqp:function(e,t,n){"use strict";n.r(t),n.d(t,"BaseSearchQueryModifier",function(){return s}),n.d(t,"SearchQueryScenario",function(){return a}),n.d(t,"SearchQueryModifierContext",function(){return d}),n.d(t,"_SearchQueryExtensionManager",function(){return p});var a,i=n("17wl"),r=n("ZFc5");!function(e){e[e.SearchResults=1]="SearchResults",e[e.SearchSuggestions=2]="SearchSuggestions"}(a||(a={}));var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"timeout",{get:function(){return 1e4},enumerable:!1,configurable:!0}),t.prototype.modifySearchQuery=function(e,t){return Promise.resolve(e)},t}(r.BaseExtension),s=o,c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(r.ExtensionContext),d=c,l=n("UWqr"),u=n("ut3N"),f=n("I6O9"),p=function(){function e(e){this._extensionManager=new r._ExtensionManager(e,s),this._extensions=[]}return e.prototype.initializeExtensions=function(e){var t=this,n=new u._QosMonitor("SearchQueryExtensionManager.initializeExtensions"),a=this._getCustomActions(e).filter(function(e){return"ClientSideExtension.SearchQueryModifier"===e.location&&!!f.SPComponentLoader.tryGetManifestById(e.clientSideComponentId)}).sort(function(e,t){return(e.sequence||Number.MAX_VALUE)-(t.sequence||Number.MAX_VALUE)}).map(function(e){return t._extensionManager.createExtension(e.clientSideComponentId.toString(),e.clientSideComponentProperties,function(e){return new d(e)})});return Promise.all(a).then(function(e){t._extensions=e;var a=t._extensions.length;return n.writeSuccess({numberOfExtensions:a}),a}).catch(function(e){throw n.writeUnexpectedFailure(void 0,e,{numberOfExtensions:0}),e})},e.prototype.getSearchQuery=function(e){var t=this,n=Promise.resolve({queryText:e,originalQueryText:e});return this._extensions.forEach(function(a){n=n.then(function(n){return t._processQuery(a,n,e)})}),n.then(function(e){return e.queryText})},e.prototype._processQuery=function(e,t,n){var r=new u._QosMonitor("SearchQueryExtensionManager.processQuery"),o={componentId:e.componentId,alias:e.manifest.alias},s=new Promise(function(n){setTimeout(function(){r.writeExpectedFailure("Timeout",void 0,o),n(t)},e.timeout)});return Promise.race([s,e.modifySearchQuery(Object(i.__assign)(Object(i.__assign)({},t),{originalQueryText:n}),a.SearchResults)]).then(function(e){return r.writeSuccess(o),e}).catch(function(e){throw r.writeUnexpectedFailure(void 0,e,o),e})},e.prototype._getCustomActions=function(e){return this._getDebugCustomActions().concat(e)},e.prototype._getDebugCustomActions=function(){var e=[],t=new URL(window.location.href).searchParams.get("customActions");if(t){var n=decodeURIComponent(t),a=JSON.parse(n);if(a)for(var i=0,r=Object.keys(a);i<r.length;i++){var o=r[i],s=l.Guid.tryParse(o),c=a[o].location,d=a[o].sequence;e.push({clientSideComponentId:s.toString(),location:c,sequence:d})}}return e},e}()},ut3N:function(e,t){e.exports=o}})});
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -64,7 +64,7 @@ var SearchQueryExtensionManager = /** @class */ (function () {
|
|
|
64
64
|
};
|
|
65
65
|
SearchQueryExtensionManager.prototype._processQuery = function (extension, query, originalQueryText) {
|
|
66
66
|
var qosMonitor = new sp_diagnostics_1._QosMonitor('SearchQueryExtensionManager.processQuery');
|
|
67
|
-
//
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
68
|
var extraData = {
|
|
69
69
|
componentId: extension.componentId,
|
|
70
70
|
alias: extension.manifest.alias
|
|
@@ -17,7 +17,7 @@ var TestExtension = /** @class */ (function (_super) {
|
|
|
17
17
|
configurable: true
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(TestExtension.prototype, "manifest", {
|
|
20
|
-
//
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
21
|
get: function () {
|
|
22
22
|
return {
|
|
23
23
|
alias: 'TestExtension'
|
|
@@ -45,7 +45,7 @@ var SlowExtension = /** @class */ (function (_super) {
|
|
|
45
45
|
configurable: true
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(SlowExtension.prototype, "manifest", {
|
|
48
|
-
//
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
49
|
get: function () {
|
|
50
50
|
return {
|
|
51
51
|
alias: 'SlowExtension'
|
|
@@ -73,10 +73,10 @@ var SlowExtension = /** @class */ (function (_super) {
|
|
|
73
73
|
describe('SearchQueryExtensionManager', function () {
|
|
74
74
|
test('getSearchQuery with two extensions', function (done) {
|
|
75
75
|
var manager = new SearchQueryExtensionManager_1.default(sp_core_library_1.ServiceScope.startNewRoot());
|
|
76
|
-
//
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
77
|
manager._extensions.push(new TestExtension());
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
79
|
manager._extensions.push(new TestExtension());
|
|
79
|
-
// tslint:enable: no-any
|
|
80
80
|
var query = manager.getSearchQuery('aaa');
|
|
81
81
|
query
|
|
82
82
|
.then(function (q) {
|
|
@@ -90,9 +90,8 @@ describe('SearchQueryExtensionManager', function () {
|
|
|
90
90
|
});
|
|
91
91
|
test('getSearchQuery with an extension that times out', function (done) {
|
|
92
92
|
var manager = new SearchQueryExtensionManager_1.default(sp_core_library_1.ServiceScope.startNewRoot());
|
|
93
|
-
//
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
94
|
manager._extensions.push(new SlowExtension());
|
|
95
|
-
// tslint:enable: no-any
|
|
96
95
|
var query = manager.getSearchQuery('aaa');
|
|
97
96
|
query
|
|
98
97
|
.then(function (q) {
|
|
@@ -98,7 +98,7 @@ var SearchQueryModifier = /** @class */ (function () {
|
|
|
98
98
|
};
|
|
99
99
|
SearchQueryModifier.prototype._AddTaskTestWithSearchQueryAndExtension = function () {
|
|
100
100
|
TAB.Log.AddTaskComment('Test: Check page with search query and a search query modifier.');
|
|
101
|
-
var customActions = '{"124cf3a4-cd42-4f3d-a21f-8ae3d416859c":
|
|
101
|
+
var customActions = '{"124cf3a4-cd42-4f3d-a21f-8ae3d416859c":{"location":"ClientSideExtension.SearchQueryModifier"}}';
|
|
102
102
|
TAB.AddTask(TAB.LoadPage(this._getPageUrl('q=withSqm', customActions)), SPTaskLib.TeamSitePage.PageReady());
|
|
103
103
|
TAB.AddTask(undefined, this._dynamicDataConsumerWebPart.WaitForDynamicDataRendering());
|
|
104
104
|
this._AddTaskValidateSearchQueryValue('withSqm TAB TEST', 'Search query data with a search query and an extension should be the modified search query');
|
|
@@ -120,13 +120,14 @@ var SearchQueryModifier = /** @class */ (function () {
|
|
|
120
120
|
*/
|
|
121
121
|
SearchQueryModifier.prototype._AddTaskValidateSearchQueryValue = function (value, message) {
|
|
122
122
|
var _this = this;
|
|
123
|
-
TAB.AddTask(undefined,
|
|
124
|
-
|
|
125
|
-
var ddValue = _this._getDynamicDataValue();
|
|
123
|
+
TAB.AddTask(undefined, TAB.MakeWaiter(function () {
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
|
+
var ddValue = _this._getDynamicDataValue();
|
|
126
126
|
return ddValue && ddValue.searchQuery === value;
|
|
127
127
|
}));
|
|
128
128
|
TAB.AddTask(TAB.MakeTask(function () {
|
|
129
|
-
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
130
|
+
var ddValue = _this._getDynamicDataValue();
|
|
130
131
|
TAB.Log.Verify(ddValue && ddValue.searchQuery === value, "".concat(message, " - The actual value was \"").concat(JSON.stringify(ddValue), "\"."));
|
|
131
132
|
}));
|
|
132
133
|
};
|
|
@@ -148,5 +149,6 @@ var SearchQueryModifier = /** @class */ (function () {
|
|
|
148
149
|
};
|
|
149
150
|
return SearchQueryModifier;
|
|
150
151
|
}());
|
|
152
|
+
// eslint-disable-next-line prefer-const, @typescript-eslint/no-unused-vars
|
|
151
153
|
TabTest = SearchQueryModifier;
|
|
152
154
|
//# sourceMappingURL=SearchQueryModifier.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/sp-search-extensibility",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0-beta.2",
|
|
4
4
|
"description": "SharePoint Framework developer support for customizing search",
|
|
5
5
|
"license": "https://aka.ms/spfx/license",
|
|
6
6
|
"homepage": "http://aka.ms/spfx",
|
|
@@ -15,28 +15,28 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"tslib": "2.3.1",
|
|
18
|
-
"@microsoft/sp-core-library": "1.
|
|
19
|
-
"@microsoft/sp-diagnostics": "1.
|
|
20
|
-
"@microsoft/sp-extension-base": "1.
|
|
21
|
-
"@microsoft/sp-loader": "1.
|
|
18
|
+
"@microsoft/sp-core-library": "1.18.0-beta.2",
|
|
19
|
+
"@microsoft/sp-diagnostics": "1.18.0-beta.2",
|
|
20
|
+
"@microsoft/sp-extension-base": "1.18.0-beta.2",
|
|
21
|
+
"@microsoft/sp-loader": "1.18.0-beta.2"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@rushstack/heft": "0.
|
|
24
|
+
"@rushstack/heft": "0.56.0",
|
|
25
|
+
"eslint": "8.7.0",
|
|
25
26
|
"@ms/sp-tab-tasklib": "0.0.4",
|
|
26
|
-
"@ms/spfx-internal-web-build-rig": "0.1.0"
|
|
27
|
+
"@ms/spfx-internal-web-build-next-rig": "0.1.0"
|
|
27
28
|
},
|
|
28
29
|
"scripts": {
|
|
29
30
|
"build": "heft test --clean",
|
|
30
31
|
"clean": "heft clean",
|
|
31
32
|
"deploy": "heft dev-deploy",
|
|
32
|
-
"start": "heft
|
|
33
|
-
"test": "heft test
|
|
34
|
-
"test-watch": "heft test
|
|
35
|
-
"build-watch": "heft build --lite",
|
|
33
|
+
"start": "heft build-watch --serve",
|
|
34
|
+
"test": "heft test",
|
|
35
|
+
"test-watch": "heft test-watch",
|
|
36
36
|
"tab": "heft tab",
|
|
37
|
-
"_phase:build": "heft build --clean",
|
|
38
|
-
"_phase:test": "heft test --
|
|
39
|
-
"_phase:build-incremental": "heft build --
|
|
37
|
+
"_phase:build": "heft run --only build -- --clean",
|
|
38
|
+
"_phase:test": "heft run --only test -- --clean",
|
|
39
|
+
"_phase:build-incremental": "heft run --only build --",
|
|
40
40
|
"_phase:depscan": "heft depscan",
|
|
41
41
|
"_phase:tablink": "heft tablink"
|
|
42
42
|
}
|