@coveops/abi 0.5.1 → 0.5.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.
@@ -7,11 +7,22 @@ async function main() {
7
7
  const searchInterface = document.querySelector("atomic-search-interface");
8
8
  const platformUrl = "https://platform.cloud.coveo.com";
9
9
  const organizationId = "anheuserbuschinbevprod";
10
- const accessToken = "x8aeb96a3-22cb-4198-8aea-0f8e88a638c0";
10
+ const accessToken = "x0e506b82-043a-4eea-b18d-ee82aab46562";
11
11
  await searchInterface.initialize({
12
12
  accessToken,
13
13
  organizationId,
14
14
  platformUrl,
15
+ preprocessRequest: (request, clientOrigin, metadata) => {
16
+ if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
17
+ request.url += '&viewAllContent=1';
18
+ var body = JSON.parse(request.body);
19
+ body.context = {
20
+ "user_country_snow": "CZ"
21
+ };
22
+ request.body = JSON.stringify(body);
23
+ }
24
+ return request;
25
+ }
15
26
  });
16
27
  searchInterface.executeFirstSearch();
17
28
  }
@@ -9,6 +9,17 @@ async function main() {
9
9
  accessToken,
10
10
  organizationId,
11
11
  platformUrl,
12
+ preprocessRequest: (request, clientOrigin, metadata) => {
13
+ if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
14
+ request.url += '&viewAllContent=1';
15
+ var body = JSON.parse(request.body);
16
+ body.context = {
17
+ "user_country_snow": "CZ"
18
+ };
19
+ request.body = JSON.stringify(body);
20
+ }
21
+ return request;
22
+ }
12
23
  });
13
24
  searchInterface.executeFirstSearch();
14
25
  }
@@ -972,11 +972,22 @@ async function main() {
972
972
  const searchInterface = document.querySelector("atomic-search-interface");
973
973
  const platformUrl = "https://platform.cloud.coveo.com";
974
974
  const organizationId = "anheuserbuschinbevprod";
975
- const accessToken = "x8aeb96a3-22cb-4198-8aea-0f8e88a638c0";
975
+ const accessToken = "x0e506b82-043a-4eea-b18d-ee82aab46562";
976
976
  await searchInterface.initialize({
977
977
  accessToken,
978
978
  organizationId,
979
979
  platformUrl,
980
+ preprocessRequest: (request, clientOrigin, metadata) => {
981
+ if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
982
+ request.url += '&viewAllContent=1';
983
+ var body = JSON.parse(request.body);
984
+ body.context = {
985
+ "user_country_snow": "CZ"
986
+ };
987
+ request.body = JSON.stringify(body);
988
+ }
989
+ return request;
990
+ }
980
991
  });
981
992
  searchInterface.executeFirstSearch();
982
993
  }
package/dist/esm/index.js CHANGED
@@ -5,11 +5,22 @@ async function main() {
5
5
  const searchInterface = document.querySelector("atomic-search-interface");
6
6
  const platformUrl = "https://platform.cloud.coveo.com";
7
7
  const organizationId = "anheuserbuschinbevprod";
8
- const accessToken = "x8aeb96a3-22cb-4198-8aea-0f8e88a638c0";
8
+ const accessToken = "x0e506b82-043a-4eea-b18d-ee82aab46562";
9
9
  await searchInterface.initialize({
10
10
  accessToken,
11
11
  organizationId,
12
12
  platformUrl,
13
+ preprocessRequest: (request, clientOrigin, metadata) => {
14
+ if (clientOrigin == "searchApiFetch" && (metadata === null || metadata === void 0 ? void 0 : metadata.method) == "search") {
15
+ request.url += '&viewAllContent=1';
16
+ var body = JSON.parse(request.body);
17
+ body.context = {
18
+ "user_country_snow": "CZ"
19
+ };
20
+ request.body = JSON.stringify(body);
21
+ }
22
+ return request;
23
+ }
13
24
  });
14
25
  searchInterface.executeFirstSearch();
15
26
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coveops/abi",
3
3
  "description": "Abi project",
4
- "version": "0.5.1",
4
+ "version": "0.5.2",
5
5
  "private": false,
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.js",
package/src/index.ts CHANGED
@@ -12,6 +12,17 @@ async function main() {
12
12
  accessToken,
13
13
  organizationId,
14
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
+ }
15
26
  });
16
27
 
17
28
  searchInterface.executeFirstSearch();
@@ -66,21 +66,20 @@
66
66
  <atomic-layout-section style="justify-self:center" section="search">
67
67
  <atomic-search-box></atomic-search-box>
68
68
  </atomic-layout-section>
69
- <!-- <atomic-layout-section section="facets">
69
+ <atomic-layout-section section="facets">
70
70
  <atomic-facet-manager>
71
71
  <atomic-facet field="abicontenttype" label="Filetype"></atomic-facet>
72
72
  <atomic-facet field="source" label="Source"></atomic-facet>
73
73
  </atomic-facet-manager>
74
- </atomic-layout-section> -->
74
+ </atomic-layout-section>
75
75
  <atomic-layout-section section="main">
76
76
  <atomic-layout-section section="status">
77
77
  <atomic-breadbox></atomic-breadbox>
78
78
  <atomic-query-summary enable-duration="true"></atomic-query-summary>
79
79
  <atomic-refine-toggle></atomic-refine-toggle>
80
- <!-- <atomic-sort-dropdown>
80
+ <atomic-sort-dropdown>
81
81
  <atomic-sort-expression label="relevance" expression="relevancy"></atomic-sort-expression>
82
- <atomic-sort-expression label="most-recent" expression="date descending"></atomic-sort-expression>
83
- </atomic-sort-dropdown> -->
82
+ </atomic-sort-dropdown>
84
83
  <atomic-did-you-mean></atomic-did-you-mean>
85
84
  </atomic-layout-section>
86
85
  <atomic-layout-section section="results">
@@ -25,20 +25,32 @@ atomic-search-box::part(submit-icon) {
25
25
  color: black;
26
26
  }
27
27
 
28
- atomic-pager::part(active-page-button) {
29
- background-color: #1d4f76;
30
- color: #cddee9;
31
-
28
+ atomic-pager::part(page-button) {
29
+ color: #a6a6a6;
30
+ border: thin solid #a6a6a6;
31
+ border-radius: 0px;
32
32
  }
33
33
 
34
- atomic-pager::part(page-button) {
35
- color: #cddee9;
34
+ atomic-pager::part(active-page-button) {
35
+ background-color: #caa144;
36
+ color: #000;
36
37
  }
37
38
 
38
- atomic-pager::part(page-button) {
39
- border: thin solid #7e8c9a;
39
+ atomic-pager::part(next-button),
40
+ atomic-pager::part(previous-button) {
41
+ color: #caa144;
42
+ border: thin solid #a6a6a6;
40
43
  border-radius: 0px;
41
44
  }
45
+
46
+ atomic-pager::part(next-button):hover,
47
+ atomic-pager::part(previous-button):hover,
48
+ atomic-pager::part(page-button):hover {
49
+ border-color: #caa144;
50
+ color: #caa144;
51
+ cursor: pointer;
52
+ }
53
+
42
54
  atomic-modal#faq-modal::part(header-wrapper) {
43
55
  display: grid;
44
56
  width: 100%;