@blotoutio/providers-evo-search-sdk 1.67.0 → 1.68.1
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/core.cjs.js +14 -3
- package/core.js +14 -3
- package/core.mjs +14 -3
- package/index.cjs.js +14 -3
- package/index.js +14 -3
- package/index.mjs +14 -3
- package/package.json +1 -1
package/core.cjs.js
CHANGED
|
@@ -929,6 +929,11 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
929
929
|
headers.set('EdgeTagSessionId', sessionId);
|
|
930
930
|
}
|
|
931
931
|
headers.set('X-EvoSearch-Channel', getChannel());
|
|
932
|
+
// Only sent when the merchant is actually previewing; these routes preflight
|
|
933
|
+
// anyway, so the extra header costs no round-trip.
|
|
934
|
+
if (hasPreviewKey()) {
|
|
935
|
+
headers.set('X-EvoSearch-Preview', '1');
|
|
936
|
+
}
|
|
932
937
|
return headers;
|
|
933
938
|
};
|
|
934
939
|
// Identity for the public read endpoints travels as query params instead of
|
|
@@ -943,6 +948,12 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
943
948
|
url.searchParams.set('sid', sessionId);
|
|
944
949
|
}
|
|
945
950
|
url.searchParams.set('channel', getChannel());
|
|
951
|
+
// Emitted only when previewing: a live-traffic search URL has to stay
|
|
952
|
+
// byte-identical to today's or the edge cache fragments and the hit rate
|
|
953
|
+
// regresses on the per-keystroke hot path.
|
|
954
|
+
if (hasPreviewKey()) {
|
|
955
|
+
url.searchParams.set('preview', '1');
|
|
956
|
+
}
|
|
946
957
|
};
|
|
947
958
|
// Parsing `baseURL` once at API construction avoids re-parsing the host on
|
|
948
959
|
// every keystroke when `getURL` runs inside the autocomplete hot path.
|
|
@@ -1055,7 +1066,7 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1055
1066
|
const clearRecents = () => sendMutation('/user/recents', 'ClearRecents', 'DELETE');
|
|
1056
1067
|
// Resilience lives here, not at each call site, so no consumer can opt out —
|
|
1057
1068
|
// the headless channel previously had no deadline and no retry.
|
|
1058
|
-
const search = async (query, limit =
|
|
1069
|
+
const search = async (query, limit = 24, signal) => {
|
|
1059
1070
|
logger.info(`EvoSearch API: Search request - query length: ${query.length}, limit: ${limit}`);
|
|
1060
1071
|
const data = await withSearchResilience((attemptSignal) => getJSON('/search', 'Search', { q: query, limit: String(limit) }, attemptSignal),
|
|
1061
1072
|
// Shared stand-in is safe: the wrapper removes its abort listener per attempt.
|
|
@@ -1470,7 +1481,7 @@ const init = (params) => {
|
|
|
1470
1481
|
const tag = ({ data }) => {
|
|
1471
1482
|
try {
|
|
1472
1483
|
return {
|
|
1473
|
-
sdkVersion: "1.
|
|
1484
|
+
sdkVersion: "1.68.1" || '',
|
|
1474
1485
|
searchQuery: data['searchQuery'],
|
|
1475
1486
|
searchResults: data['searchResults'],
|
|
1476
1487
|
timestamp: Date.now(),
|
|
@@ -1479,7 +1490,7 @@ const tag = ({ data }) => {
|
|
|
1479
1490
|
catch (err) {
|
|
1480
1491
|
console.error(`EvoSearch SDK: Tagging failed - ${err}`);
|
|
1481
1492
|
return {
|
|
1482
|
-
sdkVersion: "1.
|
|
1493
|
+
sdkVersion: "1.68.1" ,
|
|
1483
1494
|
timestamp: Date.now(),
|
|
1484
1495
|
};
|
|
1485
1496
|
}
|
package/core.js
CHANGED
|
@@ -930,6 +930,11 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
930
930
|
headers.set('EdgeTagSessionId', sessionId);
|
|
931
931
|
}
|
|
932
932
|
headers.set('X-EvoSearch-Channel', getChannel());
|
|
933
|
+
// Only sent when the merchant is actually previewing; these routes preflight
|
|
934
|
+
// anyway, so the extra header costs no round-trip.
|
|
935
|
+
if (hasPreviewKey()) {
|
|
936
|
+
headers.set('X-EvoSearch-Preview', '1');
|
|
937
|
+
}
|
|
933
938
|
return headers;
|
|
934
939
|
};
|
|
935
940
|
// Identity for the public read endpoints travels as query params instead of
|
|
@@ -944,6 +949,12 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
944
949
|
url.searchParams.set('sid', sessionId);
|
|
945
950
|
}
|
|
946
951
|
url.searchParams.set('channel', getChannel());
|
|
952
|
+
// Emitted only when previewing: a live-traffic search URL has to stay
|
|
953
|
+
// byte-identical to today's or the edge cache fragments and the hit rate
|
|
954
|
+
// regresses on the per-keystroke hot path.
|
|
955
|
+
if (hasPreviewKey()) {
|
|
956
|
+
url.searchParams.set('preview', '1');
|
|
957
|
+
}
|
|
947
958
|
};
|
|
948
959
|
// Parsing `baseURL` once at API construction avoids re-parsing the host on
|
|
949
960
|
// every keystroke when `getURL` runs inside the autocomplete hot path.
|
|
@@ -1056,7 +1067,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
1056
1067
|
const clearRecents = () => sendMutation('/user/recents', 'ClearRecents', 'DELETE');
|
|
1057
1068
|
// Resilience lives here, not at each call site, so no consumer can opt out —
|
|
1058
1069
|
// the headless channel previously had no deadline and no retry.
|
|
1059
|
-
const search = async (query, limit =
|
|
1070
|
+
const search = async (query, limit = 24, signal) => {
|
|
1060
1071
|
logger.info(`EvoSearch API: Search request - query length: ${query.length}, limit: ${limit}`);
|
|
1061
1072
|
const data = await withSearchResilience((attemptSignal) => getJSON('/search', 'Search', { q: query, limit: String(limit) }, attemptSignal),
|
|
1062
1073
|
// Shared stand-in is safe: the wrapper removes its abort listener per attempt.
|
|
@@ -1471,7 +1482,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
1471
1482
|
const tag = ({ data }) => {
|
|
1472
1483
|
try {
|
|
1473
1484
|
return {
|
|
1474
|
-
sdkVersion: "1.
|
|
1485
|
+
sdkVersion: "1.68.1" || '',
|
|
1475
1486
|
searchQuery: data['searchQuery'],
|
|
1476
1487
|
searchResults: data['searchResults'],
|
|
1477
1488
|
timestamp: Date.now(),
|
|
@@ -1480,7 +1491,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
1480
1491
|
catch (err) {
|
|
1481
1492
|
console.error(`EvoSearch SDK: Tagging failed - ${err}`);
|
|
1482
1493
|
return {
|
|
1483
|
-
sdkVersion: "1.
|
|
1494
|
+
sdkVersion: "1.68.1" ,
|
|
1484
1495
|
timestamp: Date.now(),
|
|
1485
1496
|
};
|
|
1486
1497
|
}
|
package/core.mjs
CHANGED
|
@@ -927,6 +927,11 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
927
927
|
headers.set('EdgeTagSessionId', sessionId);
|
|
928
928
|
}
|
|
929
929
|
headers.set('X-EvoSearch-Channel', getChannel());
|
|
930
|
+
// Only sent when the merchant is actually previewing; these routes preflight
|
|
931
|
+
// anyway, so the extra header costs no round-trip.
|
|
932
|
+
if (hasPreviewKey()) {
|
|
933
|
+
headers.set('X-EvoSearch-Preview', '1');
|
|
934
|
+
}
|
|
930
935
|
return headers;
|
|
931
936
|
};
|
|
932
937
|
// Identity for the public read endpoints travels as query params instead of
|
|
@@ -941,6 +946,12 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
941
946
|
url.searchParams.set('sid', sessionId);
|
|
942
947
|
}
|
|
943
948
|
url.searchParams.set('channel', getChannel());
|
|
949
|
+
// Emitted only when previewing: a live-traffic search URL has to stay
|
|
950
|
+
// byte-identical to today's or the edge cache fragments and the hit rate
|
|
951
|
+
// regresses on the per-keystroke hot path.
|
|
952
|
+
if (hasPreviewKey()) {
|
|
953
|
+
url.searchParams.set('preview', '1');
|
|
954
|
+
}
|
|
944
955
|
};
|
|
945
956
|
// Parsing `baseURL` once at API construction avoids re-parsing the host on
|
|
946
957
|
// every keystroke when `getURL` runs inside the autocomplete hot path.
|
|
@@ -1053,7 +1064,7 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1053
1064
|
const clearRecents = () => sendMutation('/user/recents', 'ClearRecents', 'DELETE');
|
|
1054
1065
|
// Resilience lives here, not at each call site, so no consumer can opt out —
|
|
1055
1066
|
// the headless channel previously had no deadline and no retry.
|
|
1056
|
-
const search = async (query, limit =
|
|
1067
|
+
const search = async (query, limit = 24, signal) => {
|
|
1057
1068
|
logger.info(`EvoSearch API: Search request - query length: ${query.length}, limit: ${limit}`);
|
|
1058
1069
|
const data = await withSearchResilience((attemptSignal) => getJSON('/search', 'Search', { q: query, limit: String(limit) }, attemptSignal),
|
|
1059
1070
|
// Shared stand-in is safe: the wrapper removes its abort listener per attempt.
|
|
@@ -1468,7 +1479,7 @@ const init = (params) => {
|
|
|
1468
1479
|
const tag = ({ data }) => {
|
|
1469
1480
|
try {
|
|
1470
1481
|
return {
|
|
1471
|
-
sdkVersion: "1.
|
|
1482
|
+
sdkVersion: "1.68.1" || '',
|
|
1472
1483
|
searchQuery: data['searchQuery'],
|
|
1473
1484
|
searchResults: data['searchResults'],
|
|
1474
1485
|
timestamp: Date.now(),
|
|
@@ -1477,7 +1488,7 @@ const tag = ({ data }) => {
|
|
|
1477
1488
|
catch (err) {
|
|
1478
1489
|
console.error(`EvoSearch SDK: Tagging failed - ${err}`);
|
|
1479
1490
|
return {
|
|
1480
|
-
sdkVersion: "1.
|
|
1491
|
+
sdkVersion: "1.68.1" ,
|
|
1481
1492
|
timestamp: Date.now(),
|
|
1482
1493
|
};
|
|
1483
1494
|
}
|
package/index.cjs.js
CHANGED
|
@@ -1544,6 +1544,11 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1544
1544
|
headers.set('EdgeTagSessionId', sessionId);
|
|
1545
1545
|
}
|
|
1546
1546
|
headers.set('X-EvoSearch-Channel', getChannel());
|
|
1547
|
+
// Only sent when the merchant is actually previewing; these routes preflight
|
|
1548
|
+
// anyway, so the extra header costs no round-trip.
|
|
1549
|
+
if (hasPreviewKey()) {
|
|
1550
|
+
headers.set('X-EvoSearch-Preview', '1');
|
|
1551
|
+
}
|
|
1547
1552
|
return headers;
|
|
1548
1553
|
};
|
|
1549
1554
|
// Identity for the public read endpoints travels as query params instead of
|
|
@@ -1558,6 +1563,12 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1558
1563
|
url.searchParams.set('sid', sessionId);
|
|
1559
1564
|
}
|
|
1560
1565
|
url.searchParams.set('channel', getChannel());
|
|
1566
|
+
// Emitted only when previewing: a live-traffic search URL has to stay
|
|
1567
|
+
// byte-identical to today's or the edge cache fragments and the hit rate
|
|
1568
|
+
// regresses on the per-keystroke hot path.
|
|
1569
|
+
if (hasPreviewKey()) {
|
|
1570
|
+
url.searchParams.set('preview', '1');
|
|
1571
|
+
}
|
|
1561
1572
|
};
|
|
1562
1573
|
// Parsing `baseURL` once at API construction avoids re-parsing the host on
|
|
1563
1574
|
// every keystroke when `getURL` runs inside the autocomplete hot path.
|
|
@@ -1670,7 +1681,7 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1670
1681
|
const clearRecents = () => sendMutation('/user/recents', 'ClearRecents', 'DELETE');
|
|
1671
1682
|
// Resilience lives here, not at each call site, so no consumer can opt out —
|
|
1672
1683
|
// the headless channel previously had no deadline and no retry.
|
|
1673
|
-
const search = async (query, limit =
|
|
1684
|
+
const search = async (query, limit = 24, signal) => {
|
|
1674
1685
|
logger.info(`EvoSearch API: Search request - query length: ${query.length}, limit: ${limit}`);
|
|
1675
1686
|
const data = await withSearchResilience((attemptSignal) => getJSON('/search', 'Search', { q: query, limit: String(limit) }, attemptSignal),
|
|
1676
1687
|
// Shared stand-in is safe: the wrapper removes its abort listener per attempt.
|
|
@@ -2085,7 +2096,7 @@ const init = (params) => {
|
|
|
2085
2096
|
const tag = ({ data }) => {
|
|
2086
2097
|
try {
|
|
2087
2098
|
return {
|
|
2088
|
-
sdkVersion: "1.
|
|
2099
|
+
sdkVersion: "1.68.1" || '',
|
|
2089
2100
|
searchQuery: data['searchQuery'],
|
|
2090
2101
|
searchResults: data['searchResults'],
|
|
2091
2102
|
timestamp: Date.now(),
|
|
@@ -2094,7 +2105,7 @@ const tag = ({ data }) => {
|
|
|
2094
2105
|
catch (err) {
|
|
2095
2106
|
console.error(`EvoSearch SDK: Tagging failed - ${err}`);
|
|
2096
2107
|
return {
|
|
2097
|
-
sdkVersion: "1.
|
|
2108
|
+
sdkVersion: "1.68.1" ,
|
|
2098
2109
|
timestamp: Date.now(),
|
|
2099
2110
|
};
|
|
2100
2111
|
}
|
package/index.js
CHANGED
|
@@ -1545,6 +1545,11 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
1545
1545
|
headers.set('EdgeTagSessionId', sessionId);
|
|
1546
1546
|
}
|
|
1547
1547
|
headers.set('X-EvoSearch-Channel', getChannel());
|
|
1548
|
+
// Only sent when the merchant is actually previewing; these routes preflight
|
|
1549
|
+
// anyway, so the extra header costs no round-trip.
|
|
1550
|
+
if (hasPreviewKey()) {
|
|
1551
|
+
headers.set('X-EvoSearch-Preview', '1');
|
|
1552
|
+
}
|
|
1548
1553
|
return headers;
|
|
1549
1554
|
};
|
|
1550
1555
|
// Identity for the public read endpoints travels as query params instead of
|
|
@@ -1559,6 +1564,12 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
1559
1564
|
url.searchParams.set('sid', sessionId);
|
|
1560
1565
|
}
|
|
1561
1566
|
url.searchParams.set('channel', getChannel());
|
|
1567
|
+
// Emitted only when previewing: a live-traffic search URL has to stay
|
|
1568
|
+
// byte-identical to today's or the edge cache fragments and the hit rate
|
|
1569
|
+
// regresses on the per-keystroke hot path.
|
|
1570
|
+
if (hasPreviewKey()) {
|
|
1571
|
+
url.searchParams.set('preview', '1');
|
|
1572
|
+
}
|
|
1562
1573
|
};
|
|
1563
1574
|
// Parsing `baseURL` once at API construction avoids re-parsing the host on
|
|
1564
1575
|
// every keystroke when `getURL` runs inside the autocomplete hot path.
|
|
@@ -1671,7 +1682,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
1671
1682
|
const clearRecents = () => sendMutation('/user/recents', 'ClearRecents', 'DELETE');
|
|
1672
1683
|
// Resilience lives here, not at each call site, so no consumer can opt out —
|
|
1673
1684
|
// the headless channel previously had no deadline and no retry.
|
|
1674
|
-
const search = async (query, limit =
|
|
1685
|
+
const search = async (query, limit = 24, signal) => {
|
|
1675
1686
|
logger.info(`EvoSearch API: Search request - query length: ${query.length}, limit: ${limit}`);
|
|
1676
1687
|
const data = await withSearchResilience((attemptSignal) => getJSON('/search', 'Search', { q: query, limit: String(limit) }, attemptSignal),
|
|
1677
1688
|
// Shared stand-in is safe: the wrapper removes its abort listener per attempt.
|
|
@@ -2086,7 +2097,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
2086
2097
|
const tag = ({ data }) => {
|
|
2087
2098
|
try {
|
|
2088
2099
|
return {
|
|
2089
|
-
sdkVersion: "1.
|
|
2100
|
+
sdkVersion: "1.68.1" || '',
|
|
2090
2101
|
searchQuery: data['searchQuery'],
|
|
2091
2102
|
searchResults: data['searchResults'],
|
|
2092
2103
|
timestamp: Date.now(),
|
|
@@ -2095,7 +2106,7 @@ var ProvidersEvoSearchSdk = (function () {
|
|
|
2095
2106
|
catch (err) {
|
|
2096
2107
|
console.error(`EvoSearch SDK: Tagging failed - ${err}`);
|
|
2097
2108
|
return {
|
|
2098
|
-
sdkVersion: "1.
|
|
2109
|
+
sdkVersion: "1.68.1" ,
|
|
2099
2110
|
timestamp: Date.now(),
|
|
2100
2111
|
};
|
|
2101
2112
|
}
|
package/index.mjs
CHANGED
|
@@ -1542,6 +1542,11 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1542
1542
|
headers.set('EdgeTagSessionId', sessionId);
|
|
1543
1543
|
}
|
|
1544
1544
|
headers.set('X-EvoSearch-Channel', getChannel());
|
|
1545
|
+
// Only sent when the merchant is actually previewing; these routes preflight
|
|
1546
|
+
// anyway, so the extra header costs no round-trip.
|
|
1547
|
+
if (hasPreviewKey()) {
|
|
1548
|
+
headers.set('X-EvoSearch-Preview', '1');
|
|
1549
|
+
}
|
|
1545
1550
|
return headers;
|
|
1546
1551
|
};
|
|
1547
1552
|
// Identity for the public read endpoints travels as query params instead of
|
|
@@ -1556,6 +1561,12 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1556
1561
|
url.searchParams.set('sid', sessionId);
|
|
1557
1562
|
}
|
|
1558
1563
|
url.searchParams.set('channel', getChannel());
|
|
1564
|
+
// Emitted only when previewing: a live-traffic search URL has to stay
|
|
1565
|
+
// byte-identical to today's or the edge cache fragments and the hit rate
|
|
1566
|
+
// regresses on the per-keystroke hot path.
|
|
1567
|
+
if (hasPreviewKey()) {
|
|
1568
|
+
url.searchParams.set('preview', '1');
|
|
1569
|
+
}
|
|
1559
1570
|
};
|
|
1560
1571
|
// Parsing `baseURL` once at API construction avoids re-parsing the host on
|
|
1561
1572
|
// every keystroke when `getURL` runs inside the autocomplete hot path.
|
|
@@ -1668,7 +1679,7 @@ const createEvoSearchAPI = ({ fetch: fetchImpl = window.fetch, baseURL, userId,
|
|
|
1668
1679
|
const clearRecents = () => sendMutation('/user/recents', 'ClearRecents', 'DELETE');
|
|
1669
1680
|
// Resilience lives here, not at each call site, so no consumer can opt out —
|
|
1670
1681
|
// the headless channel previously had no deadline and no retry.
|
|
1671
|
-
const search = async (query, limit =
|
|
1682
|
+
const search = async (query, limit = 24, signal) => {
|
|
1672
1683
|
logger.info(`EvoSearch API: Search request - query length: ${query.length}, limit: ${limit}`);
|
|
1673
1684
|
const data = await withSearchResilience((attemptSignal) => getJSON('/search', 'Search', { q: query, limit: String(limit) }, attemptSignal),
|
|
1674
1685
|
// Shared stand-in is safe: the wrapper removes its abort listener per attempt.
|
|
@@ -2083,7 +2094,7 @@ const init = (params) => {
|
|
|
2083
2094
|
const tag = ({ data }) => {
|
|
2084
2095
|
try {
|
|
2085
2096
|
return {
|
|
2086
|
-
sdkVersion: "1.
|
|
2097
|
+
sdkVersion: "1.68.1" || '',
|
|
2087
2098
|
searchQuery: data['searchQuery'],
|
|
2088
2099
|
searchResults: data['searchResults'],
|
|
2089
2100
|
timestamp: Date.now(),
|
|
@@ -2092,7 +2103,7 @@ const tag = ({ data }) => {
|
|
|
2092
2103
|
catch (err) {
|
|
2093
2104
|
console.error(`EvoSearch SDK: Tagging failed - ${err}`);
|
|
2094
2105
|
return {
|
|
2095
|
-
sdkVersion: "1.
|
|
2106
|
+
sdkVersion: "1.68.1" ,
|
|
2096
2107
|
timestamp: Date.now(),
|
|
2097
2108
|
};
|
|
2098
2109
|
}
|