@faststore/core 3.0.77 → 3.0.78
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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +13 -13
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/cache/config.json +3 -3
- package/.next/cache/eslint/.cache_1gneedd +1 -1
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/next-minimal-server.js.nft.json +1 -1
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.js +1 -1
- package/.next/prerender-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/202.js +1 -1
- package/.next/server/chunks/484.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/en-US/404.html +2 -2
- package/.next/server/pages/en-US/404.json +1 -1
- package/.next/server/pages/en-US/500.html +2 -2
- package/.next/server/pages/en-US/500.json +1 -1
- package/.next/server/pages/en-US/account.html +2 -2
- package/.next/server/pages/en-US/account.json +1 -1
- package/.next/server/pages/en-US/checkout.html +2 -2
- package/.next/server/pages/en-US/checkout.json +1 -1
- package/.next/server/pages/en-US/login.html +2 -2
- package/.next/server/pages/en-US/login.json +1 -1
- package/.next/server/pages/en-US/s.html +2 -2
- package/.next/server/pages/en-US/s.json +1 -1
- package/.next/server/pages/en-US.html +2 -2
- package/.next/server/pages/en-US.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/202.7a1536b79ac06ff5.js +1 -0
- package/.next/static/chunks/484.50120f474d0025d6.js +1 -0
- package/.next/static/chunks/{webpack-e9b95bf547123b36.js → webpack-bff8c8778c4210df.js} +1 -1
- package/.next/trace +95 -95
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +4 -4
- package/package.json +2 -2
- package/src/sdk/analytics/platform/vtex/search.ts +14 -12
- package/.next/static/chunks/202.c7d8a71173edecfb.js +0 -1
- package/.next/static/chunks/484.b82b73b1d8c37e02.js +0 -1
- /package/.next/static/{Ma0rFChMXIHPrBtwj1Bpj → nX15QhjRzwlfNm6becdga}/_buildManifest.js +0 -0
- /package/.next/static/{Ma0rFChMXIHPrBtwj1Bpj → nX15QhjRzwlfNm6becdga}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -103,7 +103,7 @@ Route (pages) Size First Load JS
|
|
|
103
103
|
├ chunks/framework-8e279965036b6169.js 45.4 kB
|
|
104
104
|
├ chunks/main-6f63f6746cc029db.js 33.1 kB
|
|
105
105
|
├ chunks/pages/_app-c25fabc2435c8961.js 12.6 kB
|
|
106
|
-
├ chunks/webpack-
|
|
106
|
+
├ chunks/webpack-bff8c8778c4210df.js 2.45 kB
|
|
107
107
|
└ css/5d1f64b61ea581f4.css 3.05 kB
|
|
108
108
|
|
|
109
109
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
$ jest
|
|
2
|
-
PASS test/
|
|
3
|
-
PASS test/
|
|
4
|
-
PASS test/server/index.test.ts (
|
|
2
|
+
PASS test/server/cms/index.test.ts (29.598 s)
|
|
3
|
+
PASS test/utils/multipleTemplates.test.ts (30.208 s)
|
|
4
|
+
PASS test/server/index.test.ts (31.989 s)
|
|
5
5
|
|
|
6
6
|
Test Suites: 3 passed, 3 total
|
|
7
7
|
Tests: 19 passed, 19 total
|
|
8
8
|
Snapshots: 0 total
|
|
9
|
-
Time:
|
|
9
|
+
Time: 32.923 s
|
|
10
10
|
Ran all test suites.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.78",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
"node": "18.19.0",
|
|
130
130
|
"yarn": "1.19.1"
|
|
131
131
|
},
|
|
132
|
-
"gitHead": "
|
|
132
|
+
"gitHead": "934c6a209a662712877f39e90c476544ce8a22ef"
|
|
133
133
|
}
|
|
@@ -18,30 +18,32 @@ const randomUUID = () =>
|
|
|
18
18
|
? crypto.randomUUID()
|
|
19
19
|
: (Math.random() * 1e6).toFixed(0)
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const createOrRefreshCookie = (key: string, expiresSecond: number) => {
|
|
22
22
|
// Setting the domain attribute specifies which host can receive it; we need it to make the cookies available on the `secure` subdomain.
|
|
23
23
|
// Although https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie mentioned leading dot (.) is not needed and ignored. I couldn't set the cookies without it.
|
|
24
|
-
const urlDomain =
|
|
24
|
+
const urlDomain =
|
|
25
|
+
process.env.NODE_ENV === 'development'
|
|
26
|
+
? '.localhost'
|
|
27
|
+
: `.${new URL(config.storeUrl).hostname}`
|
|
25
28
|
|
|
26
29
|
return () => {
|
|
27
|
-
|
|
30
|
+
let currentValue = getCookie(key)
|
|
31
|
+
const isExpired = currentValue === undefined
|
|
28
32
|
|
|
29
33
|
if (isExpired) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
document.cookie = `${key}=${value}; max-age=${expiresSecond}; domain=${urlDomain}; path=/;`
|
|
33
|
-
// Setting the `path=/` makes the cookie accessible on any path of the domain/subdomain
|
|
34
|
-
|
|
35
|
-
return value
|
|
34
|
+
currentValue = randomUUID()
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
// Setting the `path=/` makes the cookie accessible on any path of the domain/subdomain
|
|
38
|
+
document.cookie = `${key}=${currentValue}; max-age=${expiresSecond}; domain=${urlDomain}; path=/;`
|
|
39
|
+
|
|
40
|
+
return currentValue
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
const user = {
|
|
43
|
-
anonymous:
|
|
44
|
-
session:
|
|
45
|
+
anonymous: createOrRefreshCookie('vtex-faststore-anonymous', ONE_YEAR_S),
|
|
46
|
+
session: createOrRefreshCookie('vtex-faststore-session', THIRTY_MINUTES_S),
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
type SearchEvent =
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[202,484],{3202:function(e,t,r){r.r(t),r.d(t,{default:function(){return sendEvent}});var n=r(5484);function sendEvent(e){var t,r;null===(t=window)||void 0===t||null===(r=t.sendrc)||void 0===r||r.call(t,e.name,e.params),(0,n.default)(e)}},5484:function(e,t,r){r.r(t),r.d(t,{default:function(){return search}});var n=r(9499),o=r(7997),a=r.n(o);function getCookie(e){for(var t of decodeURIComponent(document.cookie).split(";")){var[r,n]=t.trim().split("=");if(r===e)return n}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,n.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var randomUUID=()=>"function"==typeof crypto.randomUUID?crypto.randomUUID():(1e6*Math.random()).toFixed(0),createCookie=(e,t)=>{var r=".".concat(new URL(a().storeUrl).hostname);return()=>{if(void 0===getCookie(e)){var n=randomUUID();return document.cookie="".concat(e,"=").concat(n,"; max-age=").concat(t,"; domain=").concat(r,"; path=/;"),n}return getCookie(e)}},s={anonymous:createCookie("vtex-faststore-anonymous",31536e3),session:createCookie("vtex-faststore-session",1800)},sendEvent=e=>fetch("https://sp.vtex.com/event-api/v1/".concat(a().api.storeId,"/event"),{method:"POST",body:JSON.stringify(_objectSpread(_objectSpread({},e),{},{userAgent:navigator.userAgent,anonymous:s.anonymous(),session:s.session()})),headers:{"content-type":"application/json"}}),isFullTextSearch=e=>"string"==typeof e.searchParams.get("q")&&/^\/s(\/)?$/g.test(e.pathname);setInterval(()=>sendEvent({type:"session.ping"}),6e4);var search=e=>{switch(e.name){case"search_select_item":var t=new URL(e.params.url);if(!isFullTextSearch(t))return;for(var r of null!==(n=e.params.items)&&void 0!==n?n:[]){var n,o,a,s=null!==(o=r.item_id)&&void 0!==o?o:r.item_variant,c=r.index;s&&c&&sendEvent({type:"search.click",productId:s,position:c,url:t.href,text:null!==(a=t.searchParams.get("q"))&&void 0!==a?a:"<empty>"})}break;case"intelligent_search_query":sendEvent({type:"search.query",url:e.params.url,text:e.params.term,misspelled:e.params.isTermMisspelled,match:e.params.totalCount,operator:e.params.logicalOperator,locale:e.params.locale})}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[484],{5484:function(e,t,r){r.r(t),r.d(t,{default:function(){return search}});var o=r(9499),n=r(7997),a=r.n(n);function getCookie(e){for(var t of decodeURIComponent(document.cookie).split(";")){var[r,o]=t.trim().split("=");if(r===e)return o}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){(0,o.Z)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var randomUUID=()=>"function"==typeof crypto.randomUUID?crypto.randomUUID():(1e6*Math.random()).toFixed(0),createCookie=(e,t)=>{var r=".".concat(new URL(a().storeUrl).hostname);return()=>{if(void 0===getCookie(e)){var o=randomUUID();return document.cookie="".concat(e,"=").concat(o,"; max-age=").concat(t,"; domain=").concat(r,"; path=/;"),o}return getCookie(e)}},s={anonymous:createCookie("vtex-faststore-anonymous",31536e3),session:createCookie("vtex-faststore-session",1800)},sendEvent=e=>fetch("https://sp.vtex.com/event-api/v1/".concat(a().api.storeId,"/event"),{method:"POST",body:JSON.stringify(_objectSpread(_objectSpread({},e),{},{userAgent:navigator.userAgent,anonymous:s.anonymous(),session:s.session()})),headers:{"content-type":"application/json"}}),isFullTextSearch=e=>"string"==typeof e.searchParams.get("q")&&/^\/s(\/)?$/g.test(e.pathname);setInterval(()=>sendEvent({type:"session.ping"}),6e4);var search=e=>{switch(e.name){case"search_select_item":var t=new URL(e.params.url);if(!isFullTextSearch(t))return;for(var r of null!==(o=e.params.items)&&void 0!==o?o:[]){var o,n,a,s=null!==(n=r.item_id)&&void 0!==n?n:r.item_variant,c=r.index;s&&c&&sendEvent({type:"search.click",productId:s,position:c,url:t.href,text:null!==(a=t.searchParams.get("q"))&&void 0!==a?a:"<empty>"})}break;case"intelligent_search_query":sendEvent({type:"search.query",url:e.params.url,text:e.params.term,misspelled:e.params.isTermMisspelled,match:e.params.totalCount,operator:e.params.logicalOperator,locale:e.params.locale})}}}}]);
|
|
File without changes
|
|
File without changes
|