@faststore/core 3.52.0 → 3.53.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.
Files changed (97) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +43 -43
  3. package/.next/cache/.tsbuildinfo +1 -1
  4. package/.next/cache/config.json +3 -3
  5. package/.next/cache/webpack/client-production/0.pack +0 -0
  6. package/.next/cache/webpack/client-production/index.pack +0 -0
  7. package/.next/cache/webpack/server-production/0.pack +0 -0
  8. package/.next/cache/webpack/server-production/index.pack +0 -0
  9. package/.next/prerender-manifest.js +1 -1
  10. package/.next/prerender-manifest.json +1 -1
  11. package/.next/react-loadable-manifest.json +1 -1
  12. package/.next/routes-manifest.json +1 -1
  13. package/.next/server/chunks/6011.js +2 -2
  14. package/.next/server/chunks/6886.js +1 -1
  15. package/.next/server/chunks/7178.js +1 -1
  16. package/.next/server/chunks/948.js +1 -1
  17. package/.next/server/chunks/9563.js +2 -2
  18. package/.next/server/functions-config-manifest.json +1 -1
  19. package/.next/server/middleware-build-manifest.js +1 -1
  20. package/.next/server/middleware-react-loadable-manifest.js +1 -1
  21. package/.next/server/pages/[...slug].js +1 -1
  22. package/.next/server/pages/[slug]/p.js +1 -1
  23. package/.next/server/pages/account/403.js +1 -1
  24. package/.next/server/pages/account/403.js.nft.json +1 -1
  25. package/.next/server/pages/account/404.js +1 -1
  26. package/.next/server/pages/account/404.js.nft.json +1 -1
  27. package/.next/server/pages/account/orders/[id].js +1 -1
  28. package/.next/server/pages/account/orders.js +1 -1
  29. package/.next/server/pages/account/profile.js +1 -1
  30. package/.next/server/pages/account/profile.js.nft.json +1 -1
  31. package/.next/server/pages/account/security.js +1 -1
  32. package/.next/server/pages/account/security.js.nft.json +1 -1
  33. package/.next/server/pages/account/user-details.js +1 -1
  34. package/.next/server/pages/account/user-details.js.nft.json +1 -1
  35. package/.next/server/pages/api/graphql.js +1 -1
  36. package/.next/server/pages/en-US/404.html +2 -2
  37. package/.next/server/pages/en-US/404.json +1 -1
  38. package/.next/server/pages/en-US/500.html +2 -2
  39. package/.next/server/pages/en-US/500.json +1 -1
  40. package/.next/server/pages/en-US/checkout.html +2 -2
  41. package/.next/server/pages/en-US/checkout.json +1 -1
  42. package/.next/server/pages/en-US/login.html +2 -2
  43. package/.next/server/pages/en-US/login.json +1 -1
  44. package/.next/server/pages/en-US/s.html +2 -2
  45. package/.next/server/pages/en-US/s.json +1 -1
  46. package/.next/server/pages/en-US.html +2 -2
  47. package/.next/server/pages/en-US.json +1 -1
  48. package/.next/server/pages-manifest.json +1 -1
  49. package/.next/static/{fmlJseOxpqR3A9KoHn42L → GZVLqXVuC34d47BGkDWsx}/_buildManifest.js +1 -1
  50. package/.next/static/GZVLqXVuC34d47BGkDWsx/_ssgManifest.js +1 -0
  51. package/.next/static/chunks/2284.abe693ea8fc2cb2d.js +1 -0
  52. package/.next/static/chunks/9173-f1dbeccc6eaecda7.js +1 -0
  53. package/.next/static/chunks/pages/account/403-6f4addf9a9d54a1c.js +1 -0
  54. package/.next/static/chunks/pages/account/404-9e8ca6ee5f981dae.js +1 -0
  55. package/.next/static/chunks/pages/account/orders/[id]-15f404dbf08bc5df.js +1 -0
  56. package/.next/static/chunks/pages/account/orders-e879939373942f27.js +1 -0
  57. package/.next/static/chunks/pages/account/profile-adfe3518bdab5463.js +1 -0
  58. package/.next/static/chunks/pages/account/security-ea5c8811b3e6e415.js +1 -0
  59. package/.next/static/chunks/pages/account/user-details-9309d14f4e59f398.js +1 -0
  60. package/.next/static/chunks/{webpack-100cd28c010132c0.js → webpack-215661b94a325396.js} +1 -1
  61. package/.next/trace +128 -129
  62. package/.turbo/turbo-build.log +15 -15
  63. package/.turbo/turbo-test.log +5 -5
  64. package/@generated/gql.ts +36 -4
  65. package/@generated/graphql.ts +62 -2
  66. package/@generated/persisted-documents.json +6 -2
  67. package/@generated/schema.graphql +2 -0
  68. package/CHANGELOG.md +12 -0
  69. package/package.json +3 -3
  70. package/src/components/account/MyAccountLayout/MyAccountLayout.tsx +5 -8
  71. package/src/components/account/MyAccountMenu/MyAccountMenu.tsx +1 -1
  72. package/src/components/search/SearchDropdown/SearchDropdown.tsx +6 -6
  73. package/src/components/search/SearchInput/SearchInput.tsx +0 -1
  74. package/src/components/search/SearchProductItem/SearchProductItem.tsx +7 -7
  75. package/src/experimental/myAccountSeverSideProps.ts +31 -5
  76. package/src/pages/account/403.tsx +43 -17
  77. package/src/pages/account/404.tsx +47 -18
  78. package/src/pages/account/orders/[id].tsx +4 -1
  79. package/src/pages/account/orders/index.tsx +4 -1
  80. package/src/pages/account/profile.tsx +44 -16
  81. package/src/pages/account/security.tsx +48 -16
  82. package/src/pages/account/user-details.tsx +56 -23
  83. package/test/server/index.test.ts +1 -0
  84. package/.next/server/pages/en-US/account/403.html +0 -28
  85. package/.next/server/pages/en-US/account/403.json +0 -1
  86. package/.next/server/pages/en-US/account/404.html +0 -28
  87. package/.next/server/pages/en-US/account/404.json +0 -1
  88. package/.next/static/chunks/2284.6539f77c530719e0.js +0 -1
  89. package/.next/static/chunks/9173-b67cd7510d59f099.js +0 -1
  90. package/.next/static/chunks/pages/account/403-5037929d6d9f6ae3.js +0 -1
  91. package/.next/static/chunks/pages/account/404-1deb28189263c93c.js +0 -1
  92. package/.next/static/chunks/pages/account/orders/[id]-82dc3dda9809ea0d.js +0 -1
  93. package/.next/static/chunks/pages/account/orders-d4751ce0296dd64c.js +0 -1
  94. package/.next/static/chunks/pages/account/profile-294f44b0ab99b7e3.js +0 -1
  95. package/.next/static/chunks/pages/account/security-d38403ae57b09a68.js +0 -1
  96. package/.next/static/chunks/pages/account/user-details-106d6064b64410d3.js +0 -1
  97. package/.next/static/fmlJseOxpqR3A9KoHn42L/_ssgManifest.js +0 -1
@@ -1,23 +1,23 @@
1
1
 
2
- > @faststore/core@3.51.0 prebuild /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.52.1 prebuild /home/runner/work/faststore/faststore/packages/core
3
3
  > na run partytown && na run generate
4
4
 
5
5
 
6
- > @faststore/core@3.51.0 partytown /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@3.52.1 partytown /home/runner/work/faststore/faststore/packages/core
7
7
  > partytown copylib ./public/~partytown
8
8
 
9
9
  Partytown lib copied to: /home/runner/work/faststore/faststore/packages/core/public/~partytown
10
10
 
11
- > @faststore/core@3.51.0 generate /home/runner/work/faststore/faststore/packages/core
11
+ > @faststore/core@3.52.1 generate /home/runner/work/faststore/faststore/packages/core
12
12
  > na run generate:schema && na run generate:codegen && na run format:generated
13
13
 
14
14
 
15
- > @faststore/core@3.51.0 generate:schema /home/runner/work/faststore/faststore/packages/core
15
+ > @faststore/core@3.52.1 generate:schema /home/runner/work/faststore/faststore/packages/core
16
16
  > tsx src/server/generator/generateGraphQLSchemaFile.ts
17
17
 
18
18
  Schema GraphQL file generated successfully
19
19
 
20
- > @faststore/core@3.51.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
20
+ > @faststore/core@3.52.1 generate:codegen /home/runner/work/faststore/faststore/packages/core
21
21
  > graphql-codegen
22
22
 
23
23
  [STARTED] Parse Configuration
@@ -37,11 +37,11 @@ Running lifecycle hook "afterStart" scripts...
37
37
  [CLI] Loading Documents
38
38
  [CLI] Generating output
39
39
 
40
- > @faststore/core@3.51.0 format:generated /home/runner/work/faststore/faststore/packages/core
40
+ > @faststore/core@3.52.1 format:generated /home/runner/work/faststore/faststore/packages/core
41
41
  > prettier --write "@generated/**/*.{ts,js,tsx,jsx,json}" --loglevel error
42
42
 
43
43
 
44
- > @faststore/core@3.51.0 build /home/runner/work/faststore/faststore/packages/core
44
+ > @faststore/core@3.52.1 build /home/runner/work/faststore/faststore/packages/core
45
45
  > next build
46
46
 
47
47
  ⚠ No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
@@ -57,12 +57,12 @@ https://nextjs.org/telemetry
57
57
  Using external babel configuration from /home/runner/work/faststore/faststore/packages/core/.babelrc.js
58
58
  ✓ Compiled successfully
59
59
  Collecting page data ...
60
- Generating static pages (0/8) ...
61
-
62
60
  Generating static pages (2/8)
61
+ Generating static pages (0/6) ...
62
+
63
63
  Generating static pages (1/6)
64
64
  Warning: Dynamic Content not found for the page: home. Refer to the Dynamic Content documentation at https://developers.vtex.com/docs/guides/faststore/dynamic-content-overview for mapping the page and the corresponding data-fetching function.
65
-
66
65
  Generating static pages (4/8)
67
-
68
66
  Generating static pages (6/8)
69
-
70
67
  ✓ Generating static pages (8/8)
68
+
71
69
  Generating static pages (2/6)
70
+
72
71
  Generating static pages (4/6)
72
+
73
73
  ✓ Generating static pages (6/6)
74
74
  Finalizing page optimization ...
75
75
  Collecting build traces ...
76
76
 
@@ -79,9 +79,9 @@ Route (pages) Size First Load JS
79
79
  ├ ● /500 1.48 kB 129 kB
80
80
  ├ λ /account 240 B 98.6 kB
81
81
  ├ ● /account/[...unknown] 281 B 98.7 kB
82
- /account/403 2.34 kB 130 kB
82
+ λ /account/403 2.33 kB 130 kB
83
83
  ├ └ css/b7bba8fce075688b.css 4.2 kB
84
- /account/404 2.03 kB 130 kB
84
+ λ /account/404 2.03 kB 130 kB
85
85
  ├ └ css/5347dbc8b71de47d.css 4.25 kB
86
86
  ├ λ /account/orders 8.71 kB 137 kB
87
87
  ├ └ css/24ae9ad548165362.css 11.8 kB
@@ -101,7 +101,7 @@ Route (pages) Size First Load JS
101
101
  ├ chunks/framework-807b0f81cbc129f0.js 45.4 kB
102
102
  ├ chunks/main-f658704b53a96ab1.js 33.1 kB
103
103
  ├ chunks/pages/_app-eb6edb0ba4b4be67.js 16.3 kB
104
- ├ chunks/webpack-100cd28c010132c0.js 3.7 kB
104
+ ├ chunks/webpack-215661b94a325396.js 3.7 kB
105
105
  └ css/0a57ee6c7a57788c.css 3.49 kB
106
106
 
107
107
  λ (Server) server-side renders at runtime (uses getInitialProps or getServerSideProps)
@@ -1,14 +1,14 @@
1
1
 
2
- > @faststore/core@3.51.0 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.52.1 test /home/runner/work/faststore/faststore/packages/core
3
3
  > jest
4
4
 
5
- PASS test/utils/multipleTemplates.test.ts (24.849 s)
6
- PASS test/server/cms/global.test.ts (24.835 s)
5
+ PASS test/utils/multipleTemplates.test.ts (25.349 s)
6
+ PASS test/server/cms/global.test.ts (25.351 s)
7
7
  PASS test/server/cms/index.test.ts
8
- PASS test/server/index.test.ts (30.191 s)
8
+ PASS test/server/index.test.ts (30.454 s)
9
9
 
10
10
  Test Suites: 4 passed, 4 total
11
11
  Tests: 22 passed, 22 total
12
12
  Snapshots: 0 total
13
- Time: 31.459 s
13
+ Time: 31.624 s
14
14
  Ran all test suites.
package/@generated/gql.ts CHANGED
@@ -36,16 +36,24 @@ const documents = {
36
36
  types.ServerCollectionPageFragmentDoc,
37
37
  '\n fragment ServerProduct on Query {\n product(locator: $locator) {\n id: productID\n }\n }\n':
38
38
  types.ServerProductFragmentDoc,
39
+ '\n query ServerAccountPageQuery {\n accountName\n }\n':
40
+ types.ServerAccountPageQueryDocument,
39
41
  '\n query ServerCollectionPageQuery($slug: String!) {\n ...ServerCollectionPage\n collection(slug: $slug) {\n seo {\n title\n description\n }\n breadcrumbList {\n itemListElement {\n item\n name\n position\n }\n }\n meta {\n selectedFacets {\n key\n value\n }\n }\n }\n }\n':
40
42
  types.ServerCollectionPageQueryDocument,
41
43
  '\n query ServerProductQuery($locator: [IStoreSelectedFacet!]!) {\n ...ServerProduct\n product(locator: $locator) {\n id: productID\n\n seo {\n title\n description\n canonical\n }\n\n brand {\n name\n }\n\n sku\n gtin\n name\n description\n releaseDate\n\n breadcrumbList {\n itemListElement {\n item\n name\n position\n }\n }\n\n image {\n url\n alternateName\n }\n\n offers {\n lowPrice\n highPrice\n lowPriceWithTaxes\n priceCurrency\n offers {\n availability\n price\n priceValidUntil\n priceCurrency\n itemCondition\n seller {\n identifier\n }\n }\n }\n\n isVariantOf {\n productGroupID\n }\n\n ...ProductDetailsFragment_product\n }\n }\n':
42
44
  types.ServerProductQueryDocument,
43
45
  '\n fragment UserOrderItemsFragment on UserOrderItems {\n id\n name\n quantity\n sellingPrice\n unitMultiplier\n measurementUnit\n imageUrl\n detailUrl\n refId\n rewardValue\n }\n':
44
46
  types.UserOrderItemsFragmentFragmentDoc,
45
- '\n query ServerOrderDetailsQuery($orderId: String!) {\n userOrder(orderId: $orderId) {\n orderId\n status\n statusDescription\n allowCancellation\n storePreferencesData {\n currencyCode\n }\n clientProfileData {\n firstName\n lastName\n email\n phone\n corporateName\n isCorporate\n }\n customFields {\n type\n id\n fields {\n name\n value\n refId\n }\n }\n deliveryOptionsData {\n deliveryOptions {\n selectedSla\n deliveryChannel\n deliveryCompany\n deliveryWindow {\n startDateUtc\n endDateUtc\n price\n }\n shippingEstimate\n shippingEstimateDate\n friendlyShippingEstimate\n friendlyDeliveryOptionName\n seller\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n pickupStoreInfo {\n additionalInfo\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n dockId\n friendlyName\n isPickupStore\n }\n quantityOfDifferentItems\n total\n items {\n id\n name\n quantity\n price\n imageUrl\n tax\n total\n }\n }\n contact {\n email\n phone\n name\n }\n }\n paymentData {\n transactions {\n isActive\n payments {\n id\n paymentSystemName\n value\n installments\n referenceValue\n lastDigits\n url\n group\n tid\n connectorResponses {\n authId\n }\n bankIssuedInvoiceIdentificationNumber\n redemptionCode\n paymentOrigin\n }\n }\n }\n totals {\n id\n name\n value\n }\n }\n }\n':
47
+ '\n query ServerOrderDetailsQuery($orderId: String!) {\n userOrder(orderId: $orderId) {\n orderId\n status\n statusDescription\n allowCancellation\n storePreferencesData {\n currencyCode\n }\n clientProfileData {\n firstName\n lastName\n email\n phone\n corporateName\n isCorporate\n }\n customFields {\n type\n id\n fields {\n name\n value\n refId\n }\n }\n deliveryOptionsData {\n deliveryOptions {\n selectedSla\n deliveryChannel\n deliveryCompany\n deliveryWindow {\n startDateUtc\n endDateUtc\n price\n }\n shippingEstimate\n shippingEstimateDate\n friendlyShippingEstimate\n friendlyDeliveryOptionName\n seller\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n pickupStoreInfo {\n additionalInfo\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n dockId\n friendlyName\n isPickupStore\n }\n quantityOfDifferentItems\n total\n items {\n id\n name\n quantity\n price\n imageUrl\n tax\n total\n }\n }\n contact {\n email\n phone\n name\n }\n }\n paymentData {\n transactions {\n isActive\n payments {\n id\n paymentSystemName\n value\n installments\n referenceValue\n lastDigits\n url\n group\n tid\n connectorResponses {\n authId\n }\n bankIssuedInvoiceIdentificationNumber\n redemptionCode\n paymentOrigin\n }\n }\n }\n totals {\n id\n name\n value\n }\n }\n accountName\n }\n':
46
48
  types.ServerOrderDetailsQueryDocument,
47
- '\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n customFields {\n type\n value\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n }\n':
49
+ '\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n customFields {\n type\n value\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n accountName\n }\n':
48
50
  types.ServerListOrdersQueryDocument,
51
+ '\n query ServerProfileQuery {\n accountName\n }\n':
52
+ types.ServerProfileQueryDocument,
53
+ '\n query ServerSecurityQuery {\n accountName\n }\n':
54
+ types.ServerSecurityQueryDocument,
55
+ '\n query ServerUserDetailsQuery {\n accountName\n }\n':
56
+ types.ServerUserDetailsQueryDocument,
49
57
  '\n mutation CancelOrderMutation($data: IUserOrderCancel!) {\n cancelOrder(data: $data) {\n data\n }\n }\n':
50
58
  types.CancelOrderMutationDocument,
51
59
  '\n mutation ValidateCartMutation($cart: IStoreCart!, $session: IStoreSession!) {\n validateCart(cart: $cart, session: $session) {\n order {\n orderNumber\n acceptedOffer {\n ...CartItem\n }\n shouldSplitItem\n }\n messages {\n ...CartMessage\n }\n }\n }\n\n fragment CartMessage on StoreCartMessage {\n text\n status\n }\n\n fragment CartItem on StoreOffer {\n seller {\n identifier\n }\n quantity\n price\n priceWithTaxes\n listPrice\n listPriceWithTaxes\n itemOffered {\n ...CartProductItem\n }\n }\n\n fragment CartProductItem on StoreProduct {\n sku\n name\n unitMultiplier\n image {\n url\n alternateName\n }\n brand {\n name\n }\n isVariantOf {\n productGroupID\n name\n skuVariants {\n activeVariations\n slugsMap\n availableVariations\n }\n }\n gtin\n additionalProperty {\n propertyID\n name\n value\n valueReference\n }\n }\n':
@@ -148,6 +156,12 @@ export function gql(
148
156
  export function gql(
149
157
  source: '\n fragment ServerProduct on Query {\n product(locator: $locator) {\n id: productID\n }\n }\n'
150
158
  ): typeof import('./graphql').ServerProductFragmentDoc
159
+ /**
160
+ * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
161
+ */
162
+ export function gql(
163
+ source: '\n query ServerAccountPageQuery {\n accountName\n }\n'
164
+ ): typeof import('./graphql').ServerAccountPageQueryDocument
151
165
  /**
152
166
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
153
167
  */
@@ -170,14 +184,32 @@ export function gql(
170
184
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
171
185
  */
172
186
  export function gql(
173
- source: '\n query ServerOrderDetailsQuery($orderId: String!) {\n userOrder(orderId: $orderId) {\n orderId\n status\n statusDescription\n allowCancellation\n storePreferencesData {\n currencyCode\n }\n clientProfileData {\n firstName\n lastName\n email\n phone\n corporateName\n isCorporate\n }\n customFields {\n type\n id\n fields {\n name\n value\n refId\n }\n }\n deliveryOptionsData {\n deliveryOptions {\n selectedSla\n deliveryChannel\n deliveryCompany\n deliveryWindow {\n startDateUtc\n endDateUtc\n price\n }\n shippingEstimate\n shippingEstimateDate\n friendlyShippingEstimate\n friendlyDeliveryOptionName\n seller\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n pickupStoreInfo {\n additionalInfo\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n dockId\n friendlyName\n isPickupStore\n }\n quantityOfDifferentItems\n total\n items {\n id\n name\n quantity\n price\n imageUrl\n tax\n total\n }\n }\n contact {\n email\n phone\n name\n }\n }\n paymentData {\n transactions {\n isActive\n payments {\n id\n paymentSystemName\n value\n installments\n referenceValue\n lastDigits\n url\n group\n tid\n connectorResponses {\n authId\n }\n bankIssuedInvoiceIdentificationNumber\n redemptionCode\n paymentOrigin\n }\n }\n }\n totals {\n id\n name\n value\n }\n }\n }\n'
187
+ source: '\n query ServerOrderDetailsQuery($orderId: String!) {\n userOrder(orderId: $orderId) {\n orderId\n status\n statusDescription\n allowCancellation\n storePreferencesData {\n currencyCode\n }\n clientProfileData {\n firstName\n lastName\n email\n phone\n corporateName\n isCorporate\n }\n customFields {\n type\n id\n fields {\n name\n value\n refId\n }\n }\n deliveryOptionsData {\n deliveryOptions {\n selectedSla\n deliveryChannel\n deliveryCompany\n deliveryWindow {\n startDateUtc\n endDateUtc\n price\n }\n shippingEstimate\n shippingEstimateDate\n friendlyShippingEstimate\n friendlyDeliveryOptionName\n seller\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n pickupStoreInfo {\n additionalInfo\n address {\n addressType\n receiverName\n addressId\n versionId\n entityId\n postalCode\n city\n state\n country\n street\n number\n neighborhood\n complement\n reference\n geoCoordinates\n }\n dockId\n friendlyName\n isPickupStore\n }\n quantityOfDifferentItems\n total\n items {\n id\n name\n quantity\n price\n imageUrl\n tax\n total\n }\n }\n contact {\n email\n phone\n name\n }\n }\n paymentData {\n transactions {\n isActive\n payments {\n id\n paymentSystemName\n value\n installments\n referenceValue\n lastDigits\n url\n group\n tid\n connectorResponses {\n authId\n }\n bankIssuedInvoiceIdentificationNumber\n redemptionCode\n paymentOrigin\n }\n }\n }\n totals {\n id\n name\n value\n }\n }\n accountName\n }\n'
174
188
  ): typeof import('./graphql').ServerOrderDetailsQueryDocument
175
189
  /**
176
190
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
177
191
  */
178
192
  export function gql(
179
- source: '\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n customFields {\n type\n value\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n }\n'
193
+ source: '\n query ServerListOrdersQuery ($page: Int,$perPage: Int, $status: [String], $dateInitial: String, $dateFinal: String, $text: String, $clientEmail: String) {\n listUserOrders (page: $page, perPage: $perPage, status: $status, dateInitial: $dateInitial, dateFinal: $dateFinal, text: $text, clientEmail: $clientEmail) {\n list {\n orderId\n creationDate\n clientName\n items {\n seller\n quantity\n description\n ean\n refId\n id\n productId\n sellingPrice\n price\n }\n totalValue\n status\n statusDescription\n ShippingEstimatedDate\n currencyCode\n customFields {\n type\n value\n }\n }\n paging {\n total\n pages\n currentPage\n perPage\n }\n }\n accountName\n }\n'
180
194
  ): typeof import('./graphql').ServerListOrdersQueryDocument
195
+ /**
196
+ * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
197
+ */
198
+ export function gql(
199
+ source: '\n query ServerProfileQuery {\n accountName\n }\n'
200
+ ): typeof import('./graphql').ServerProfileQueryDocument
201
+ /**
202
+ * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
203
+ */
204
+ export function gql(
205
+ source: '\n query ServerSecurityQuery {\n accountName\n }\n'
206
+ ): typeof import('./graphql').ServerSecurityQueryDocument
207
+ /**
208
+ * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
209
+ */
210
+ export function gql(
211
+ source: '\n query ServerUserDetailsQuery {\n accountName\n }\n'
212
+ ): typeof import('./graphql').ServerUserDetailsQueryDocument
181
213
  /**
182
214
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
183
215
  */
@@ -535,6 +535,8 @@ export type ProfileAddress = {
535
535
  }
536
536
 
537
537
  export type Query = {
538
+ /** Returns the account name of the current user or the B2B contract name if applicable. */
539
+ accountName: Maybe<Scalars['String']['output']>
538
540
  /** Returns information about all collections. */
539
541
  allCollections: StoreCollectionConnection
540
542
  /** Returns information about all products. */
@@ -2167,6 +2169,12 @@ export type ServerCollectionPageFragment = { collection: { id: string } }
2167
2169
 
2168
2170
  export type ServerProductFragment = { product: { id: string } }
2169
2171
 
2172
+ export type ServerAccountPageQueryQueryVariables = Exact<{
2173
+ [key: string]: never
2174
+ }>
2175
+
2176
+ export type ServerAccountPageQueryQuery = { accountName: string | null }
2177
+
2170
2178
  export type ServerCollectionPageQueryQueryVariables = Exact<{
2171
2179
  slug: Scalars['String']['input']
2172
2180
  }>
@@ -2254,6 +2262,7 @@ export type ServerOrderDetailsQueryQueryVariables = Exact<{
2254
2262
  }>
2255
2263
 
2256
2264
  export type ServerOrderDetailsQueryQuery = {
2265
+ accountName: string | null
2257
2266
  userOrder: {
2258
2267
  orderId: string | null
2259
2268
  status: string | null
@@ -2392,6 +2401,7 @@ export type ServerListOrdersQueryQueryVariables = Exact<{
2392
2401
  }>
2393
2402
 
2394
2403
  export type ServerListOrdersQueryQuery = {
2404
+ accountName: string | null
2395
2405
  listUserOrders: {
2396
2406
  list: Array<{
2397
2407
  orderId: string | null
@@ -2427,6 +2437,20 @@ export type ServerListOrdersQueryQuery = {
2427
2437
  } | null
2428
2438
  }
2429
2439
 
2440
+ export type ServerProfileQueryQueryVariables = Exact<{ [key: string]: never }>
2441
+
2442
+ export type ServerProfileQueryQuery = { accountName: string | null }
2443
+
2444
+ export type ServerSecurityQueryQueryVariables = Exact<{ [key: string]: never }>
2445
+
2446
+ export type ServerSecurityQueryQuery = { accountName: string | null }
2447
+
2448
+ export type ServerUserDetailsQueryQueryVariables = Exact<{
2449
+ [key: string]: never
2450
+ }>
2451
+
2452
+ export type ServerUserDetailsQueryQuery = { accountName: string | null }
2453
+
2430
2454
  export type CancelOrderMutationMutationVariables = Exact<{
2431
2455
  data: IUserOrderCancel
2432
2456
  }>
@@ -3441,6 +3465,15 @@ export const SearchEvent_MetadataFragmentDoc = new TypedDocumentString(
3441
3465
  `,
3442
3466
  { fragmentName: 'SearchEvent_metadata' }
3443
3467
  ) as unknown as TypedDocumentString<SearchEvent_MetadataFragment, unknown>
3468
+ export const ServerAccountPageQueryDocument = {
3469
+ __meta__: {
3470
+ operationName: 'ServerAccountPageQuery',
3471
+ operationHash: '47315a3cd26ddd9c7fa963778988464341b8193f',
3472
+ },
3473
+ } as unknown as TypedDocumentString<
3474
+ ServerAccountPageQueryQuery,
3475
+ ServerAccountPageQueryQueryVariables
3476
+ >
3444
3477
  export const ServerCollectionPageQueryDocument = {
3445
3478
  __meta__: {
3446
3479
  operationName: 'ServerCollectionPageQuery',
@@ -3462,7 +3495,7 @@ export const ServerProductQueryDocument = {
3462
3495
  export const ServerOrderDetailsQueryDocument = {
3463
3496
  __meta__: {
3464
3497
  operationName: 'ServerOrderDetailsQuery',
3465
- operationHash: '8b9b9c7703b0b9af12f47cb86dd3d2e8eb40c8fd',
3498
+ operationHash: 'c957b142e7f211126246f91a42db6d76c519da77',
3466
3499
  },
3467
3500
  } as unknown as TypedDocumentString<
3468
3501
  ServerOrderDetailsQueryQuery,
@@ -3471,12 +3504,39 @@ export const ServerOrderDetailsQueryDocument = {
3471
3504
  export const ServerListOrdersQueryDocument = {
3472
3505
  __meta__: {
3473
3506
  operationName: 'ServerListOrdersQuery',
3474
- operationHash: '867fff060c5b7726220ed8a10a115b1484762fcf',
3507
+ operationHash: 'ee84ac3f5b58c5e1950a927a42c5c1dd6012fcc4',
3475
3508
  },
3476
3509
  } as unknown as TypedDocumentString<
3477
3510
  ServerListOrdersQueryQuery,
3478
3511
  ServerListOrdersQueryQueryVariables
3479
3512
  >
3513
+ export const ServerProfileQueryDocument = {
3514
+ __meta__: {
3515
+ operationName: 'ServerProfileQuery',
3516
+ operationHash: 'c4191223fe0b642eee3aaaa2c56563da7d163265',
3517
+ },
3518
+ } as unknown as TypedDocumentString<
3519
+ ServerProfileQueryQuery,
3520
+ ServerProfileQueryQueryVariables
3521
+ >
3522
+ export const ServerSecurityQueryDocument = {
3523
+ __meta__: {
3524
+ operationName: 'ServerSecurityQuery',
3525
+ operationHash: '9f24767f16e6e05c168336701a6c6c7b6b5dc1c6',
3526
+ },
3527
+ } as unknown as TypedDocumentString<
3528
+ ServerSecurityQueryQuery,
3529
+ ServerSecurityQueryQueryVariables
3530
+ >
3531
+ export const ServerUserDetailsQueryDocument = {
3532
+ __meta__: {
3533
+ operationName: 'ServerUserDetailsQuery',
3534
+ operationHash: '92d9db34aa133d60d474c6d4cdcdd2fc19041a5e',
3535
+ },
3536
+ } as unknown as TypedDocumentString<
3537
+ ServerUserDetailsQueryQuery,
3538
+ ServerUserDetailsQueryQueryVariables
3539
+ >
3480
3540
  export const CancelOrderMutationDocument = {
3481
3541
  __meta__: {
3482
3542
  operationName: 'CancelOrderMutation',
@@ -1,8 +1,12 @@
1
1
  {
2
+ "47315a3cd26ddd9c7fa963778988464341b8193f": "query ServerAccountPageQuery { accountName }",
2
3
  "4b33c5c07f440dc7489e55619dc2211a13786e72": "fragment ServerCollectionPage on Query { collection(slug: $slug) { id } } query ServerCollectionPageQuery($slug: String!) { collection(slug: $slug) { breadcrumbList { itemListElement { item name position } } meta { selectedFacets { key value } } seo { description title } } ...ServerCollectionPage }",
3
4
  "46103bee661405bde706d72126fdbf9b0a0c9e6e": "fragment CartProductItem on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name sku unitMultiplier } fragment ProductDetailsFragment_product on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } description gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name offers { lowPrice lowPriceWithTaxes offers { availability listPrice listPriceWithTaxes price priceWithTaxes seller { identifier } } } id: productID sku unitMultiplier ...CartProductItem } fragment ServerProduct on Query { product(locator: $locator) { id: productID } } query ServerProductQuery($locator: [IStoreSelectedFacet!]!) { product(locator: $locator) { brand { name } breadcrumbList { itemListElement { item name position } } description gtin image { alternateName url } isVariantOf { productGroupID } name offers { highPrice lowPrice lowPriceWithTaxes offers { availability itemCondition price priceCurrency priceValidUntil seller { identifier } } priceCurrency } id: productID releaseDate seo { canonical description title } sku ...ProductDetailsFragment_product } ...ServerProduct }",
4
- "8b9b9c7703b0b9af12f47cb86dd3d2e8eb40c8fd": "query ServerOrderDetailsQuery($orderId: String!) { userOrder(orderId: $orderId) { allowCancellation clientProfileData { corporateName email firstName isCorporate lastName phone } customFields { fields { name refId value } id type } deliveryOptionsData { contact { email name phone } deliveryOptions { address { addressId addressType city complement country entityId geoCoordinates neighborhood number postalCode receiverName reference state street versionId } deliveryChannel deliveryCompany deliveryWindow { endDateUtc price startDateUtc } friendlyDeliveryOptionName friendlyShippingEstimate items { id imageUrl name price quantity tax total } pickupStoreInfo { additionalInfo address { addressId addressType city complement country entityId geoCoordinates neighborhood number postalCode receiverName reference state street versionId } dockId friendlyName isPickupStore } quantityOfDifferentItems selectedSla seller shippingEstimate shippingEstimateDate total } } orderId paymentData { transactions { isActive payments { bankIssuedInvoiceIdentificationNumber connectorResponses { authId } group id installments lastDigits paymentOrigin paymentSystemName redemptionCode referenceValue tid url value } } } status statusDescription storePreferencesData { currencyCode } totals { id name value } } }",
5
- "867fff060c5b7726220ed8a10a115b1484762fcf": "query ServerListOrdersQuery($clientEmail: String, $dateFinal: String, $dateInitial: String, $page: Int, $perPage: Int, $status: [String], $text: String) { listUserOrders( page: $page perPage: $perPage status: $status dateInitial: $dateInitial dateFinal: $dateFinal text: $text clientEmail: $clientEmail ) { list { ShippingEstimatedDate clientName creationDate currencyCode customFields { type value } items { description ean id price productId quantity refId seller sellingPrice } orderId status statusDescription totalValue } paging { currentPage pages perPage total } } }",
5
+ "c957b142e7f211126246f91a42db6d76c519da77": "query ServerOrderDetailsQuery($orderId: String!) { accountName userOrder(orderId: $orderId) { allowCancellation clientProfileData { corporateName email firstName isCorporate lastName phone } customFields { fields { name refId value } id type } deliveryOptionsData { contact { email name phone } deliveryOptions { address { addressId addressType city complement country entityId geoCoordinates neighborhood number postalCode receiverName reference state street versionId } deliveryChannel deliveryCompany deliveryWindow { endDateUtc price startDateUtc } friendlyDeliveryOptionName friendlyShippingEstimate items { id imageUrl name price quantity tax total } pickupStoreInfo { additionalInfo address { addressId addressType city complement country entityId geoCoordinates neighborhood number postalCode receiverName reference state street versionId } dockId friendlyName isPickupStore } quantityOfDifferentItems selectedSla seller shippingEstimate shippingEstimateDate total } } orderId paymentData { transactions { isActive payments { bankIssuedInvoiceIdentificationNumber connectorResponses { authId } group id installments lastDigits paymentOrigin paymentSystemName redemptionCode referenceValue tid url value } } } status statusDescription storePreferencesData { currencyCode } totals { id name value } } }",
6
+ "ee84ac3f5b58c5e1950a927a42c5c1dd6012fcc4": "query ServerListOrdersQuery($clientEmail: String, $dateFinal: String, $dateInitial: String, $page: Int, $perPage: Int, $status: [String], $text: String) { accountName listUserOrders( page: $page perPage: $perPage status: $status dateInitial: $dateInitial dateFinal: $dateFinal text: $text clientEmail: $clientEmail ) { list { ShippingEstimatedDate clientName creationDate currencyCode customFields { type value } items { description ean id price productId quantity refId seller sellingPrice } orderId status statusDescription totalValue } paging { currentPage pages perPage total } } }",
7
+ "c4191223fe0b642eee3aaaa2c56563da7d163265": "query ServerProfileQuery { accountName }",
8
+ "9f24767f16e6e05c168336701a6c6c7b6b5dc1c6": "query ServerSecurityQuery { accountName }",
9
+ "92d9db34aa133d60d474c6d4cdcdd2fc19041a5e": "query ServerUserDetailsQuery { accountName }",
6
10
  "e2b06da6840614d3c72768e56579b9d3b8e80802": "mutation CancelOrderMutation($data: IUserOrderCancel!) { cancelOrder(data: $data) { data } }",
7
11
  "c2b3f8bff73ebf6ac79d758c66cabbc21ba9fcc0": "fragment CartItem on StoreOffer { itemOffered { ...CartProductItem } listPrice listPriceWithTaxes price priceWithTaxes quantity seller { identifier } } fragment CartMessage on StoreCartMessage { status text } fragment CartProductItem on StoreProduct { additionalProperty { name propertyID value valueReference } brand { name } gtin image { alternateName url } isVariantOf { name productGroupID skuVariants { activeVariations availableVariations slugsMap } } name sku unitMultiplier } mutation ValidateCartMutation($cart: IStoreCart!, $session: IStoreSession!) { validateCart(cart: $cart, session: $session) { messages { ...CartMessage } order { acceptedOffer { ...CartItem } orderNumber shouldSplitItem } } }",
8
12
  "feb7005103a859e2bc8cf2360d568806fd88deba": "mutation SubscribeToNewsletter($data: IPersonNewsletter!) { subscribeToNewsletter(data: $data) { id } }",
@@ -708,6 +708,8 @@ type Query {
708
708
  """Client email used to filter of the list of orders."""
709
709
  clientEmail: String
710
710
  ): UserOrderListMinimalResult @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)
711
+ """Returns the account name of the current user or the B2B contract name if applicable."""
712
+ accountName: String @cacheControl(scope: "public", sMaxAge: 120, staleWhileRevalidate: 3600)
711
713
  }
712
714
 
713
715
  """
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.53.0](https://github.com/vtex/faststore/compare/v3.52.1...v3.53.0) (2025-06-16)
7
+
8
+ ### Features
9
+
10
+ - sfs 2523 contract name main menu ([#2895](https://github.com/vtex/faststore/issues/2895)) ([60adc92](https://github.com/vtex/faststore/commit/60adc92721a4a9eef6db66d1f7c3b563474b554d))
11
+
12
+ ## [3.52.1](https://github.com/vtex/faststore/compare/v3.52.0...v3.52.1) (2025-06-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - Search events params to track conversion ([#2891](https://github.com/vtex/faststore/issues/2891)) ([17510c9](https://github.com/vtex/faststore/commit/17510c942a2b1cbdeeb2cd6a7e39dba43fe73345))
17
+
6
18
  # [3.52.0](https://github.com/vtex/faststore/compare/v3.51.0...v3.52.0) (2025-06-12)
7
19
 
8
20
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.52.0",
3
+ "version": "3.53.0",
4
4
  "license": "MIT",
5
5
  "repository": "vtex/faststore",
6
6
  "browserslist": "supports es6-module and not dead",
@@ -44,7 +44,7 @@
44
44
  "@envelop/graphql-jit": "^8.0.3",
45
45
  "@envelop/parser-cache": "^6.0.2",
46
46
  "@envelop/validation-cache": "^6.0.2",
47
- "@faststore/api": "^3.51.0",
47
+ "@faststore/api": "^3.53.0",
48
48
  "@faststore/graphql-utils": "^3.50.3",
49
49
  "@faststore/lighthouse": "^3.50.3",
50
50
  "@faststore/sdk": "^3.50.3",
@@ -105,5 +105,5 @@
105
105
  "ts-jest": "29.1.1",
106
106
  "typescript": "5.3.2"
107
107
  },
108
- "gitHead": "6fbffee96c173be4735f35e9cfa5a2ec337e4a83"
108
+ "gitHead": "395c032869b191dc99a073c729fd23d151da9fe9"
109
109
  }
@@ -3,20 +3,17 @@ import menuRoutes from 'src/customizations/src/myAccount/navigation'
3
3
  import MyAccountMenu from '../MyAccountMenu'
4
4
  import styles from '../section.module.scss'
5
5
 
6
- export type MyAccountLayoutProps = {}
7
-
8
- /* ######################################### */
9
- /* Mocked Data until development is finished */
10
- const mockedUserName = 'Mocked Username'
11
-
12
- /* ######################################### */
6
+ export type MyAccountLayoutProps = {
7
+ accountName: string
8
+ }
13
9
 
14
10
  const MyAccountLayout = ({
15
11
  children,
12
+ accountName,
16
13
  }: PropsWithChildren<MyAccountLayoutProps>) => {
17
14
  return (
18
15
  <div className={styles.layout}>
19
- <MyAccountMenu accountName={mockedUserName} items={menuRoutes} />
16
+ <MyAccountMenu accountName={accountName} items={menuRoutes} />
20
17
  <section>{children}</section>
21
18
  </div>
22
19
  )
@@ -53,7 +53,7 @@ const MyAccountMenu = ({
53
53
  {avatarImageUrl ? (
54
54
  <img className={styles.avatar} src={avatarImageUrl} />
55
55
  ) : (
56
- <span className={styles.avatar}>{accountName[0]}</span>
56
+ <span className={styles.avatar}>{accountName?.[0]}</span>
57
57
  )}
58
58
  <h2>{accountName}</h2>
59
59
  </div>
@@ -1,4 +1,3 @@
1
- import type { Dispatch, SetStateAction } from 'react'
2
1
  import {
3
2
  SearchProducts,
4
3
  SearchAutoComplete as UISearchAutoComplete,
@@ -6,6 +5,7 @@ import {
6
5
  SearchDropdown as UISearchDropdown,
7
6
  useSearch,
8
7
  } from '@faststore/ui'
8
+ import type { Dispatch, SetStateAction } from 'react'
9
9
 
10
10
  import { SearchHistory } from '../SearchHistory'
11
11
  import { SearchTop } from '../SearchTop'
@@ -13,12 +13,12 @@ import { SearchTop } from '../SearchTop'
13
13
  import type { SearchState } from '@faststore/sdk'
14
14
  import type { ProductSummary_ProductFragment } from '@generated/graphql'
15
15
  import SearchProductItem from 'src/components/search/SearchProductItem'
16
- import { formatSearchPath } from 'src/sdk/search/formatSearchPath'
16
+ import type { NavbarProps } from 'src/components/sections/Navbar'
17
17
  import type {
18
18
  IntelligentSearchAutocompleteClickEvent,
19
19
  IntelligentSearchAutocompleteClickParams,
20
20
  } from 'src/sdk/analytics/types'
21
- import type { NavbarProps } from 'src/components/sections/Navbar'
21
+ import { formatSearchPath } from 'src/sdk/search/formatSearchPath'
22
22
 
23
23
  interface SearchDropdownProps {
24
24
  sort: SearchState['sort']
@@ -68,11 +68,11 @@ function SearchDropdown({
68
68
  }),
69
69
  onClick: () => {
70
70
  onSearchSelection?.(
71
- suggestion,
72
- formatSearchPath({ term: suggestion, sort })
71
+ term,
72
+ formatSearchPath({ term: term, sort })
73
73
  )
74
74
  sendAutocompleteClickEvent({
75
- term: suggestion,
75
+ term: term,
76
76
  url: window.location.href,
77
77
  })
78
78
  },
@@ -106,7 +106,6 @@ const SearchInput = forwardRef<SearchInputRef, SearchInputProps>(
106
106
  addToSearchHistory({ term, path })
107
107
  sendAnalytics(term)
108
108
  setSearchDropdownVisible(false)
109
- setSearchQuery(term)
110
109
  }
111
110
 
112
111
  useOnClickOutside(searchRef, () =>
@@ -1,4 +1,3 @@
1
- import { type Dispatch, type SetStateAction, useMemo, useState } from 'react'
2
1
  import {
3
2
  Icon,
4
3
  SearchProductItem as UISearchProductItem,
@@ -9,15 +8,16 @@ import {
9
8
  useSearch,
10
9
  useUI,
11
10
  } from '@faststore/ui'
11
+ import { type Dispatch, type SetStateAction, useMemo, useState } from 'react'
12
12
 
13
+ import type { ProductSummary_ProductFragment } from '@generated/graphql'
14
+ import type { NavbarProps } from 'src/components/sections/Navbar'
13
15
  import { Image } from 'src/components/ui/Image'
16
+ import { useBuyButton } from 'src/sdk/cart/useBuyButton'
17
+ import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
14
18
  import { useFormattedPrice } from 'src/sdk/product/useFormattedPrice'
15
19
  import { useProductLink } from 'src/sdk/product/useProductLink'
16
20
  import { sendAutocompleteClickEvent } from '../SearchDropdown'
17
- import type { ProductSummary_ProductFragment } from '@generated/graphql'
18
- import { useBuyButton } from 'src/sdk/cart/useBuyButton'
19
- import type { NavbarProps } from 'src/components/sections/Navbar'
20
- import { useOverrideComponents } from 'src/sdk/overrides/OverrideContext'
21
21
 
22
22
  import styles from 'src/components/sections/Navbar/section.module.scss'
23
23
 
@@ -48,7 +48,7 @@ function SearchProductItem({
48
48
  ...otherProps
49
49
  }: SearchProductItemProps) {
50
50
  const {
51
- values: { onSearchSelection },
51
+ values: { term, onSearchSelection },
52
52
  } = useSearch()
53
53
  const { pushToast } = useUI()
54
54
 
@@ -96,7 +96,7 @@ function SearchProductItem({
96
96
  onSearchSelection?.(name, href)
97
97
  sendAutocompleteClickEvent({
98
98
  url: href,
99
- term: name,
99
+ term: term,
100
100
  position: index,
101
101
  productId: product.isVariantOf.productGroupID ?? product.sku,
102
102
  })
@@ -1,3 +1,8 @@
1
+ import { gql } from '@generated/gql'
2
+ import type {
3
+ ServerAccountPageQueryQuery,
4
+ ServerAccountPageQueryQueryVariables,
5
+ } from '@generated/graphql'
1
6
  import type { Locator } from '@vtex/client-cms'
2
7
  import type { GetServerSideProps } from 'next'
3
8
 
@@ -5,23 +10,31 @@ import {
5
10
  type GlobalSectionsData,
6
11
  getGlobalSectionsData,
7
12
  } from 'src/components/cms/GlobalSections'
13
+ import { execute } from 'src/server'
8
14
 
9
15
  import { injectGlobalSections } from 'src/server/cms/global'
10
16
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
11
17
 
12
18
  export type MyAccountProps = {
13
19
  globalSections: GlobalSectionsData
20
+ accountName: string
14
21
  }
15
22
 
23
+ const query = gql(`
24
+ query ServerAccountPageQuery {
25
+ accountName
26
+ }
27
+ `)
28
+
16
29
  export const getServerSideProps: GetServerSideProps<
17
30
  MyAccountProps,
18
31
  Record<string, string>,
19
32
  Locator
20
- > = async ({ previewData, query }) => {
33
+ > = async (context) => {
21
34
  // TODO validate permissions here
22
35
 
23
36
  const { isFaststoreMyAccountEnabled, redirect } = getMyAccountRedirect({
24
- query,
37
+ query: context.query,
25
38
  })
26
39
 
27
40
  if (!isFaststoreMyAccountEnabled) {
@@ -32,10 +45,20 @@ export const getServerSideProps: GetServerSideProps<
32
45
  globalSectionsPromise,
33
46
  globalSectionsHeaderPromise,
34
47
  globalSectionsFooterPromise,
35
- ] = getGlobalSectionsData(previewData)
48
+ ] = getGlobalSectionsData(context.previewData)
36
49
 
37
- const [globalSections, globalSectionsHeader, globalSectionsFooter] =
50
+ const [account, globalSections, globalSectionsHeader, globalSectionsFooter] =
38
51
  await Promise.all([
52
+ execute<
53
+ ServerAccountPageQueryQueryVariables,
54
+ ServerAccountPageQueryQuery
55
+ >(
56
+ {
57
+ variables: {},
58
+ operation: query,
59
+ },
60
+ { headers: { ...context.req.headers } }
61
+ ),
39
62
  globalSectionsPromise,
40
63
  globalSectionsHeaderPromise,
41
64
  globalSectionsFooterPromise,
@@ -48,6 +71,9 @@ export const getServerSideProps: GetServerSideProps<
48
71
  })
49
72
 
50
73
  return {
51
- props: { globalSections: globalSectionsResult },
74
+ props: {
75
+ globalSections: globalSectionsResult,
76
+ accountName: account.data.accountName,
77
+ },
52
78
  }
53
79
  }