@faststore/core 3.88.1 → 3.88.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  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/routes-manifest.json +1 -1
  12. package/.next/server/chunks/9563.js +2 -2
  13. package/.next/server/chunks/9630.js +1 -1
  14. package/.next/server/middleware-build-manifest.js +1 -1
  15. package/.next/server/pages/api/graphql.js +2 -2
  16. package/.next/server/pages/en-US/404.html +1 -1
  17. package/.next/server/pages/en-US/500.html +1 -1
  18. package/.next/server/pages/en-US/checkout.html +1 -1
  19. package/.next/server/pages/en-US/login.html +1 -1
  20. package/.next/server/pages/en-US/s.html +1 -1
  21. package/.next/server/pages/en-US.html +1 -1
  22. package/.next/server/pages/pvt/account/orders/[id].js +1 -1
  23. package/.next/server/pages/pvt/account/orders.js +1 -1
  24. package/.next/server/pages/pvt/account/profile.js +1 -1
  25. package/.next/server/pages/pvt/account/security.js +1 -1
  26. package/.next/server/pages/pvt/account/user-details.js +1 -1
  27. package/.next/server/pages-manifest.json +1 -1
  28. package/.next/trace +137 -137
  29. package/.turbo/turbo-build.log +7 -7
  30. package/.turbo/turbo-test.log +5 -5
  31. package/CHANGELOG.md +6 -0
  32. package/package.json +3 -3
  33. package/src/pages/pvt/account/orders/[id].tsx +2 -1
  34. package/src/pages/pvt/account/orders/index.tsx +3 -1
  35. package/src/pages/pvt/account/profile.tsx +3 -1
  36. package/src/pages/pvt/account/security.tsx +2 -1
  37. package/src/pages/pvt/account/user-details.tsx +3 -1
  38. package/src/utils/utilities.ts +8 -4
  39. /package/.next/static/{ek0C2Ms_d9bobks7pNNTT → 3hMkgoLg2nujbpkfnZNzT}/_buildManifest.js +0 -0
  40. /package/.next/static/{ek0C2Ms_d9bobks7pNNTT → 3hMkgoLg2nujbpkfnZNzT}/_ssgManifest.js +0 -0
@@ -1,23 +1,23 @@
1
1
 
2
- > @faststore/core@3.88.0 prebuild /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.88.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.88.0 partytown /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@3.88.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.88.0 generate /home/runner/work/faststore/faststore/packages/core
11
+ > @faststore/core@3.88.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.88.0 generate:schema /home/runner/work/faststore/faststore/packages/core
15
+ > @faststore/core@3.88.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.88.0 generate:codegen /home/runner/work/faststore/faststore/packages/core
20
+ > @faststore/core@3.88.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.88.0 format:generated /home/runner/work/faststore/faststore/packages/core
40
+ > @faststore/core@3.88.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.88.0 build /home/runner/work/faststore/faststore/packages/core
44
+ > @faststore/core@3.88.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
@@ -1,14 +1,14 @@
1
1
 
2
- > @faststore/core@3.88.0 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@3.88.1 test /home/runner/work/faststore/faststore/packages/core
3
3
  > jest
4
4
 
5
- PASS test/server/cms/global.test.ts (27.462 s)
6
- PASS test/utils/multipleTemplates.test.ts (28.17 s)
5
+ PASS test/utils/multipleTemplates.test.ts (26.468 s)
6
+ PASS test/server/cms/global.test.ts (27.028 s)
7
7
  PASS test/server/cms/index.test.ts
8
- PASS test/server/index.test.ts (31.175 s)
8
+ PASS test/server/index.test.ts (30.277 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: 32.407 s
13
+ Time: 31.437 s
14
14
  Ran all test suites.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
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.88.2](https://github.com/vtex/faststore/compare/v3.88.1...v3.88.2) (2025-09-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - improve error handling in user order query - SFS-2866 ([#3043](https://github.com/vtex/faststore/issues/3043)) ([efb9c08](https://github.com/vtex/faststore/commit/efb9c08a805e0ba9e5d49823b09be475ee1eee04))
11
+
6
12
  ## [3.88.1](https://github.com/vtex/faststore/compare/v3.88.0...v3.88.1) (2025-09-19)
7
13
 
8
14
  **Note:** Version bump only for package @faststore/core
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "3.88.1",
3
+ "version": "3.88.2",
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.88.1",
47
+ "@faststore/api": "^3.88.2",
48
48
  "@faststore/graphql-utils": "^3.81.0",
49
49
  "@faststore/lighthouse": "^3.81.0",
50
50
  "@faststore/sdk": "^3.85.0",
@@ -116,5 +116,5 @@
116
116
  "ts-jest": "29.1.1",
117
117
  "typescript": "5.3.2"
118
118
  },
119
- "gitHead": "f3d044aabbb76bc6d6c0e1e63316afc696784cc5"
119
+ "gitHead": "c1fb778f2a06980df039b1b85ce6e94328addd53"
120
120
  }
@@ -15,6 +15,7 @@ import type {
15
15
  ServerOrderDetailsQueryQuery,
16
16
  ServerOrderDetailsQueryQueryVariables,
17
17
  } from '@generated/graphql'
18
+ import storeConfig from 'discovery.config'
18
19
  import { getGlobalSectionsData } from 'src/components/cms/GlobalSections'
19
20
  import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/after'
20
21
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/orders/[id]/before'
@@ -24,7 +25,6 @@ import { execute } from 'src/server'
24
25
  import { injectGlobalSections } from 'src/server/cms/global'
25
26
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
26
27
  import { extractStatusFromError } from 'src/utils/utilities'
27
- import storeConfig from 'discovery.config'
28
28
 
29
29
  const COMPONENTS: Record<string, ComponentType<any>> = {
30
30
  ...GLOBAL_COMPONENTS,
@@ -323,6 +323,7 @@ export const getServerSideProps: GetServerSideProps<
323
323
  ])
324
324
 
325
325
  if (orderDetails.errors) {
326
+ console.error(...orderDetails.errors)
326
327
  const status = extractStatusFromError(orderDetails.errors?.[0])
327
328
 
328
329
  const isForbidden = status === 403 || status === 401
@@ -22,12 +22,12 @@ import { injectGlobalSections } from 'src/server/cms/global'
22
22
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
23
23
  import { groupOrderStatusByLabel } from 'src/utils/userOrderStatus'
24
24
 
25
+ import storeConfig from 'discovery.config'
25
26
  import { MyAccountListOrders } from 'src/components/account/orders/MyAccountListOrders'
26
27
  import { getIsRepresentative } from 'src/sdk/account/getIsRepresentative'
27
28
  import { validateUser } from 'src/sdk/account/validateUser'
28
29
  import PageProvider from 'src/sdk/overrides/PageProvider'
29
30
  import { extractStatusFromError } from 'src/utils/utilities'
30
- import storeConfig from 'discovery.config'
31
31
 
32
32
  /* A list of components that can be used in the CMS. */
33
33
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -220,6 +220,8 @@ export const getServerSideProps: GetServerSideProps<
220
220
  ])
221
221
 
222
222
  if (listOrders.errors) {
223
+ console.error(...listOrders.errors)
224
+
223
225
  const status = extractStatusFromError(listOrders.errors[0])
224
226
  const isForbidden = status === 403 || status === 401
225
227
 
@@ -26,9 +26,9 @@ import { validateUser } from 'src/sdk/account/validateUser'
26
26
  import { injectGlobalSections } from 'src/server/cms/global'
27
27
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
28
28
 
29
+ import storeConfig from 'discovery.config'
29
30
  import PageProvider from 'src/sdk/overrides/PageProvider'
30
31
  import { execute } from 'src/server'
31
- import storeConfig from 'discovery.config'
32
32
 
33
33
  /* A list of components that can be used in the CMS. */
34
34
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -132,6 +132,8 @@ export const getServerSideProps: GetServerSideProps<
132
132
  ])
133
133
 
134
134
  if (profile.errors) {
135
+ console.error(...profile.errors)
136
+
135
137
  const statusCode: number = (profile.errors[0] as any)?.extensions?.status
136
138
  const destination: string =
137
139
  statusCode === 403 ? '/pvt/account/403' : '/pvt/account/404'
@@ -29,8 +29,8 @@ import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
29
29
  import { validateUser } from 'src/sdk/account/validateUser'
30
30
  import PageProvider from 'src/sdk/overrides/PageProvider'
31
31
 
32
- import { SecuritySection } from 'src/components/account/security'
33
32
  import storeConfig from 'discovery.config'
33
+ import { SecuritySection } from 'src/components/account/security'
34
34
 
35
35
  /* A list of components that can be used in the CMS. */
36
36
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -129,6 +129,7 @@ export const getServerSideProps: GetServerSideProps<
129
129
  ])
130
130
 
131
131
  if (security.errors) {
132
+ console.error(...security.errors)
132
133
  const statusCode: number = (security.errors[0] as any)?.extensions?.status
133
134
  const destination: string =
134
135
  statusCode === 403 ? '/pvt/account/403' : '/pvt/account/404'
@@ -15,6 +15,7 @@ import type {
15
15
  ServerUserDetailsQueryQuery,
16
16
  ServerUserDetailsQueryQueryVariables,
17
17
  } from '@generated/graphql'
18
+ import storeConfig from 'discovery.config'
18
19
  import MyAccountUserDetails from 'src/components/account/MyAccountUserDetails/MyAccountUserDetails'
19
20
  import { default as AfterSection } from 'src/customizations/src/myAccount/extensions/user-details/after'
20
21
  import { default as BeforeSection } from 'src/customizations/src/myAccount/extensions/user-details/before'
@@ -25,7 +26,6 @@ import PageProvider from 'src/sdk/overrides/PageProvider'
25
26
  import { execute } from 'src/server'
26
27
  import { injectGlobalSections } from 'src/server/cms/global'
27
28
  import { getMyAccountRedirect } from 'src/utils/myAccountRedirect'
28
- import storeConfig from 'discovery.config'
29
29
 
30
30
  /* A list of components that can be used in the CMS. */
31
31
  const COMPONENTS: Record<string, ComponentType<any>> = {
@@ -147,6 +147,8 @@ export const getServerSideProps: GetServerSideProps<
147
147
  }
148
148
 
149
149
  if (userDetails?.errors) {
150
+ console.error(...userDetails.errors)
151
+
150
152
  const statusCode: number = (userDetails.errors[0] as any)?.extensions
151
153
  ?.status
152
154
  const destination: string =
@@ -53,13 +53,17 @@ export function camelCaseToTitle(str: string): string {
53
53
  }
54
54
 
55
55
  export function extractStatusFromError(error: any): number | undefined {
56
+ if (error?.extensions?.status) {
57
+ return error.extensions.status
58
+ }
59
+
56
60
  if (!error?.message) return undefined
57
61
 
58
- const match = error.message.match(/{.*}$/)
59
- if (!match) return undefined
62
+ const matchMessage = error.message.match(/{.*}$/)
63
+ if (!matchMessage) return undefined
60
64
 
61
65
  try {
62
- const parsed = JSON.parse(match[0])
66
+ const parsed = JSON.parse(matchMessage[0])
63
67
 
64
68
  if (parsed.status) {
65
69
  return parsed.status
@@ -70,7 +74,7 @@ export function extractStatusFromError(error: any): number | undefined {
70
74
  return inner.status
71
75
  }
72
76
  } catch {
73
- console.error('Failed to parse error message:', match[0])
77
+ console.error('Failed to parse error message:', matchMessage[0])
74
78
  }
75
79
 
76
80
  return undefined