@coveops/abi 1.5.7 → 2.0.0
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/abi/abi.css +206 -1
- package/dist/abi/abi.esm.js +129 -1
- package/dist/abi/app-globals-0f993ce5.js +3 -0
- package/dist/abi/css-shim-04165e59.js +4 -0
- package/dist/abi/dom-26e7cb2c.js +73 -0
- package/dist/{esm → abi}/faq-popup-component.entry.js +3 -4
- package/dist/abi/headless.esm-c328011d.js +72 -0
- package/dist/abi/index-4c45f50c.js +3064 -0
- package/dist/abi/index-bf9cad6e.js +4108 -0
- package/dist/abi/index.esm.js +168 -1
- package/dist/{esm → abi}/recs-initialization-helper.entry.js +5 -5
- package/dist/{esm → abi}/recs-results-manager.entry.js +1 -1
- package/dist/{esm → abi}/results-manager.entry.js +1 -1
- package/dist/{esm → abi}/sample-component.entry.js +3 -3
- package/dist/abi/shadow-css-1257b266.js +387 -0
- package/dist/{esm → abi}/standalone-searchbox-listener.entry.js +3 -3
- package/dist/{esm → abi}/strip-html-component.entry.js +2 -3
- package/package.json +2 -2
- package/src/components/recs-initialization-helper/recs-initialization-helper.tsx +2 -2
- package/src/index.ts +2 -2
- package/src/pages/index.html +1 -1
- package/dist/abi/p-380ced38.entry.js +0 -1
- package/dist/abi/p-7282c5fe.entry.js +0 -1
- package/dist/abi/p-9d42030c.entry.js +0 -1
- package/dist/abi/p-ac870f21.js +0 -49
- package/dist/abi/p-b83bab81.js +0 -1
- package/dist/abi/p-c0436bc1.entry.js +0 -1
- package/dist/abi/p-c10b6b7f.js +0 -2
- package/dist/abi/p-c602c74e.entry.js +0 -1
- package/dist/abi/p-c82303fb.js +0 -1
- package/dist/abi/p-cd1744bb.entry.js +0 -1
- package/dist/abi/p-d20ee37c.js +0 -18
- package/dist/abi/p-d5e62885.entry.js +0 -1
- package/dist/bundle/index.css +0 -1
- package/dist/bundle/index.html +0 -72
- package/dist/bundle/index.js +0 -1363
- package/dist/cjs/abi.cjs.js +0 -19
- package/dist/cjs/atomic-70a93c69.js +0 -11
- package/dist/cjs/faq-popup-component.cjs.entry.js +0 -144
- package/dist/cjs/headless.esm-085e70ed-f2e18485.js +0 -1720
- package/dist/cjs/index-3cecd23d.js +0 -1283
- package/dist/cjs/index-d1493bab.js +0 -105
- package/dist/cjs/index.cjs.js +0 -170
- package/dist/cjs/loader.cjs.js +0 -21
- package/dist/cjs/recs-initialization-helper.cjs.entry.js +0 -55
- package/dist/cjs/recs-results-manager.cjs.entry.js +0 -36
- package/dist/cjs/result-template-decorators-881a4c8e-4ff46481.js +0 -33
- package/dist/cjs/results-manager.cjs.entry.js +0 -42
- package/dist/cjs/sample-component.cjs.entry.js +0 -87
- package/dist/cjs/standalone-searchbox-listener.cjs.entry.js +0 -48
- package/dist/cjs/strip-html-component.cjs.entry.js +0 -60
- package/dist/collection/collection-manifest.json +0 -23
- package/dist/collection/components/faq-popup-component/faq-popup-component.css +0 -15
- package/dist/collection/components/faq-popup-component/faq-popup-component.js +0 -162
- package/dist/collection/components/recs-initialization-helper/recs-initialization-helper.js +0 -66
- package/dist/collection/components/recs-results-manager/recs-results-manager.js +0 -39
- package/dist/collection/components/results-manager/results-manager.js +0 -50
- package/dist/collection/components/sample-component/sample-component.css +0 -10
- package/dist/collection/components/sample-component/sample-component.js +0 -102
- package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.css +0 -1
- package/dist/collection/components/standalone-searchbox-listener/standalone-searchbox-listener.js +0 -50
- package/dist/collection/components/strip-html-component/strip-html-component.css +0 -3
- package/dist/collection/components/strip-html-component/strip-html-component.js +0 -64
- package/dist/collection/images/Default.png +0 -0
- package/dist/collection/images/Documents.png +0 -0
- package/dist/collection/images/FAQ.png +0 -0
- package/dist/collection/images/Images.png +0 -0
- package/dist/collection/images/Link.png +0 -0
- package/dist/collection/images/Movies.png +0 -0
- package/dist/collection/images/ProcessPeople.png +0 -0
- package/dist/collection/index.js +0 -167
- package/dist/collection/utils/atomic.js +0 -6
- package/dist/components/index.js +0 -3576
- package/dist/esm/abi.js +0 -17
- package/dist/esm/headless.esm-085e70ed-c4dfb380.js +0 -1717
- package/dist/esm/index-072be88f.js +0 -95
- package/dist/esm/index-66fdbb35.js +0 -1255
- package/dist/esm/index.js +0 -168
- package/dist/esm/loader.js +0 -17
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/result-template-decorators-881a4c8e-ed85ad21.js +0 -31
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/loader/cdn.js +0 -3
- package/dist/loader/index.cjs.js +0 -3
- package/dist/loader/index.d.ts +0 -12
- package/dist/loader/index.es2017.js +0 -3
- package/dist/loader/index.js +0 -4
- package/dist/loader/package.json +0 -10
- /package/dist/{esm → abi}/atomic-7b1e6d55.js +0 -0
package/dist/collection/index.js
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { waitForAtomic, waitForRecsAtomic } from "./utils/atomic";
|
|
2
|
-
async function main() {
|
|
3
|
-
await waitForAtomic();
|
|
4
|
-
const searchInterface = document.querySelector("#search");
|
|
5
|
-
searchInterface && initSearch(searchInterface);
|
|
6
|
-
const searchBox = document.querySelector("#searchbox");
|
|
7
|
-
searchBox && initStandaloneSearchBox(searchBox);
|
|
8
|
-
// const platformUrl = process.env.PLATFORM_URL!;
|
|
9
|
-
// const organizationId = process.env.ORGANIZATION_ID!;
|
|
10
|
-
// const accessToken = process.env.API_KEY!;
|
|
11
|
-
// await searchInterface.initialize({
|
|
12
|
-
// accessToken,
|
|
13
|
-
// organizationId,
|
|
14
|
-
// platformUrl,
|
|
15
|
-
// preprocessRequest: (request, clientOrigin, metadata) => {
|
|
16
|
-
// if(clientOrigin == "searchApiFetch" && metadata?.method == "search") {
|
|
17
|
-
// request.url += '&viewAllContent=1';
|
|
18
|
-
// var body = JSON.parse(request.body as string);
|
|
19
|
-
// body.context = {
|
|
20
|
-
// "user_country_snow": "CZ"
|
|
21
|
-
// };
|
|
22
|
-
// request.body = JSON.stringify(body);
|
|
23
|
-
// }
|
|
24
|
-
// return request;
|
|
25
|
-
// }
|
|
26
|
-
// });
|
|
27
|
-
// searchInterface.executeFirstSearch();
|
|
28
|
-
// searchInterface.i18n.addResourceBundle('en', 'translation', {
|
|
29
|
-
// 'no-results-for': 'No results for {{query}}'
|
|
30
|
-
// });
|
|
31
|
-
// await searchBox.initialize({
|
|
32
|
-
// accessToken,
|
|
33
|
-
// organizationId,
|
|
34
|
-
// platformUrl,
|
|
35
|
-
// preprocessRequest: (request, clientOrigin, metadata) => {
|
|
36
|
-
// if(clientOrigin == "searchApiFetch" && metadata?.method == "search") {
|
|
37
|
-
// request.url += '&viewAllContent=1';
|
|
38
|
-
// var body = JSON.parse(request.body as string);
|
|
39
|
-
// body.context = {
|
|
40
|
-
// "user_country_snow": "CZ"
|
|
41
|
-
// };
|
|
42
|
-
// var q = body.q || "";
|
|
43
|
-
// var event = new CustomEvent('header/searchbox/query', {
|
|
44
|
-
// detail: q
|
|
45
|
-
// });
|
|
46
|
-
// window.dispatchEvent(event);
|
|
47
|
-
// request.body = JSON.stringify(body);
|
|
48
|
-
// }
|
|
49
|
-
// return request;
|
|
50
|
-
// },
|
|
51
|
-
// analytics: {
|
|
52
|
-
// enabled: false
|
|
53
|
-
// }
|
|
54
|
-
// });
|
|
55
|
-
await waitForRecsAtomic();
|
|
56
|
-
const recsInterfaces = Array.from(document.querySelectorAll('atomic-recs-interface'));
|
|
57
|
-
recsInterfaces.length && initRecs();
|
|
58
|
-
}
|
|
59
|
-
async function initStandaloneSearchBox(searchBox) {
|
|
60
|
-
const platformUrl = process.env.PLATFORM_URL;
|
|
61
|
-
const organizationId = process.env.ORGANIZATION_ID;
|
|
62
|
-
const accessToken = process.env.API_KEY;
|
|
63
|
-
await searchBox.initialize({
|
|
64
|
-
accessToken,
|
|
65
|
-
organizationId,
|
|
66
|
-
platformUrl,
|
|
67
|
-
preprocessRequest: (request, clientOrigin, metadata) => {
|
|
68
|
-
if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
|
|
69
|
-
request.url += '&viewAllContent=1';
|
|
70
|
-
var body = JSON.parse(request.body);
|
|
71
|
-
body.context = {
|
|
72
|
-
"user_country_snow": "CZ"
|
|
73
|
-
};
|
|
74
|
-
var q = body.q || "";
|
|
75
|
-
var event = new CustomEvent('header/searchbox/query', {
|
|
76
|
-
detail: q
|
|
77
|
-
});
|
|
78
|
-
window.dispatchEvent(event);
|
|
79
|
-
request.body = JSON.stringify(body);
|
|
80
|
-
}
|
|
81
|
-
return request;
|
|
82
|
-
},
|
|
83
|
-
analytics: {
|
|
84
|
-
enabled: false
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
async function initSearch(searchInterface) {
|
|
89
|
-
const platformUrl = process.env.PLATFORM_URL;
|
|
90
|
-
const organizationId = process.env.ORGANIZATION_ID;
|
|
91
|
-
const accessToken = process.env.API_KEY;
|
|
92
|
-
await searchInterface.initialize({
|
|
93
|
-
accessToken,
|
|
94
|
-
organizationId,
|
|
95
|
-
platformUrl,
|
|
96
|
-
preprocessRequest: (request, clientOrigin, metadata) => {
|
|
97
|
-
if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
|
|
98
|
-
request.url += '&viewAllContent=1';
|
|
99
|
-
var body = JSON.parse(request.body);
|
|
100
|
-
body.context = {
|
|
101
|
-
"user_country_snow": "CZ"
|
|
102
|
-
};
|
|
103
|
-
request.body = JSON.stringify(body);
|
|
104
|
-
}
|
|
105
|
-
return request;
|
|
106
|
-
},
|
|
107
|
-
search: {
|
|
108
|
-
preprocessSearchResponseMiddleware: (response) => {
|
|
109
|
-
response.body.results.forEach((result) => {
|
|
110
|
-
if (result.raw.snavatar) {
|
|
111
|
-
result.raw.resultpicture = 'https://abinbevwwdev.service-now.com/' + result.raw.snavatar;
|
|
112
|
-
}
|
|
113
|
-
return result;
|
|
114
|
-
});
|
|
115
|
-
return response;
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
searchInterface.executeFirstSearch();
|
|
120
|
-
}
|
|
121
|
-
async function initRecs() {
|
|
122
|
-
var _a;
|
|
123
|
-
const organizationId = process.env.ORGANIZATION_ID;
|
|
124
|
-
const accessToken = process.env.API_KEY;
|
|
125
|
-
const recsInterface = document.querySelector('#recs');
|
|
126
|
-
(_a = recsInterface.querySelector("recs-initialization-helper")) === null || _a === void 0 ? void 0 : _a.setAttribute("user-country", "CZ");
|
|
127
|
-
await (recsInterface === null || recsInterface === void 0 ? void 0 : recsInterface.initialize({
|
|
128
|
-
accessToken: accessToken,
|
|
129
|
-
organizationId: organizationId,
|
|
130
|
-
preprocessRequest: (request, clientOrigin, metadata) => {
|
|
131
|
-
if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "recommendations") {
|
|
132
|
-
//request.url += '&viewAllContent=1';
|
|
133
|
-
var body = JSON.parse(request.body);
|
|
134
|
-
body.context = {
|
|
135
|
-
"user_country": "CZ",
|
|
136
|
-
"user_country_snow": "CZ",
|
|
137
|
-
...body.context
|
|
138
|
-
};
|
|
139
|
-
request.body = JSON.stringify(body);
|
|
140
|
-
}
|
|
141
|
-
return request;
|
|
142
|
-
}
|
|
143
|
-
}));
|
|
144
|
-
//recsInterface?.getRecommendations();
|
|
145
|
-
/*await Promise.all(
|
|
146
|
-
recsInterfaces.map(async (recommendationInterface: { initialize: (arg0: { accessToken: string; organizationId: string; }) => any; getOrganizationEndpoints: (arg0: string) => any; }) =>
|
|
147
|
-
recommendationInterface.initialize({
|
|
148
|
-
accessToken: accessToken,
|
|
149
|
-
organizationId: organizationId
|
|
150
|
-
})
|
|
151
|
-
)
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
const context = {
|
|
155
|
-
"user_country": "CZ",
|
|
156
|
-
"context_user_country": "CZ"
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
recsInterfaces.forEach((recInterface: { engine: any; getRecommendations: () => void; }) => {
|
|
160
|
-
const engine = recInterface.engine;
|
|
161
|
-
|
|
162
|
-
engine.dispatch(loadContextActions(engine).setContext(context));
|
|
163
|
-
|
|
164
|
-
recInterface.getRecommendations();
|
|
165
|
-
});*/
|
|
166
|
-
}
|
|
167
|
-
main();
|