@faststore/core 4.11.1 → 4.11.2-dev.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.
@@ -1,9 +1,9 @@
1
1
 
2
- > @faststore/core@4.11.0 generate /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.11.2-dev.0 generate /home/runner/work/faststore/faststore/packages/core
3
3
  > pnpm run gen-types && pnpm run cache-graphql
4
4
 
5
5
 
6
- > @faststore/core@4.11.0 gen-types /home/runner/work/faststore/faststore/packages/core
6
+ > @faststore/core@4.11.2-dev.0 gen-types /home/runner/work/faststore/faststore/packages/core
7
7
  > node ../cli/bin/run generate-types .
8
8
 
9
9
  [STARTED] Parse Configuration
@@ -19,7 +19,7 @@
19
19
  [COMPLETED] Generate to @generated/
20
20
  [COMPLETED] Generate outputs
21
21
 
22
- > @faststore/core@4.11.0 cache-graphql /home/runner/work/faststore/faststore/packages/core
22
+ > @faststore/core@4.11.2-dev.0 cache-graphql /home/runner/work/faststore/faststore/packages/core
23
23
  > node ../cli/bin/run cache-graphql --config=./discovery.config.default.js --queries=./@generated/persisted-documents.json
24
24
 
25
25
  [Info] - Config file location: /home/runner/work/faststore/faststore/packages/core/discovery.config.default.js
@@ -1,5 +1,5 @@
1
1
 
2
- > @faststore/core@4.11.0 test /home/runner/work/faststore/faststore/packages/core
2
+ > @faststore/core@4.11.2-dev.0 test /home/runner/work/faststore/faststore/packages/core
3
3
  > vitest run
4
4
 
5
5
 
@@ -7,26 +7,30 @@
7
7
 
8
8
  Not implemented: navigation to another Document
9
9
  Not implemented: navigation to another Document
10
- ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 805ms
10
+ ✓  browser  test/sdk/ui/useScrollRestoration.browser.test.ts (43 tests) 1383ms
11
11
  Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
12
12
  npx update-browserslist-db@latest
13
13
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
14
- ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (16 tests) 1387ms
15
- ✓ shows the tab bar and renders Personal cards by default  635ms
16
- ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (22 tests) 1720ms
17
- ✓ shows an error state when the list fails to load  450ms
18
- ✓  browser  test/components/account/orders/BuyingPolicyAlert.browser.test.tsx (13 tests) 2065ms
19
- ✓ opens the reject confirmation modal with the default English copy  699ms
20
- ✓  browser  test/components/ui/RichText/RichText.browser.test.tsx (8 tests) 353ms
21
- ✓  browser  test/sdk/product/usePageProductsQuery.browser.test.ts (9 tests) 156ms
22
- ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (10 tests) 1580ms
23
- ✓ renders the menu view with contract details and manage footer  802ms
24
- ✓ opens the contract switcher and returns to the menu on back  326ms
25
- ✓  browser  test/components/CartRecommendationShelf/CartRecommendationShelf.browser.test.tsx (13 tests) 59ms
26
- ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (6 tests) 6ms
27
- ✓  browser  test/sdk/localization/useBindingSelector.browser.test.tsx (9 tests) 94ms
28
- ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 46ms
29
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (12 tests) 43ms
14
+ ✓  browser  test/components/account/cards/MyAccountListCards.browser.test.tsx (16 tests) 2666ms
15
+ ✓ shows the tab bar and renders Personal cards by default  1228ms
16
+ ✓ paginates when there are more than 25 cards  375ms
17
+ ✓  browser  test/components/account/ContractSwitcher.browser.test.tsx (22 tests) 3510ms
18
+ ✓ shows an error state when the list fails to load  781ms
19
+ ✓ requires selecting a contract before Confirm is enabled, then switches (REQ-03)  369ms
20
+ ✓ keeps Confirm disabled until a different contract is selected  370ms
21
+ ✓ honors CMS-provided labels for the header, current session, search, footer, and available count  366ms
22
+ ✓  browser  test/components/account/orders/BuyingPolicyAlert.browser.test.tsx (13 tests) 2700ms
23
+ ✓ opens the reject confirmation modal with the default English copy  1153ms
24
+ ✓ opens the reject confirmation modal with CMS-provided labels  395ms
25
+ ✓  browser  test/components/ui/RichText/RichText.browser.test.tsx (8 tests) 372ms
26
+ ✓  browser  test/components/account/OrganizationDrawer.browser.test.tsx (10 tests) 1485ms
27
+ ✓ renders the menu view with contract details and manage footer  771ms
28
+ ✓ resets to the menu when the drawer closes  332ms
29
+ ✓  browser  test/sdk/product/usePageProductsQuery.browser.test.ts (9 tests) 108ms
30
+ ✓  browser  test/components/CartRecommendationShelf/CartRecommendationShelf.browser.test.tsx (13 tests) 131ms
31
+ ✓  browser  test/sdk/session/reconcileSessionLocale.browser.test.ts (6 tests) 24ms
32
+ ✓  browser  test/sdk/localization/useBindingSelector.browser.test.tsx (9 tests) 103ms
33
+ ✓  browser  test/components/ui/ProductGallery/GalleryPageHeightLock.browser.test.tsx (8 tests) 87ms
30
34
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx
31
35
  Error in optimistic validation: TypeError: Failed to parse URL from /api/graphql?operationName=ValidateCartMutation&operationHash=3c71b0d3fc2bade14df68abfa271858beb361b12
32
36
   at node:internal/deps/undici/undici:16416:13
@@ -53,14 +57,16 @@ Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
53
57
  }
54
58
  }
55
59
 
60
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.browser.test.tsx (12 tests) 106ms
56
61
  stderr | test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx > RecommendationShelf > renders nothing when there is an error
57
62
  Error fetching recommendations undefined boom for campaign vrn:recommendations:acc:rec-top-items-v2:campaign-1
58
63
 
59
- ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 95ms
60
- ✓  browser  test/sdk/product/useProductQuery.browser.test.ts (5 tests) 303ms
61
- ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (7 tests) 5ms
62
- ✓  browser  test/components/CartSidebar/CartSidebar.browser.test.tsx (5 tests) 79ms
64
+ ✓  browser  test/components/RecommendationShelf/RecommendationShelf.browser.test.tsx (8 tests) 191ms
65
+ ✓  browser  test/sdk/product/useProductQuery.browser.test.ts (5 tests) 421ms
63
66
  ✓  browser  test/components/sections/Account/AccountOrderDetails.browser.test.tsx (4 tests) 118ms
67
+ ✓  browser  test/components/CartSidebar/CartSidebar.browser.test.tsx (5 tests) 211ms
68
+ ✓  browser  test/sdk/session/getInitialSession.browser.test.ts (7 tests) 30ms
69
+ ✓  browser  test/components/navigation/Navbar.browser.test.tsx (3 tests) 112ms
64
70
  stderr | test/sdk/session/validateSession.browser.test.ts
65
71
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
66
72
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -69,8 +75,7 @@ Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
69
75
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
70
76
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
71
77
 
72
- ✓  browser  test/components/navigation/Navbar.browser.test.tsx (3 tests) 91ms
73
- ✓  browser  test/sdk/session/validateSession.browser.test.ts (9 tests) 26ms
78
+ ✓  browser  test/sdk/session/validateSession.browser.test.ts (9 tests) 14ms
74
79
  stderr | test/pages/password-protection.browser.test.tsx > PasswordProtectionLogin > posts the password and redirects to the requested return path
75
80
  Warning: An update to PasswordProtectionLogin inside a test was not wrapped in act(...).
76
81
 
@@ -300,8 +305,8 @@ act(() => {
300
305
  This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
301
306
  at PasswordProtectionLogin (/home/runner/work/faststore/faststore/packages/core/src/pages/password-protection/index.tsx:19:69)
302
307
 
303
- ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 696ms
304
- ✓ renders the password protection form  342ms
308
+ ✓  browser  test/pages/password-protection.browser.test.tsx (6 tests) 1147ms
309
+ ✓ renders the password protection form  491ms
305
310
  stderr | test/components/cms/RenderSections.browser.test.tsx
306
311
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
307
312
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -310,12 +315,12 @@ This ensures that you're testing the behavior the user would see in the browser.
310
315
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
311
316
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
312
317
 
313
- ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (8 tests) 257ms
314
- ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (5 tests) 36ms
315
- ✓  browser  test/components/cms/RenderSections.browser.test.tsx (5 tests) 53ms
316
- ✓  browser  test/components/navigation/NavbarSlider.browser.test.tsx (2 tests) 28ms
317
- ✓  browser  test/sdk/product/usePageProductsQuery.deliveryPromise.browser.test.ts (3 tests) 16ms
318
- ✓  browser  test/components/account/Menu.browser.test.tsx (6 tests) 179ms
318
+ ✓  browser  test/components/account/OrganizationDrawerFooter.browser.test.tsx (8 tests) 396ms
319
+ ✓  browser  test/sdk/account/useSwitchContract.browser.test.ts (5 tests) 55ms
320
+ ✓  browser  test/components/cms/RenderSections.browser.test.tsx (5 tests) 83ms
321
+ ✓  browser  test/sdk/product/usePageProductsQuery.deliveryPromise.browser.test.ts (3 tests) 48ms
322
+ ✓  browser  test/components/navigation/NavbarSlider.browser.test.tsx (2 tests) 52ms
323
+ ✓  browser  test/components/account/Menu.browser.test.tsx (6 tests) 372ms
319
324
  stderr | test/sdk/localization/store-url.browser.test.ts
320
325
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
321
326
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -324,9 +329,9 @@ This ensures that you're testing the behavior the user would see in the browser.
324
329
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
325
330
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
326
331
 
327
- ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 3ms
328
- ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 18ms
329
- ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 42ms
332
+ ✓  browser  test/sdk/localization/store-url.browser.test.ts (3 tests) 5ms
333
+ ✓  browser  test/sdk/account/useAvailableContracts.browser.test.ts (6 tests) 28ms
334
+ ✓  browser  test/components/templates/SearchPage/SearchWrapper.browser.test.tsx (3 tests) 44ms
330
335
  stderr | test/sdk/session/refreshTokenRoute.browser.test.ts
331
336
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
332
337
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -335,12 +340,12 @@ This ensures that you're testing the behavior the user would see in the browser.
335
340
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
336
341
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
337
342
 
338
- ✓  browser  test/sdk/session/refreshTokenRoute.browser.test.ts (3 tests) 5ms
339
- ✓  browser  test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx (2 tests) 125ms
340
- ✓  browser  test/components/navigation/NavbarAccountArea.browser.test.tsx (4 tests) 54ms
341
- ✓  browser  test/components/CartRecommendationShelf/CartRecommendationProductCard.browser.test.tsx (3 tests) 29ms
342
- ✓  browser  test/components/sections/Account/AccountListQuotes.browser.test.tsx (4 tests) 75ms
343
- ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 13ms
343
+ ✓  browser  test/sdk/session/refreshTokenRoute.browser.test.ts (3 tests) 11ms
344
+ ✓  browser  test/sdk/recommendations/useRecommendationShelf.sessionFallback.browser.test.tsx (2 tests) 136ms
345
+ ✓  browser  test/components/sections/Account/AccountListQuotes.browser.test.tsx (4 tests) 152ms
346
+ ✓  browser  test/components/navigation/NavbarAccountArea.browser.test.tsx (4 tests) 65ms
347
+ ✓  browser  test/components/CartRecommendationShelf/CartRecommendationProductCard.browser.test.tsx (3 tests) 40ms
348
+ ✓  browser  test/sdk/account/changeContractToken.browser.test.ts (9 tests) 20ms
344
349
  stderr | test/components/account/doLogout.browser.test.ts
345
350
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
346
351
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -349,11 +354,11 @@ This ensures that you're testing the behavior the user would see in the browser.
349
354
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
350
355
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
351
356
 
352
- ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 13ms
353
- ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (5 tests) 210ms
354
- ✓  browser  test/sdk/product/useProductNotFoundRedirect.browser.test.ts (7 tests) 26ms
355
- ✓  browser  test/sdk/account/useRefreshToken.browser.test.ts (4 tests) 128ms
356
- ✓  browser  test/components/ui/LocalizationButton.browser.test.tsx (3 tests) 32ms
357
+ ✓  browser  test/components/account/doLogout.browser.test.ts (1 test) 31ms
358
+ ✓  browser  test/components/account/OrganizationDrawerHeader.browser.test.tsx (5 tests) 376ms
359
+ ✓  browser  test/sdk/product/useProductNotFoundRedirect.browser.test.ts (7 tests) 44ms
360
+ ✓  browser  test/sdk/account/useRefreshToken.browser.test.ts (4 tests) 139ms
361
+ ✓  browser  test/components/ui/LocalizationButton.browser.test.tsx (3 tests) 56ms
357
362
  stderr | test/sdk/account/clearPersistedSessionState.browser.test.ts
358
363
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
359
364
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -362,15 +367,14 @@ This ensures that you're testing the behavior the user would see in the browser.
362
367
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
363
368
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
364
369
 
365
- ✓  browser  test/components/account/OrganizationSignInButton.browser.test.tsx (4 tests) 209ms
366
- ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (4 tests) 18ms
367
- ✓  browser  test/components/sections/Account/AccountOrderDelivery.browser.test.tsx (2 tests) 57ms
368
- ✓  browser  test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx (2 tests) 52ms
369
- ✓  browser  test/components/sections/Account/AccountOrderStatus.browser.test.tsx (3 tests) 85ms
370
- ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 44ms
371
- ✓  browser  test/components/region/useRegion.browser.test.ts (1 test) 11ms
372
- ✓  browser  test/components/sections/Account/AccountOrdersList.browser.test.tsx (2 tests) 16ms
373
- ✓  browser  test/components/account/orders/SummaryCard.browser.test.tsx (2 tests) 49ms
370
+ ✓  browser  test/components/account/OrganizationSignInButton.browser.test.tsx (4 tests) 293ms
371
+ ✓  browser  test/sdk/account/clearPersistedSessionState.browser.test.ts (4 tests) 20ms
372
+ ✓  browser  test/components/sections/Account/AccountOrderDelivery.browser.test.tsx (2 tests) 111ms
373
+ ✓  browser  test/components/account/orders/DeliveryOptionAccordion.browser.test.tsx (2 tests) 116ms
374
+ ✓  browser  test/components/sections/Account/AccountOrderStatus.browser.test.tsx (3 tests) 123ms
375
+ ✓  browser  test/components/sections/Account/AccountListCards.browser.test.tsx (3 tests) 86ms
376
+ ✓  browser  test/components/region/useRegion.browser.test.ts (1 test) 28ms
377
+ ✓  browser  test/components/sections/Account/AccountOrdersList.browser.test.tsx (2 tests) 20ms
374
378
  stderr | test/sdk/session/sessionStore.browser.test.ts
375
379
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
376
380
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -379,9 +383,10 @@ This ensures that you're testing the behavior the user would see in the browser.
379
383
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
380
384
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
381
385
 
382
- ✓  browser  test/sdk/session/sessionStore.browser.test.ts (2 tests) 3ms
383
- ✓  browser  test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx (1 test) 27ms
384
- ✓  browser  test/utils/shouldBypassRefreshToken.browser.test.ts (5 tests) 3ms
386
+ ✓  browser  test/components/account/orders/SummaryCard.browser.test.tsx (2 tests) 111ms
387
+ ✓  browser  test/sdk/session/sessionStore.browser.test.ts (2 tests) 7ms
388
+ ✓  browser  test/components/account/orders/DeliveryOptionAccordionDeliveryInfo.browser.test.tsx (1 test) 47ms
389
+ ✓  browser  test/utils/shouldBypassRefreshToken.browser.test.ts (5 tests) 7ms
385
390
  stderr | test/sdk/account/refreshToken.browser.test.ts
386
391
  Error in optimistic validation: TypeError: Cannot read properties of undefined (reading 'read')
387
392
  at waitForSessionValidated (/home/runner/work/faststore/faststore/packages/core/src/sdk/cart/waitForSessionValidated.ts:16:32)
@@ -390,17 +395,18 @@ This ensures that you're testing the behavior the user would see in the browser.
390
395
  at a (/home/runner/work/faststore/faststore/packages/sdk/dist/es/index.mjs:357:23)
391
396
   at processTicksAndRejections (node:internal/process/task_queues:103:5)
392
397
 
393
- ✓  browser  test/sdk/account/refreshToken.browser.test.ts (2 tests) 3ms
394
- ✓  browser  test/components/account/orders/StatusCard.browser.test.tsx (2 tests) 70ms
395
- ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 2ms
396
- ✓  browser  test/components/account/orders/DeliveryCard.browser.test.tsx (1 test) 28ms
397
- ✓  browser  test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx (1 test) 21ms
398
- ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 25ms
399
- ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 14ms
400
- ✓  node  test/pages/api/switch-contract.test.ts (61 tests) 163ms
401
- ✓  browser  test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx (1 test) 139ms
402
- ✓  node  test/server/password-protection-service.test.ts (22 tests) 27ms
403
- ✓  node  test/server/content/service.test.ts (27 tests) 23ms
398
+ ✓  browser  test/sdk/account/refreshToken.browser.test.ts (2 tests) 7ms
399
+ ✓  browser  test/components/account/orders/StatusCard.browser.test.tsx (2 tests) 110ms
400
+ ✓  browser  test/sdk/session/reconcileSessionLocale.disabled.browser.test.ts (1 test) 4ms
401
+ ✓  browser  test/components/account/orders/DeliveryCard.browser.test.tsx (1 test) 54ms
402
+ ✓  browser  test/components/account/orders/DeliveryOptionAccordionProducts.browser.test.tsx (1 test) 36ms
403
+ ✓  browser  test/components/skeletons/ProductGridSkeleton.browser.test.tsx (2 tests) 44ms
404
+ ✓  node  test/pages/api/switch-contract.test.ts (61 tests) 184ms
405
+ ✓  node  test/utils/localization/bindingPaths.test.ts (71 tests) 29ms
406
+ ✓  node  test/server/password-protection-service.test.ts (22 tests) 36ms
407
+ ✓  browser  test/components/account/orders/FilterFacetPendingApproval.browser.test.tsx (1 test) 208ms
408
+ ✓  node  test/server/content/service.test.ts (27 tests) 44ms
409
+ ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 16ms
404
410
  stderr | test/sdk/deliveryPromise/provider.effect.test.tsx > DeliveryPromiseProvider pickup fetch > clears the loading flag after a failed request and retries on the next update
405
411
  Failed to fetch pickup points: Error: network
406
412
  at /home/runner/work/faststore/faststore/packages/core/test/sdk/deliveryPromise/provider.effect.test.tsx:250:30
@@ -427,9 +433,8 @@ This ensures that you're testing the behavior the user would see in the browser.
427
433
  at trace (file:///home/runner/work/faststore/faststore/node_modules/.pnpm/vitest@4.0.18_@opentelemetry+api@1.9.0_@types+node@20.19.13_jiti@2.6.1_jsdom@27.4.0_sas_13be941c57d55f08f06eeaf1c180ddfe/node_modules/vitest/dist/chunks/test.B8ej_ZHS.js:239:21)
428
434
  at runTest (file:///home/runner/work/faststore/faststore/node_modules/.pnpm/@vitest+runner@4.0.18/node_modules/@vitest/runner/dist/index.js:1653:12)
429
435
 
430
- ✓  node  test/sdk/deliveryPromise/provider.effect.test.tsx (9 tests) 58ms
431
- ✓  node  test/sdk/localization/useBindingSelector.test.tsx (22 tests) 11ms
432
- ✓  node  test/utils/match-url.test.ts (10 tests) 6ms
436
+ ✓  node  test/sdk/deliveryPromise/provider.effect.test.tsx (9 tests) 95ms
437
+ ✓  node  test/utils/match-url.test.ts (10 tests) 11ms
433
438
  stderr | test/pages/api/graphql.test.ts > /api/graphql error status propagation > propagates the upstream 400 from a wrapped BadRequestError instead of 500
434
439
  Graphql execution returned with error: [
435
440
  {
@@ -571,10 +576,10 @@ This ensures that you're testing the behavior the user would see in the browser.
571
576
  extensions: { status: 401, type: 'UnauthorizedError' }
572
577
  }
573
578
 
574
- ✓  node  test/pages/api/graphql.test.ts (30 tests) 25ms
575
- ✓  node  test/pages/api/unlock.test.ts (15 tests) 89ms
576
- ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (14 tests) 9ms
577
- ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 9ms
579
+ ✓  node  test/pages/api/graphql.test.ts (30 tests) 41ms
580
+ ✓  node  test/pages/api/unlock.test.ts (15 tests) 165ms
581
+ ✓  node  test/sdk/session/syncSalesChannelFromOrderForm.test.ts (14 tests) 14ms
582
+ ✓  node  test/sdk/localization/bindingSelector.test.ts (18 tests) 10ms
578
583
  stderr | test/components/search/SearchInputComponent.test.tsx
579
584
  Warning: forwardRef render functions accept exactly two parameters: props and ref. Did you forget to use the ref parameter?
580
585
 
@@ -638,97 +643,105 @@ Warning: React does not recognize the `providerProps` prop on a DOM element. If
638
643
  at Suspense
639
644
  at Wrapper (/home/runner/work/faststore/faststore/packages/core/test/components/search/SearchInputComponent.test.tsx:106:20)
640
645
 
641
- ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 40ms
642
- ✓  node  test/sdk/account/refreshToken.test.ts (21 tests) 7ms
643
- ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (15 tests) 284ms
644
- ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 27ms
646
+ ✓  node  test/components/search/SearchInputComponent.test.tsx (6 tests) 87ms
647
+ ✓  node  test/sdk/account/refreshToken.test.ts (21 tests) 12ms
648
+ ✓  node  test/components/quotes/MyAccountListQuotesTable.test.tsx (15 tests) 399ms
649
+ ✓  node  test/sdk/search/useSearchHistory.test.ts (13 tests) 57ms
645
650
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > redirects to /pvt/account/403 when the query fails with 401/403
646
651
  { extensions: { status: 401 } }
647
652
 
648
653
  stderr | test/pages/pvt/account/cards/index.test.ts > Cards page getServerSideProps > renders the error state (no redirect) when the query fails with a non-auth status
649
654
  { extensions: { status: 502 } }
650
655
 
651
- ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 6ms
652
- ✓  node  test/components/quotes/quoteFilters.test.ts (26 tests) 16ms
653
- ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 7ms
654
- ✓  node  test/utils/productJsonLd.test.ts (36 tests) 6ms
655
- ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (11 tests) 799ms
656
- ✓ navigates with the search term on blur  362ms
656
+ ✓  node  test/pages/pvt/account/cards/index.test.ts (8 tests) 9ms
657
+ ✓  node  test/components/quotes/quoteFilters.test.ts (26 tests) 36ms
658
+ ✓  node  test/utils/productJsonLd.test.ts (36 tests) 14ms
659
+ ✓  node  test/utils/cookieCacheBusting.test.ts (10 tests) 11ms
660
+ ✓  node  test/components/quotes/MyAccountListQuotes.test.tsx (11 tests) 845ms
661
+ ✓ navigates with the search term on blur  360ms
657
662
  ✓ navigates without a label param when the search is cleared  358ms
658
- ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 6ms
659
- ✓  node  test/utils/clearCookies.test.ts (20 tests) 14ms
660
- ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 4ms
663
+ ✓  node  test/experimental/myAccountCmsServerSideProps.test.ts (5 tests) 11ms
664
+ ✓  node  test/utils/clearCookies.test.ts (20 tests) 25ms
665
+ ✓  node  test/utils/multipleTemplates.test.ts (8 tests) 5ms
661
666
  stderr | test/sdk/account/useSetPassword.test.ts > useSetPassword > maps wrongcredentials error responses to the existing message
662
667
  Set password request failed: Bad Request
663
668
 
664
- ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 28ms
665
- ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 30ms
666
- ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 4ms
667
- ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (8 tests) 92ms
668
- ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (14 tests) 116ms
669
- ✓  node  test/utils/localization/hreflang.test.ts (8 tests) 4ms
670
- ✓  node  test/server/cms/index.test.ts (7 tests) 7ms
671
- ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (13 tests) 5ms
672
- ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (10 tests) 58ms
673
- ✓  node  test/server/content/promiseCache.test.ts (10 tests) 10ms
674
- ✓  node  test/sdk/redirects/index.test.ts (7 tests) 33ms
675
- ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 29ms
676
- ✓  node  test/proxy.localization.test.ts (5 tests) 30ms
677
- ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 27ms
678
- ✓  node  test/utils/trustedForwardedHost.test.ts (36 tests) 6ms
679
- ✓  node  test/components/account/orders/getDeliveryOptionLabel.test.ts (21 tests) 5ms
680
- ✓  node  test/sdk/graphql/retryPolicy.test.ts (18 tests) 14ms
669
+ ✓  node  test/sdk/account/useSetPassword.test.ts (6 tests) 48ms
670
+ ✓  node  test/sdk/orderEntry/useOrderEntryOperation.test.ts (8 tests) 32ms
671
+ ✓  node  test/utils/localization/localizeRedirectDestination.test.ts (11 tests) 7ms
672
+ ✓  node  test/components/quotes/MyAccountQuotesFilterSlider.test.tsx (8 tests) 153ms
673
+ ✓  node  test/components/quotes/MyAccountQuotesStatusSelector.test.tsx (14 tests) 142ms
674
+ ✓  node  test/utils/localization/hreflang.test.ts (8 tests) 8ms
675
+ ✓  node  test/sdk/account/getMyAccountRoutes.test.ts (13 tests) 9ms
676
+ ✓  node  test/server/cms/index.test.ts (7 tests) 12ms
677
+ ✓  node  test/components/quotes/MyAccountQuotesSelectedTags.test.tsx (10 tests) 124ms
678
+ ✓  node  test/server/content/promiseCache.test.ts (10 tests) 17ms
679
+ ✓  node  test/sdk/redirects/index.test.ts (7 tests) 49ms
680
+ ✓  node  test/sdk/orderEntry/useOrderEntryUpload.test.ts (8 tests) 46ms
681
+ ✓  node  test/sdk/orderEntry/useOrderEntry.test.ts (8 tests) 43ms
682
+ ✓  node  test/proxy.localization.test.ts (5 tests) 42ms
683
+ ✓  node  test/utils/trustedForwardedHost.test.ts (36 tests) 16ms
684
+ ✓  node  test/components/account/orders/getDeliveryOptionLabel.test.ts (21 tests) 8ms
685
+ ✓  node  test/sdk/graphql/retryPolicy.test.ts (18 tests) 31ms
681
686
  ✓  node  test/server/cms/myAccountDefaultSections.test.ts (9 tests) 5ms
682
- ✓  node  test/utils/productJsonLdRendering.test.tsx (5 tests) 10ms
683
- ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 29ms
684
- ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 17ms
685
- ✓  node  test/server/index.test.ts (7 tests) 947ms
686
- ✓ should handle options and execute  553ms
687
- ✓  node  test/proxy.test.ts (4 tests) 12ms
688
- ✓  node  test/pages/api/logout.test.ts (4 tests) 30ms
687
+ ✓  node  test/utils/productJsonLdRendering.test.tsx (5 tests) 13ms
688
+ ✓  node  test/server/index.test.ts (7 tests) 953ms
689
+ ✓ should handle options and execute  494ms
690
+ ✓  node  test/proxy.test.ts (4 tests) 22ms
691
+ ✓  node  test/pages/api/logout.test.ts (4 tests) 35ms
692
+ ✓  node  test/sdk/analytics/useStartRecommendationSession.test.ts (6 tests) 55ms
689
693
  ✓  node  test/utils/shouldBypassRefreshToken.test.ts (14 tests) 5ms
690
- ✓  node  test/server/webops-api.test.ts (9 tests) 10ms
691
- ✓  node  test/components/account/orders/StatusCard.test.ts (3 tests) 15ms
692
- ✓  node  test/sdk/deliveryPromise/queries.test.ts (4 tests) 9ms
693
- ✓  node  test/sdk/localization/store-url.test.ts (4 tests) 3ms
694
- ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 7ms
695
- ✓  node  test/server/cms/global.test.ts (3 tests) 4ms
696
- ✓  node  test/sdk/deliveryPromise/provider.test.ts (11 tests) 3ms
697
- ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 19ms
698
- ✓  node  test/components/account/Layout.test.tsx (6 tests) 47ms
699
- ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 5ms
700
- ✓  node  test/server/rootSpan.test.ts (4 tests) 24ms
701
- ✓  node  test/pages/api/preview.test.ts (2 tests) 4ms
702
- ✓  node  test/components/search/SearchInput.test.ts (6 tests) 4ms
703
- ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 2ms
704
- ✓  node  test/pages/pvt/account/403.test.ts (5 tests) 5ms
705
- ✓  node  test/components/region/useRegion.test.ts (1 test) 15ms
706
- ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 3ms
707
- ✓  node  test/utils/retry.test.ts (5 tests) 11ms
708
- ✓  node  test/sdk/account/getIsB2BBuyer.test.ts (7 tests) 4ms
709
- ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 3ms
710
- ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 178ms
711
- ✓  node  test/utils/userOrderStatus.test.ts (4 tests) 3ms
712
- ✓  node  test/utils/unlockResponse.test.ts (11 tests) 3ms
713
- ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 3ms
714
- ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 25ms
715
- ✓  node  test/sdk/deliveryPromise/reducer.test.ts (2 tests) 4ms
716
- ✓  node  test/utils/isLocalHost.test.ts (7 tests) 3ms
717
- ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (4 tests) 23ms
718
- ✓  node  test/sdk/session/toSessionInput.test.ts (3 tests) 2ms
719
- ✓  node  test/components/account/orders/getOrderTotalLabel.test.ts (6 tests) 2ms
720
- ✓  node  test/components/account/orders/listOrdersLabels.test.ts (2 tests) 2ms
721
- ✓  node  test/utils/getCookie.test.ts (4 tests) 3ms
722
- ✓  node  test/sdk/session/isSignInAreaResolved.test.ts (3 tests) 2ms
723
- ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 27ms
724
- ✓  node  test/utils/filterChannel.test.ts (2 tests) 3ms
725
- ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 3ms
726
- ✓  node  test/instrumentation.test.ts (3 tests) 4ms
727
- ✓  node  test/components/account/orders/orderDetailsLabels.test.ts (1 test) 3ms
728
- ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 8ms
729
-
730
-  Test Files  146 passed (146)
731
-  Tests  1249 passed (1249)
732
-  Start at  17:40:10
733
-  Duration  44.28s (transform 11.16s, setup 0ms, import 40.72s, tests 15.63s, environment 52.62s)
694
+ ✓  node  test/server/webops-api.test.ts (9 tests) 12ms
695
+ ✓  node  test/sdk/orderEntry/useOrderFormItems.test.ts (7 tests) 39ms
696
+ ✓  node  test/components/account/orders/StatusCard.test.ts (3 tests) 28ms
697
+ ✓  node  test/sdk/localization/store-url.test.ts (4 tests) 5ms
698
+ ✓  node  test/sdk/deliveryPromise/queries.test.ts (4 tests) 10ms
699
+ ✓  node  test/sdk/cart/waitForSessionValidated.test.ts (5 tests) 13ms
700
+ ✓  node  test/server/cms/global.test.ts (3 tests) 6ms
701
+ ✓  node  test/sdk/deliveryPromise/provider.test.ts (11 tests) 10ms
702
+ ✓  node  test/sdk/auth/useAuth.test.ts (5 tests) 37ms
703
+ stderr | test/server/storeDirectives.test.ts > store directives through the core server > applies @auth from a store field and validates the session once
704
+ https://storeframework.vtexcommercestable.com.br/api/vtexid/credential/validate {
705
+ headers: { 'content-type': 'application/json', 'X-FORWARDED-HOST': '' },
706
+ body: '[redacted]',
707
+ method: 'POST'
708
+ } { status: 401, statusText: 'Unauthorized', headers: {} }
709
+
710
+ ✓  node  test/server/storeDirectives.test.ts (2 tests) 78ms
711
+ ✓  node  test/utils/getRequestHostname.test.ts (12 tests) 8ms
712
+ ✓  node  test/server/rootSpan.test.ts (4 tests) 73ms
713
+ ✓  node  test/pages/api/preview.test.ts (2 tests) 10ms
714
+ ✓  node  test/components/search/SearchInput.test.ts (6 tests) 9ms
715
+ ✓  node  test/utils/validateSessionRefreshToken.test.ts (6 tests) 5ms
716
+ ✓  node  test/components/account/Layout.test.tsx (6 tests) 64ms
717
+ ✓  node  test/pages/pvt/account/403.test.ts (5 tests) 8ms
718
+ ✓  node  test/components/region/useRegion.test.ts (1 test) 29ms
719
+ ✓  node  test/sdk/recommendations/vrn.test.ts (5 tests) 5ms
720
+ ✓  node  test/utils/retry.test.ts (5 tests) 15ms
721
+ ✓  node  test/sdk/account/getIsB2BBuyer.test.ts (7 tests) 7ms
722
+ ✓  node  test/sdk/account/getB2BSessionClaims.test.ts (4 tests) 6ms
723
+ ✓  node  test/sdk/recommendations/useRecommendationUserId.test.ts (4 tests) 189ms
724
+ ✓  node  test/utils/userOrderStatus.test.ts (4 tests) 6ms
725
+ ✓  node  test/utils/unlockResponse.test.ts (11 tests) 5ms
726
+ ✓  node  test/sdk/recommendations/useRecommendations.test.ts (2 tests) 6ms
727
+ ✓  node  test/components/account/OrganizationDrawerBody.test.tsx (3 tests) 60ms
728
+ ✓  node  test/sdk/deliveryPromise/reducer.test.ts (2 tests) 6ms
729
+ ✓  node  test/components/quotes/MyAccountQuoteStatusBadge.test.tsx (4 tests) 37ms
730
+ ✓  node  test/utils/isLocalHost.test.ts (7 tests) 6ms
731
+ ✓  node  test/sdk/session/toSessionInput.test.ts (3 tests) 5ms
732
+ ✓  node  test/components/account/orders/getOrderTotalLabel.test.ts (6 tests) 5ms
733
+ ✓  node  test/components/account/orders/listOrdersLabels.test.ts (2 tests) 4ms
734
+ ✓  node  test/components/auth/ProfileChallenge.test.tsx (3 tests) 43ms
735
+ ✓  node  test/utils/getCookie.test.ts (4 tests) 6ms
736
+ ✓  node  test/sdk/session/isSignInAreaResolved.test.ts (3 tests) 4ms
737
+ ✓  node  test/utils/filterChannel.test.ts (2 tests) 5ms
738
+ ✓  node  test/sdk/analytics/utils.test.ts (2 tests) 4ms
739
+ ✓  node  test/instrumentation.test.ts (3 tests) 5ms
740
+ ✓  node  test/components/account/orders/orderDetailsLabels.test.ts (1 test) 4ms
741
+ ✓  node  test/sdk/account/clearPersistedSessionState.test.ts (1 test) 11ms
742
+
743
+  Test Files  147 passed (147)
744
+  Tests  1251 passed (1251)
745
+  Start at  20:07:28
746
+  Duration  69.43s (transform 15.82s, setup 0ms, import 62.32s, tests 23.42s, environment 84.69s)
734
747
 
@@ -56,7 +56,6 @@ export type Scalars = {
56
56
  */
57
57
  FormattedVariants: { input: any; output: any; }
58
58
  JSONObject: { input: any; output: any; }
59
- /** A string or the string representation of an object (a stringified object). */
60
59
  ObjectOrString: { input: any; output: any; }
61
60
  /**
62
61
  * Example:
@@ -691,9 +691,6 @@ type Mutation {
691
691
  startRecommendationSession: Boolean!
692
692
  }
693
693
 
694
- """
695
- A string or the string representation of an object (a stringified object).
696
- """
697
694
  scalar ObjectOrString
698
695
 
699
696
  """Newsletter information."""
package/CHANGELOG.md CHANGED
@@ -3,10 +3,46 @@
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
- ## [4.11.1](https://github.com/vtex/faststore/compare/v4.11.0...v4.11.1) (2026-11-05)
6
+ ## [4.11.2-dev.1](https://github.com/vtex/faststore/compare/v4.11.2-dev.0...v4.11.2-dev.1) (2026-11-05)
7
+
8
+ **Note:** Version bump only for package @faststore/core
9
+
10
+ ## [4.11.2-dev.0](https://github.com/vtex/faststore/compare/v4.11.1...v4.11.2-dev.0) (2026-11-05)
11
+
12
+ ## [4.11.1-dev.1](https://github.com/vtex/faststore/compare/v4.11.1-dev.0...v4.11.1-dev.1) (2026-11-04)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **api:** apply [@auth](https://github.com/auth) and [@cache](https://github.com/cache)Control to store schema extensions ([#3524](https://github.com/vtex/faststore/issues/3524)) ([f6abd0d](https://github.com/vtex/faststore/commit/f6abd0d4f7312794a4195ce693526b539550275e)), closes [#3111](https://github.com/vtex/faststore/issues/3111) [/github.com/vtex/faststore/pull/3524#issuecomment-6258456970](https://github.com//github.com/vtex/faststore/pull/3524/issues/issuecomment-6258456970) [#3111](https://github.com/vtex/faststore/issues/3111) [#3063](https://github.com/vtex/faststore/issues/3063)
17
+
18
+ ## [4.11.1-dev.0](https://github.com/vtex/faststore/compare/v4.11.0...v4.11.1-dev.0) (2026-11-03)
19
+
20
+ ## [4.10.3-dev.1](https://github.com/vtex/faststore/compare/v4.10.3-dev.0...v4.10.3-dev.1) (2026-10-29)
21
+
22
+ ## [4.10.3-dev.0](https://github.com/vtex/faststore/compare/v4.10.2...v4.10.3-dev.0) (2026-10-29)
23
+
24
+ ## [4.11.1-dev.1](https://github.com/vtex/faststore/compare/v4.11.1-dev.0...v4.11.1-dev.1) (2026-11-04)
25
+
26
+ ### Bug Fixes
27
+
28
+ - **api:** apply [@auth](https://github.com/auth) and [@cache](https://github.com/cache)Control to store schema extensions ([#3524](https://github.com/vtex/faststore/issues/3524)) ([f6abd0d](https://github.com/vtex/faststore/commit/f6abd0d4f7312794a4195ce693526b539550275e)), closes [#3111](https://github.com/vtex/faststore/issues/3111) [/github.com/vtex/faststore/pull/3524#issuecomment-6258456970](https://github.com//github.com/vtex/faststore/pull/3524/issues/issuecomment-6258456970) [#3111](https://github.com/vtex/faststore/issues/3111) [#3063](https://github.com/vtex/faststore/issues/3063)
29
+
30
+ ## [4.11.1-dev.0](https://github.com/vtex/faststore/compare/v4.11.0...v4.11.1-dev.0) (2026-11-03)
31
+
32
+ ## [4.10.3-dev.1](https://github.com/vtex/faststore/compare/v4.10.3-dev.0...v4.10.3-dev.1) (2026-10-29)
33
+
34
+ ## [4.10.3-dev.0](https://github.com/vtex/faststore/compare/v4.10.2...v4.10.3-dev.0) (2026-10-29)
7
35
 
8
36
  **Note:** Version bump only for package @faststore/core
9
37
 
38
+ ## [4.10.3-dev.1](https://github.com/vtex/faststore/compare/v4.10.3-dev.0...v4.10.3-dev.1) (2026-10-29)
39
+
40
+ **Note:** Version bump only for package @faststore/core
41
+
42
+ ## [4.10.3-dev.0](https://github.com/vtex/faststore/compare/v4.10.2...v4.10.3-dev.0) (2026-10-29)
43
+
44
+ ## [4.11.1](https://github.com/vtex/faststore/compare/v4.11.0...v4.11.1) (2026-11-05)
45
+
10
46
  # [4.11.0](https://github.com/vtex/faststore/compare/v4.10.3...v4.11.0) (2026-11-03)
11
47
 
12
48
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faststore/core",
3
- "version": "4.11.1",
3
+ "version": "4.11.2-dev.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "./experimental/server": "./src/experimental/server/index.ts"
16
16
  },
17
17
  "engines": {
18
- "node": ">=20"
18
+ "node": ">=20.9.0"
19
19
  },
20
20
  "publishConfig": {
21
21
  "access": "public"
@@ -60,22 +60,21 @@
60
60
  "isomorphic-unfetch": "^3.1.0",
61
61
  "jose": "^6.2.3",
62
62
  "lexical": "^0.34.0",
63
- "next": "^16.2.6",
63
+ "next": "^16.4.3",
64
64
  "next-seo": "^6.6.0",
65
65
  "postcss": "^8.4.4",
66
66
  "prettier": "^2.2.0",
67
67
  "react-intersection-observer": "^8.32.5",
68
68
  "sass": "^1.97.0",
69
69
  "sass-loader": "^12.6.0",
70
- "sharp": "^0.32.6",
71
70
  "style-loader": "^3.3.1",
72
71
  "swr": "^2.2.5",
73
72
  "use-sync-external-store": "^1.6.0",
74
- "@faststore/api": "4.11.1",
75
- "@faststore/lighthouse": "4.11.1",
76
- "@faststore/diagnostics": "4.11.1",
77
- "@faststore/sdk": "4.11.1",
78
- "@faststore/ui": "4.11.1"
73
+ "@faststore/lighthouse": "4.11.2-dev.1",
74
+ "@faststore/ui": "4.11.2-dev.1",
75
+ "@faststore/sdk": "4.11.2-dev.1",
76
+ "@faststore/api": "4.11.2-dev.1",
77
+ "@faststore/diagnostics": "4.11.2-dev.1"
79
78
  },
80
79
  "devDependencies": {
81
80
  "@cypress/code-coverage": "^3.12.1",
@@ -15,6 +15,7 @@ import {
15
15
  GraphqlVtexContextFactory,
16
16
  GraphqlVtexSchema,
17
17
  isFastStoreError,
18
+ platformTypeDefs,
18
19
  } from '@faststore/api'
19
20
  import { OTELAPI } from '@faststore/diagnostics'
20
21
  import { loadFilesSync } from '@graphql-tools/load-files'
@@ -57,10 +58,11 @@ function loadGeneratedSchema(): TypeSource {
57
58
  }
58
59
 
59
60
  export function getFinalAPISchema() {
60
- const finalTypeDefs = mergeTypeDefs([
61
- GraphqlVtexSchema(),
62
- loadGeneratedSchema(),
63
- ])
61
+ // `platformTypeDefs` is the native SDL plus the directive definitions.
62
+ // Building `GraphqlVtexSchema()` here would run the transformers and throw
63
+ // the result away: this value is only merged as type definitions, and the
64
+ // call below applies the transformers once.
65
+ const finalTypeDefs = mergeTypeDefs([platformTypeDefs, loadGeneratedSchema()])
64
66
 
65
67
  const schema = makeExecutableSchema({
66
68
  typeDefs: finalTypeDefs,
@@ -0,0 +1,89 @@
1
+ import { stringifyCacheControl } from '@faststore/api'
2
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
3
+
4
+ import { execute } from '../../src/server'
5
+
6
+ const probeResolvers = vi.hoisted(() => ({
7
+ Query: {
8
+ probeAuth: vi.fn(() => 'auth-ok'),
9
+ probeCache: vi.fn(() => 'cache-ok'),
10
+ },
11
+ }))
12
+
13
+ const fetchMock = vi.hoisted(() => vi.fn())
14
+
15
+ vi.mock('../../src/customizations/src/graphql/thirdParty/resolvers', () => ({
16
+ default: probeResolvers,
17
+ }))
18
+
19
+ vi.mock('isomorphic-unfetch', () => ({
20
+ default: (...args: unknown[]) => fetchMock(...args),
21
+ }))
22
+
23
+ vi.mock('@graphql-tools/load-files', () => ({
24
+ loadFilesSync: () => [
25
+ /* GraphQL */ `
26
+ extend type Query {
27
+ probeAuth: String @auth
28
+ probeCache: String
29
+ @cacheControl(scope: "private", sMaxAge: 7, staleWhileRevalidate: 11)
30
+ }
31
+ `,
32
+ ],
33
+ }))
34
+
35
+ const operation = (operationName: string, query: string) => ({
36
+ variables: {},
37
+ query,
38
+ operation: {
39
+ __meta__: { operationName, operationHash: operationName },
40
+ },
41
+ })
42
+
43
+ describe('store directives through the core server', () => {
44
+ beforeEach(() => {
45
+ probeResolvers.Query.probeAuth.mockClear()
46
+ probeResolvers.Query.probeCache.mockClear()
47
+ fetchMock.mockReset()
48
+ fetchMock.mockResolvedValue({
49
+ ok: false,
50
+ status: 401,
51
+ statusText: 'Unauthorized',
52
+ headers: new Headers(),
53
+ text: async () => 'unauthorized',
54
+ json: async () => ({}),
55
+ })
56
+ })
57
+
58
+ it('applies @cacheControl from a store field to the response extensions', async () => {
59
+ const result = await execute(
60
+ operation('ProbeCacheQuery', 'query ProbeCacheQuery { probeCache }')
61
+ )
62
+
63
+ expect(result.errors).toBeUndefined()
64
+ expect(result.data).toEqual({ probeCache: 'cache-ok' })
65
+ expect(result.extensions.cacheControl).toEqual({
66
+ scope: 'private',
67
+ sMaxAge: 7,
68
+ staleWhileRevalidate: 11,
69
+ })
70
+ expect(
71
+ stringifyCacheControl(result.extensions.cacheControl ?? {}, false)
72
+ ).toBe('private, s-maxage=7, stale-while-revalidate=11')
73
+ })
74
+
75
+ it('applies @auth from a store field and validates the session once', async () => {
76
+ const result = await execute(
77
+ operation('ProbeAuthQuery', 'query ProbeAuthQuery { probeAuth }')
78
+ )
79
+
80
+ expect(result.data).toEqual({ probeAuth: null })
81
+ expect(result.errors?.length).toBeGreaterThan(0)
82
+ expect(probeResolvers.Query.probeAuth).not.toHaveBeenCalled()
83
+ expect(
84
+ fetchMock.mock.calls.filter(([url]) =>
85
+ String(url).includes('/api/vtexid/credential/validate')
86
+ )
87
+ ).toHaveLength(1)
88
+ })
89
+ })