@faststore/core 3.3.0 → 3.4.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/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +14 -14
- 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/react-loadable-manifest.json +1 -1
- package/.next/routes-manifest.json +1 -1
- package/.next/server/chunks/3202.js +1 -1
- package/.next/server/chunks/5671.js +1 -1
- package/.next/server/chunks/5754.js +1 -1
- package/.next/server/chunks/8724.js +1 -0
- package/.next/server/chunks/9844.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.js.nft.json +1 -1
- package/.next/server/pages/500.js.nft.json +1 -1
- package/.next/server/pages/[...slug].js.nft.json +1 -1
- package/.next/server/pages/[slug]/p.js.nft.json +1 -1
- package/.next/server/pages/_app.js.nft.json +1 -1
- package/.next/server/pages/_document.js.nft.json +1 -1
- package/.next/server/pages/_error.js.nft.json +1 -1
- package/.next/server/pages/account.js.nft.json +1 -1
- package/.next/server/pages/api/graphql.js.nft.json +1 -1
- package/.next/server/pages/api/health/live.js.nft.json +1 -1
- package/.next/server/pages/api/health/ready.js.nft.json +1 -1
- package/.next/server/pages/api/preview.js.nft.json +1 -1
- package/.next/server/pages/checkout.js.nft.json +1 -1
- package/.next/server/pages/en-US/404.html +1 -1
- package/.next/server/pages/en-US/500.html +1 -1
- package/.next/server/pages/en-US/account.html +1 -1
- package/.next/server/pages/en-US/checkout.html +1 -1
- package/.next/server/pages/en-US/login.html +1 -1
- package/.next/server/pages/en-US/s.html +1 -1
- package/.next/server/pages/en-US.html +1 -1
- package/.next/server/pages/index.js.nft.json +1 -1
- package/.next/server/pages/login.js.nft.json +1 -1
- package/.next/server/pages/s.js.nft.json +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/static/chunks/{1153.d7522522b6c917ed.js → 1153.7f616071da309cf5.js} +1 -1
- package/.next/static/chunks/3202.a1dabb5ce227338a.js +1 -0
- package/.next/static/chunks/8724.66f3c6d121015974.js +1 -0
- package/.next/static/chunks/pages/{_app-7d970aad41a57338.js → _app-9d791333b87e7c18.js} +1 -1
- package/.next/static/chunks/webpack-7f4e30e12a4356f1.js +1 -0
- package/.next/trace +98 -97
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +5 -5
- package/CHANGELOG.md +10 -0
- package/package.json +9 -9
- package/src/Layout.tsx +2 -2
- package/src/sdk/analytics/hooks/usePageViewEvent.ts +3 -2
- package/src/sdk/analytics/platform/vtex/index.ts +2 -1
- package/src/sdk/analytics/platform/vtex/rc.ts +128 -0
- package/src/sdk/analytics/platform/vtex/search.ts +2 -14
- package/src/sdk/analytics/types.ts +55 -0
- package/.next/static/chunks/3202.d7d5a83625bed7aa.js +0 -1
- package/.next/static/chunks/webpack-d4f52bd51f6992df.js +0 -1
- /package/.next/static/{U_FZZ36fhz5jUdj4hsVOx → ydOg-NvnhhPR1udR7QRZO}/_buildManifest.js +0 -0
- /package/.next/static/{U_FZZ36fhz5jUdj4hsVOx → ydOg-NvnhhPR1udR7QRZO}/_ssgManifest.js +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -46,10 +46,10 @@ Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Cont
|
|
|
46
46
|
Collecting build traces ...
|
|
47
47
|
|
|
48
48
|
Route (pages) Size First Load JS
|
|
49
|
-
┌ ● / 3.21 kB
|
|
49
|
+
┌ ● / 3.21 kB 122 kB
|
|
50
50
|
├ └ css/b1806cbafd0c1f81.css 3.06 kB
|
|
51
51
|
├ /_app 0 B 91.8 kB
|
|
52
|
-
├ ● /[...slug] 2 kB
|
|
52
|
+
├ ● /[...slug] 2 kB 132 kB
|
|
53
53
|
├ ● /[slug]/p 30.5 kB 149 kB
|
|
54
54
|
├ ├ css/bf1560439df2c1a1.css 5.66 kB
|
|
55
55
|
├ ├ css/e3ff5d95518a5c79.css 6.01 kB
|
|
@@ -64,15 +64,15 @@ Route (pages) Size First Load JS
|
|
|
64
64
|
├ ● /checkout 694 B 119 kB
|
|
65
65
|
├ ● /login 1.57 kB 120 kB
|
|
66
66
|
└ ● /s 2.63 kB 132 kB
|
|
67
|
-
+ First Load JS shared by all 94.
|
|
67
|
+
+ First Load JS shared by all 94.9 kB
|
|
68
68
|
├ chunks/framework-12a146e94cfcf7c4.js 45.4 kB
|
|
69
69
|
├ chunks/main-209ac4974b020af1.js 33.1 kB
|
|
70
|
-
├ chunks/pages/_app-
|
|
71
|
-
├ chunks/webpack-
|
|
70
|
+
├ chunks/pages/_app-9d791333b87e7c18.js 9.9 kB
|
|
71
|
+
├ chunks/webpack-7f4e30e12a4356f1.js 3.5 kB
|
|
72
72
|
└ css/ee0556daedda6306.css 3.07 kB
|
|
73
73
|
|
|
74
74
|
λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
|
|
75
75
|
○ (Static) automatically rendered as static HTML (uses no initial props)
|
|
76
76
|
● (SSG) automatically generated as static HTML + JSON (uses getStaticProps)
|
|
77
77
|
|
|
78
|
-
Done in
|
|
78
|
+
Done in 69.01s.
|
package/.turbo/turbo-lint.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
yarn run v1.22.22
|
|
2
2
|
$ jest
|
|
3
|
-
PASS test/
|
|
4
|
-
PASS test/
|
|
5
|
-
PASS test/server/index.test.ts (
|
|
3
|
+
PASS test/utils/multipleTemplates.test.ts (35.757 s)
|
|
4
|
+
PASS test/server/cms/index.test.ts (36.4 s)
|
|
5
|
+
PASS test/server/index.test.ts (39.807 s)
|
|
6
6
|
|
|
7
7
|
Test Suites: 3 passed, 3 total
|
|
8
8
|
Tests: 19 passed, 19 total
|
|
9
9
|
Snapshots: 0 total
|
|
10
|
-
Time:
|
|
10
|
+
Time: 40.905 s
|
|
11
11
|
Ran all test suites.
|
|
12
|
-
Done in
|
|
12
|
+
Done in 43.12s.
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 3.4.1 (2024-12-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @faststore/core
|
|
9
|
+
|
|
10
|
+
# [3.4.0](https://github.com/vtex/faststore/compare/v3.3.0...v3.4.0) (2024-12-19)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- handle RC Events ([#2567](https://github.com/vtex/faststore/issues/2567)) ([486563d](https://github.com/vtex/faststore/commit/486563dd6e15a04686c99bcfaea6f216520255c9))
|
|
15
|
+
|
|
6
16
|
# [3.3.0](https://github.com/vtex/faststore/compare/v3.2.1...v3.3.0) (2024-12-18)
|
|
7
17
|
|
|
8
18
|
### Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "vtex/faststore",
|
|
6
6
|
"browserslist": "supports es6-module and not dead",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"@envelop/graphql-jit": "^8.0.3",
|
|
44
44
|
"@envelop/parser-cache": "^6.0.2",
|
|
45
45
|
"@envelop/validation-cache": "^6.0.2",
|
|
46
|
-
"@faststore/api": "^3.1
|
|
47
|
-
"@faststore/components": "^3.1
|
|
48
|
-
"@faststore/graphql-utils": "^3.1
|
|
49
|
-
"@faststore/lighthouse": "^3.1
|
|
50
|
-
"@faststore/sdk": "^3.1
|
|
51
|
-
"@faststore/ui": "^3.1
|
|
46
|
+
"@faststore/api": "^3.4.1",
|
|
47
|
+
"@faststore/components": "^3.4.1",
|
|
48
|
+
"@faststore/graphql-utils": "^3.4.1",
|
|
49
|
+
"@faststore/lighthouse": "^3.4.1",
|
|
50
|
+
"@faststore/sdk": "^3.4.1",
|
|
51
|
+
"@faststore/ui": "^3.4.1",
|
|
52
52
|
"@graphql-codegen/cli": "5.0.2",
|
|
53
53
|
"@graphql-codegen/client-preset": "4.2.6",
|
|
54
54
|
"@graphql-codegen/typescript": "4.0.7",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@cypress/code-coverage": "^3.12.1",
|
|
89
89
|
"@envelop/testing": "^6.0.0",
|
|
90
|
-
"@faststore/eslint-config": "^3.1
|
|
90
|
+
"@faststore/eslint-config": "^3.4.1",
|
|
91
91
|
"@lhci/cli": "^0.9.0",
|
|
92
92
|
"@testing-library/cypress": "^10.0.1",
|
|
93
93
|
"@types/cypress": "^1.1.3",
|
|
@@ -128,5 +128,5 @@
|
|
|
128
128
|
"node": "18.19.0",
|
|
129
129
|
"yarn": "1.19.1"
|
|
130
130
|
},
|
|
131
|
-
"gitHead": "
|
|
131
|
+
"gitHead": "1cbe95df143974928d4bf6514b76a275bc3787a8"
|
|
132
132
|
}
|
package/src/Layout.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PropsWithChildren, ReactElement } from 'react'
|
|
2
2
|
|
|
3
3
|
import { usePageViewEvent } from './sdk/analytics/hooks/usePageViewEvent'
|
|
4
4
|
|
|
5
5
|
function Layout({ children }: PropsWithChildren) {
|
|
6
|
-
usePageViewEvent()
|
|
6
|
+
usePageViewEvent((children as ReactElement)?.props)
|
|
7
7
|
|
|
8
8
|
return <>{children}</>
|
|
9
9
|
}
|
|
@@ -2,7 +2,7 @@ import type { PageViewEvent } from '@faststore/sdk'
|
|
|
2
2
|
import { useRouter } from 'next/router'
|
|
3
3
|
import { useCallback, useEffect } from 'react'
|
|
4
4
|
|
|
5
|
-
export const usePageViewEvent = () => {
|
|
5
|
+
export const usePageViewEvent = (props?: any) => {
|
|
6
6
|
const sendPageViewEvent = useCallback(() => {
|
|
7
7
|
import('@faststore/sdk').then(({ sendAnalyticsEvent }) => {
|
|
8
8
|
sendAnalyticsEvent<PageViewEvent>({
|
|
@@ -11,10 +11,11 @@ export const usePageViewEvent = () => {
|
|
|
11
11
|
page_title: document.title,
|
|
12
12
|
page_location: location.href,
|
|
13
13
|
send_page_view: true,
|
|
14
|
+
...props,
|
|
14
15
|
},
|
|
15
16
|
})
|
|
16
17
|
})
|
|
17
|
-
}, [])
|
|
18
|
+
}, [props])
|
|
18
19
|
|
|
19
20
|
const router = useRouter()
|
|
20
21
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AnalyticsEvent } from '@faststore/sdk'
|
|
2
2
|
|
|
3
|
+
import handleRCEvent from './rc'
|
|
3
4
|
import handleSearchEvent from './search'
|
|
4
5
|
|
|
5
6
|
export default function sendEvent(event: AnalyticsEvent) {
|
|
6
7
|
// VTEX RC
|
|
7
|
-
|
|
8
|
+
handleRCEvent(event)
|
|
8
9
|
|
|
9
10
|
// VTEX Intelligent Search
|
|
10
11
|
handleSearchEvent(event)
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { AnalyticsEvent, PageViewEvent } from '@faststore/sdk'
|
|
2
|
+
import { ServerProductQueryQuery } from '@generated/graphql'
|
|
3
|
+
import {
|
|
4
|
+
CategoryView,
|
|
5
|
+
DepartmentView,
|
|
6
|
+
HomeView,
|
|
7
|
+
IntelligentSearchQueryEvent,
|
|
8
|
+
InternalSiteSearchView,
|
|
9
|
+
OtherView,
|
|
10
|
+
ProductView,
|
|
11
|
+
SearchEvents,
|
|
12
|
+
} from '../../types'
|
|
13
|
+
|
|
14
|
+
const EventNames = {
|
|
15
|
+
OTHER_VIEW: 'otherView',
|
|
16
|
+
HOME_VIEW: 'homeView',
|
|
17
|
+
CATEGORY_VIEW: 'categoryView',
|
|
18
|
+
DEPARTMENT_VIEW: 'departmentView',
|
|
19
|
+
INTERNAL_SITE_SEARCH_VIEW: 'internalSiteSearchView',
|
|
20
|
+
PRODUCT_VIEW: 'productView',
|
|
21
|
+
} as const
|
|
22
|
+
|
|
23
|
+
type RequestCaptureEventNames = (typeof EventNames)[keyof typeof EventNames]
|
|
24
|
+
type RequestCaptureEvent =
|
|
25
|
+
| HomeView
|
|
26
|
+
| CategoryView
|
|
27
|
+
| DepartmentView
|
|
28
|
+
| InternalSiteSearchView
|
|
29
|
+
| ProductView
|
|
30
|
+
| OtherView
|
|
31
|
+
|
|
32
|
+
const sendEvent = (
|
|
33
|
+
eventName: RequestCaptureEventNames,
|
|
34
|
+
eventParams: RequestCaptureEvent
|
|
35
|
+
) => {
|
|
36
|
+
window?.sendrc?.(eventName, eventParams)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const handleEvent = (event: AnalyticsEvent | SearchEvents) => {
|
|
40
|
+
let eventParams
|
|
41
|
+
switch (event.name) {
|
|
42
|
+
case 'page_view':
|
|
43
|
+
eventParams = (event as PageViewEvent).params
|
|
44
|
+
const pageType = eventParams?.page?.type ?? eventParams?.type
|
|
45
|
+
|
|
46
|
+
switch (pageType) {
|
|
47
|
+
case 'plp':
|
|
48
|
+
if (!eventParams?.page_location?.includes('fuzzy')) {
|
|
49
|
+
// Skip when there is no fuzzy parameters on the URL,
|
|
50
|
+
// otherwise it'll be sent twice (once without fuzzy and once with fuzzy)
|
|
51
|
+
break
|
|
52
|
+
}
|
|
53
|
+
const collection = eventParams?.data?.collection
|
|
54
|
+
const collectionCategoryList =
|
|
55
|
+
collection?.breadcrumbList?.itemListElement
|
|
56
|
+
if (collectionCategoryList.length > 1) {
|
|
57
|
+
sendEvent(EventNames.CATEGORY_VIEW, {
|
|
58
|
+
departmentName: collectionCategoryList[0]?.name,
|
|
59
|
+
categoryId: collection?.id,
|
|
60
|
+
categoryName:
|
|
61
|
+
collectionCategoryList[collectionCategoryList.length - 1]?.name,
|
|
62
|
+
})
|
|
63
|
+
} else {
|
|
64
|
+
sendEvent(EventNames.DEPARTMENT_VIEW, {
|
|
65
|
+
departmentId: collection?.id,
|
|
66
|
+
departmentName: collectionCategoryList[0]?.name,
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
break
|
|
71
|
+
|
|
72
|
+
case 'pdp':
|
|
73
|
+
const product = eventParams?.data
|
|
74
|
+
?.product as ServerProductQueryQuery['product']
|
|
75
|
+
const productCategoryList = product?.breadcrumbList?.itemListElement
|
|
76
|
+
const offers = product?.offers?.offers
|
|
77
|
+
const sellerIds = offers.map((offer) => offer.seller.identifier)
|
|
78
|
+
const skusOutOfStock = offers.filter(
|
|
79
|
+
(offer) => offer.availability === 'https://schema.org/OutOfStock'
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
sendEvent(EventNames.PRODUCT_VIEW, {
|
|
83
|
+
skuStockOutFromProductDetail: skusOutOfStock,
|
|
84
|
+
productId: product?.isVariantOf?.productGroupID,
|
|
85
|
+
productName: product?.isVariantOf?.name,
|
|
86
|
+
productBrandName: product?.brand?.name,
|
|
87
|
+
productDepartmentName: productCategoryList
|
|
88
|
+
? productCategoryList[0]?.name
|
|
89
|
+
: '',
|
|
90
|
+
productCategoryName:
|
|
91
|
+
productCategoryList.length > 1
|
|
92
|
+
? productCategoryList[productCategoryList.length - 2]?.name
|
|
93
|
+
: '',
|
|
94
|
+
productPrice: offers[0]?.price,
|
|
95
|
+
productListPrice: offers[0]?.listPrice,
|
|
96
|
+
sellerId: offers[0]?.seller?.identifier,
|
|
97
|
+
sellerIds: sellerIds.join(','),
|
|
98
|
+
})
|
|
99
|
+
break
|
|
100
|
+
|
|
101
|
+
case 'home':
|
|
102
|
+
sendEvent(EventNames.HOME_VIEW, {})
|
|
103
|
+
break
|
|
104
|
+
|
|
105
|
+
case 'search':
|
|
106
|
+
// This one is skipped because the event related to search view is being
|
|
107
|
+
// sent using the intelligent_search_query event due to its parameters
|
|
108
|
+
break
|
|
109
|
+
|
|
110
|
+
default:
|
|
111
|
+
sendEvent(EventNames.OTHER_VIEW, {})
|
|
112
|
+
}
|
|
113
|
+
break
|
|
114
|
+
|
|
115
|
+
case 'intelligent_search_query':
|
|
116
|
+
eventParams = (event as IntelligentSearchQueryEvent).params
|
|
117
|
+
sendEvent(EventNames.INTERNAL_SITE_SEARCH_VIEW, {
|
|
118
|
+
siteSearchTerm: eventParams.term,
|
|
119
|
+
siteSearchForm: eventParams.url,
|
|
120
|
+
siteSearchResults: eventParams.totalCount,
|
|
121
|
+
})
|
|
122
|
+
break
|
|
123
|
+
|
|
124
|
+
default:
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export default handleEvent
|
|
@@ -2,12 +2,7 @@
|
|
|
2
2
|
* More info at: https://developers.vtex.com/docs/api-reference/intelligent-search-events-api-headless
|
|
3
3
|
*/
|
|
4
4
|
import type { AnalyticsEvent } from '@faststore/sdk'
|
|
5
|
-
import type {
|
|
6
|
-
IntelligentSearchAutocompleteClickEvent,
|
|
7
|
-
IntelligentSearchAutocompleteQueryEvent,
|
|
8
|
-
IntelligentSearchQueryEvent,
|
|
9
|
-
SearchSelectItemEvent,
|
|
10
|
-
} from '../../types'
|
|
5
|
+
import type { SearchEvents } from '../../types'
|
|
11
6
|
|
|
12
7
|
import config from '../../../../../discovery.config'
|
|
13
8
|
import { getCookie } from '../../../../utils/getCookie'
|
|
@@ -103,14 +98,7 @@ const isFullTextSearch = (url: URL) =>
|
|
|
103
98
|
typeof url.searchParams.get('q') === 'string' &&
|
|
104
99
|
/^\/s(\/)?$/g.test(url.pathname)
|
|
105
100
|
|
|
106
|
-
const handleEvent = (
|
|
107
|
-
event:
|
|
108
|
-
| AnalyticsEvent
|
|
109
|
-
| SearchSelectItemEvent
|
|
110
|
-
| IntelligentSearchQueryEvent
|
|
111
|
-
| IntelligentSearchAutocompleteQueryEvent
|
|
112
|
-
| IntelligentSearchAutocompleteClickEvent
|
|
113
|
-
) => {
|
|
101
|
+
const handleEvent = (event: AnalyticsEvent | SearchEvents) => {
|
|
114
102
|
switch (event.name) {
|
|
115
103
|
case 'search_select_item': {
|
|
116
104
|
const url = new URL(event.params.url)
|
|
@@ -60,3 +60,58 @@ export interface IntelligentSearchAutocompleteClickEvent {
|
|
|
60
60
|
name: 'intelligent_search_autocomplete_click'
|
|
61
61
|
params: IntelligentSearchAutocompleteClickParams
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
export type SearchEvents =
|
|
65
|
+
| SearchSelectItemEvent
|
|
66
|
+
| IntelligentSearchQueryEvent
|
|
67
|
+
| IntelligentSearchAutocompleteQueryEvent
|
|
68
|
+
| IntelligentSearchAutocompleteClickEvent
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* RC event types
|
|
72
|
+
* Types copied from Request Capture App: https://github.com/vtex/request-capture-app/blob/1becac32c002cb03a57bf36c8a7f9400eab8b933/react/typings/rcevents.d.ts
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
export interface HomeView {}
|
|
76
|
+
|
|
77
|
+
export interface CategoryView {
|
|
78
|
+
departmentId?: string
|
|
79
|
+
departmentName?: string
|
|
80
|
+
categoryId?: string
|
|
81
|
+
categoryName?: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface DepartmentView {
|
|
85
|
+
departmentId?: string
|
|
86
|
+
departmentName?: string
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface InternalSiteSearchView {
|
|
90
|
+
siteSearchTerm?: string // e.g.: "areia"
|
|
91
|
+
siteSearchForm?: string // e.g.: "/gatos/ambiente--gatos/caixa-de-areia/areia?PS=20"
|
|
92
|
+
siteSearchCategory?: string // e.g.: "10000283"
|
|
93
|
+
siteSearchResults?: number // e.g.: 26
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
type SkuId = string
|
|
97
|
+
|
|
98
|
+
export interface ProductView {
|
|
99
|
+
skuStockOutFromProductDetail: string[]
|
|
100
|
+
productId: string
|
|
101
|
+
productReferenceId: string
|
|
102
|
+
productEans: string[]
|
|
103
|
+
skuStocks: Record<SkuId, number>
|
|
104
|
+
productName: string
|
|
105
|
+
productBrandId: string
|
|
106
|
+
productBrandName: string
|
|
107
|
+
productDepartmentId: string
|
|
108
|
+
productDepartmentName: string
|
|
109
|
+
productCategoryId: string
|
|
110
|
+
productCategoryName: string
|
|
111
|
+
productListPrice: number
|
|
112
|
+
productPrice: number
|
|
113
|
+
sellerId: string
|
|
114
|
+
sellerIds: string // e.g.: "00443713,04412311,1"
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface OtherView {}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3202,5484],{3202:function(e,t,r){r.r(t),r.d(t,{default:function(){return sendEvent}});var a=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,a.default)(e)}},5484:function(e,t,r){r.r(t),r.d(t,{default:function(){return search}});var a=r(9499),o=r(5430),n=r.n(o);function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}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,a.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().replaceAll("-",""):(1e6*Math.random()).toFixed(0),createOrRefreshCookie=(e,t)=>{var r=".".concat(new URL(n().storeUrl).hostname);return()=>{var a=function(e){for(var t of decodeURIComponent(document.cookie).split(";")){var[r,a]=t.trim().split("=");if(r===e)return a}}(e);return void 0===a&&(a=randomUUID()),document.cookie="".concat(e,"=").concat(a,"; max-age=").concat(t,"; domain=").concat(r,"; path=/;"),a}},s={anonymous:createOrRefreshCookie("vtex-search-anonymous",31536e3),session:createOrRefreshCookie("vtex-search-session",1800)},sendEvent=e=>fetch("https://sp.vtex.com/event-api/v1/".concat(n().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,r,a=new URL(e.params.url);if(!isFullTextSearch(a))return;for(var o of null!==(n=e.params.items)&&void 0!==n?n:[]){var n,s,c,i=null!==(s=o.item_id)&&void 0!==s?s:o.item_variant,l=o.index;i&&l&&sendEvent({type:"search.click",productId:i,position:l,url:a.href,text:null!==(c=a.searchParams.get("q"))&&void 0!==c?c:"<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});break;case"intelligent_search_autocomplete_query":sendEvent({type:"search.autocomplete.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});break;case"intelligent_search_autocomplete_click":sendEvent(_objectSpread(_objectSpread({text:e.params.term,url:null!==(t=e.params.url)&&void 0!==t?t:"",productId:null!==(r=e.params.productId)&&void 0!==r?r:""},e.params.position&&{position:e.params.position}),{},{type:"search.autocomplete.click"}))}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(){"use strict";var e,r,t,_,a,c,n,u,f,i,o,d,b={},p={};function __webpack_require__(e){var r=p[e];if(void 0!==r)return r.exports;var t=p[e]={exports:{}},_=!0;try{b[e].call(t.exports,t,t.exports,__webpack_require__),_=!1}finally{_&&delete p[e]}return t.exports}__webpack_require__.m=b,e=[],__webpack_require__.O=function(r,t,_,a){if(t){a=a||0;for(var c=e.length;c>0&&e[c-1][2]>a;c--)e[c]=e[c-1];e[c]=[t,_,a];return}for(var n=1/0,c=0;c<e.length;c++){for(var t=e[c][0],_=e[c][1],a=e[c][2],u=!0,f=0;f<t.length;f++)n>=a&&Object.keys(__webpack_require__.O).every(function(e){return __webpack_require__.O[e](t[f])})?t.splice(f--,1):(u=!1,a<n&&(n=a));if(u){e.splice(c--,1);var i=_()}}return i},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,{a:r}),r},t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},__webpack_require__.t=function(e,_){if(1&_&&(e=this(e)),8&_||"object"==typeof e&&e&&(4&_&&e.__esModule||16&_&&"function"==typeof e.then))return e;var a=Object.create(null);__webpack_require__.r(a);var c={};r=r||[null,t({}),t([]),t(t)];for(var n=2&_&&e;"object"==typeof n&&!~r.indexOf(n);n=t(n))Object.getOwnPropertyNames(n).forEach(function(r){c[r]=function(){return e[r]}});return c.default=function(){return e},__webpack_require__.d(a,c),a},__webpack_require__.d=function(e,r){for(var t in r)__webpack_require__.o(r,t)&&!__webpack_require__.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce(function(r,t){return __webpack_require__.f[t](e,r),r},[]))},__webpack_require__.u=function(e){return 9638===e?"static/chunks/9638-24a86482d4a4b434.js":3472===e?"static/chunks/3472-be81153e7a982f91.js":6379===e?"static/chunks/6379-6050cc5d5e5f2fa2.js":"static/chunks/"+(({84:"BannerText",549:"CartItem",866:"FilterSkeleton",1724:"EmptyCart",1736:"RegionModal",1781:"CartSidebar",2553:"OrderSummary",2858:"BannerNewsletter",2985:"Gift",3506:"ProductShelf",4600:"UIButton",5647:"ButtonSignIn",5890:"UIBannerText",5906:"UIToast",6636:"ScrollToTopButton",7181:"ProductTiles",9097:"Footer",9513:"Toast",9704:"Newsletter"})[e]||e)+"."+({64:"225f7439e13cc375",84:"9822381f787e697d",218:"f55fb202ffd64866",299:"0f890f8a7e5b1846",549:"64f56e23e94f577b",866:"5cea0252ed1ff951",983:"c7179ebdb154d450",1153:"d7522522b6c917ed",1552:"a7758d4b2464351a",1724:"335d05fe570a1b28",1736:"5dc5ba359a7f5350",1770:"b0a7b096fe1d1bb2",1774:"85dc251aa39a517b",1781:"c6b00aa5b0667b40",1978:"6d1246731da0f1b0",2032:"83b631dbb251fcc6",2388:"908db499afc2082a",2552:"35321485d927aa08",2553:"2b7aae72c78d68ae",2858:"86e9f9fcf3d3e173",2985:"a189921eb7c7a1a8",3202:"d7d5a83625bed7aa",3506:"9341a11c5282b611",3523:"7b396bcd952800b9",3666:"107f6d709e2d3b2c",4551:"fd8f840c3f6ab36f",4600:"c6beeae8a8d0d6f3",5156:"fe20405ee7a0d2d5",5217:"350e250227ef3657",5380:"955177408ea25915",5484:"4fe23adb8755a0dd",5647:"530066e6a0aaaa4b",5890:"6284ec1895c33657",5906:"1e5aada1a1b104f5",5997:"8b2a914748263bb7",6636:"1fd39c18569afe69",7181:"88604243e3683d44",7195:"fb3e46b248b339d1",8501:"c65e0e689232daaf",8857:"0ff8f6604fb061a8",9024:"a746900e79690cf9",9097:"c0816f0c74d7e24b",9160:"f23fc2e8b2b6b813",9161:"799a1930dd41dc86",9513:"fabbe374f1d57665",9540:"d020c6959e15207a",9704:"7a07fe93f98e2922"})[e]+".js"},__webpack_require__.miniCssF=function(e){return"static/css/"+({218:"18e4be87b97035da",1550:"93d239c461485bdf",1736:"210f14f5aba4cccd",1781:"326d9de401ed8b48",1978:"197e314c5a03eabd",2103:"9718991cd57978e9",2197:"2980acad3f8e1028",2388:"dfa2b464e3c59cc4",2552:"8ebfe153c3ea130f",2858:"865e30903caadb79",2888:"ee0556daedda6306",3459:"2980acad3f8e1028",3472:"bf1560439df2c1a1",4501:"6e34c6c07086e3df",5405:"b1806cbafd0c1f81",6379:"e3ff5d95518a5c79",6552:"2980acad3f8e1028",6636:"936c65069d608087",7181:"170d55d9cf488572",8573:"2980acad3f8e1028",9097:"083dc2a5b0de2439",9161:"5273202f7c5e5ec1",9513:"6e9b83ba680dd4a6"})[e]+".css"},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},_={},a="_N_E:",__webpack_require__.l=function(e,r,t,c){if(_[e]){_[e].push(r);return}if(void 0!==t)for(var n,u,f=document.getElementsByTagName("script"),i=0;i<f.length;i++){var o=f[i];if(o.getAttribute("src")==e||o.getAttribute("data-webpack")==a+t){n=o;break}}n||(u=!0,(n=document.createElement("script")).charset="utf-8",n.timeout=120,__webpack_require__.nc&&n.setAttribute("nonce",__webpack_require__.nc),n.setAttribute("data-webpack",a+t),n.src=__webpack_require__.tu(e)),_[e]=[r];var onScriptComplete=function(r,t){n.onerror=n.onload=null,clearTimeout(d);var a=_[e];if(delete _[e],n.parentNode&&n.parentNode.removeChild(n),a&&a.forEach(function(e){return e(t)}),r)return r(t)},d=setTimeout(onScriptComplete.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=onScriptComplete.bind(null,n.onerror),n.onload=onScriptComplete.bind(null,n.onload),u&&document.head.appendChild(n)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.tt=function(){return void 0===c&&(c={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(c=trustedTypes.createPolicy("nextjs#bundler",c))),c},__webpack_require__.tu=function(e){return __webpack_require__.tt().createScriptURL(e)},__webpack_require__.p="/_next/",n=function(e,r,t,_){var a=document.createElement("link");return a.rel="stylesheet",a.type="text/css",a.onerror=a.onload=function(c){if(a.onerror=a.onload=null,"load"===c.type)t();else{var n=c&&("load"===c.type?"missing":c.type),u=c&&c.target&&c.target.href||r,f=Error("Loading CSS chunk "+e+" failed.\n("+u+")");f.code="CSS_CHUNK_LOAD_FAILED",f.type=n,f.request=u,a.parentNode.removeChild(a),_(f)}},a.href=r,document.head.appendChild(a),a},u=function(e,r){for(var t=document.getElementsByTagName("link"),_=0;_<t.length;_++){var a=t[_],c=a.getAttribute("data-href")||a.getAttribute("href");if("stylesheet"===a.rel&&(c===e||c===r))return a}for(var n=document.getElementsByTagName("style"),_=0;_<n.length;_++){var a=n[_],c=a.getAttribute("data-href");if(c===e||c===r)return a}},f={2272:0},__webpack_require__.f.miniCss=function(e,r){f[e]?r.push(f[e]):0!==f[e]&&({218:1,1736:1,1781:1,1978:1,2388:1,2552:1,2858:1,3472:1,6379:1,6636:1,7181:1,9097:1,9161:1,9513:1})[e]&&r.push(f[e]=new Promise(function(r,t){var _=__webpack_require__.miniCssF(e),a=__webpack_require__.p+_;if(u(_,a))return r();n(e,a,r,t)}).then(function(){f[e]=0},function(r){throw delete f[e],r}))},i={2272:0,3472:0},__webpack_require__.f.j=function(e,r){var t=__webpack_require__.o(i,e)?i[e]:void 0;if(0!==t){if(t)r.push(t[2]);else if(/^((22|34)72|218|9161)$/.test(e))i[e]=0;else{var _=new Promise(function(r,_){t=i[e]=[r,_]});r.push(t[2]=_);var a=__webpack_require__.p+__webpack_require__.u(e),c=Error();__webpack_require__.l(a,function(r){if(__webpack_require__.o(i,e)&&(0!==(t=i[e])&&(i[e]=void 0),t)){var _=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+_+": "+a+")",c.name="ChunkLoadError",c.type=_,c.request=a,t[1](c)}},"chunk-"+e,e)}}},__webpack_require__.O.j=function(e){return 0===i[e]},o=function(e,r){var t,_,a=r[0],c=r[1],n=r[2],u=0;if(a.some(function(e){return 0!==i[e]})){for(t in c)__webpack_require__.o(c,t)&&(__webpack_require__.m[t]=c[t]);if(n)var f=n(__webpack_require__)}for(e&&e(r);u<a.length;u++)_=a[u],__webpack_require__.o(i,_)&&i[_]&&i[_][0](),i[_]=0;return __webpack_require__.O(f)},(d=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(o.bind(null,0)),d.push=o.bind(null,d.push.bind(d))}();
|
|
File without changes
|
|
File without changes
|