@scayle/storefront-nuxt 7.83.0 → 7.84.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 (31) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/module.d.mts +2 -2
  5. package/dist/module.d.ts +2 -2
  6. package/dist/module.json +1 -1
  7. package/dist/module.mjs +10 -10
  8. package/dist/rpc.d.mts +1 -1
  9. package/dist/rpc.d.ts +1 -1
  10. package/dist/runtime/api/cacheAuth.mjs +1 -0
  11. package/dist/runtime/composables/core/useIDP.mjs +2 -11
  12. package/dist/runtime/composables/core/useRpc.mjs +3 -1
  13. package/dist/runtime/composables/core/useSession.mjs +10 -17
  14. package/dist/runtime/composables/core/useUser.mjs +7 -14
  15. package/dist/runtime/composables/storefront/useBasket.mjs +11 -24
  16. package/dist/runtime/composables/storefront/useCategories.mjs +2 -10
  17. package/dist/runtime/composables/storefront/useCurrentPromotions.mjs +7 -1
  18. package/dist/runtime/composables/storefront/useSearch.mjs +3 -10
  19. package/dist/runtime/composables/storefront/useStorefrontSearch.mjs +5 -15
  20. package/dist/runtime/composables/storefront/useWishlist.mjs +9 -24
  21. package/dist/runtime/nitro/plugins/configValidation.d.ts +4 -0
  22. package/dist/runtime/nitro/plugins/configValidation.mjs +2 -2
  23. package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.mjs +2 -1
  24. package/dist/runtime/server/middleware/bootstrap.mjs +3 -1
  25. package/dist/runtime/server/middleware/bootstrap.utils.d.ts +2 -2
  26. package/dist/runtime/server/middleware/bootstrap.utils.mjs +9 -7
  27. package/dist/runtime/utils/zodSchema.d.ts +987 -148
  28. package/dist/runtime/utils/zodSchema.mjs +34 -10
  29. package/dist/shared/{storefront-nuxt.87331293.d.mts → storefront-nuxt.d852fe87.d.mts} +21 -7
  30. package/dist/shared/{storefront-nuxt.87331293.d.ts → storefront-nuxt.d852fe87.d.ts} +21 -7
  31. package/package.json +11 -11
@@ -25,11 +25,11 @@ const getShopByPathOrDefault = (event, shops, appBasePath) => {
25
25
  const otherShops = shops.filter((shop) => !shop.isDefault);
26
26
  return getShopByPath(event, otherShops, appBasePath) ?? defaultShop;
27
27
  };
28
- export const convertShopsToList = (stores) => {
29
- if (Array.isArray(stores)) {
30
- return stores;
28
+ export const convertShopsToList = (shops) => {
29
+ if (Array.isArray(shops)) {
30
+ return shops;
31
31
  }
32
- return Object.values(stores);
32
+ return Object.values(shops);
33
33
  };
34
34
  export function getApiBasePath(storefrontConfig, shop, baseUrl) {
35
35
  const path = Array.isArray(shop.path) ? shop.path[0] : shop.path;
@@ -46,10 +46,12 @@ export function getApiBasePath(storefrontConfig, shop, baseUrl) {
46
46
  }
47
47
  return joinURL(baseUrl, apiPath);
48
48
  }
49
- export function getCurrentShopConfigForRequest(event, config, runtimeConfig) {
49
+ export function getCurrentShopConfigForRequest(event, storefrontConfig, runtimeConfig) {
50
50
  let $shopConfig;
51
- const { shopSelector, stores } = config;
52
- const shopsList = convertShopsToList(stores);
51
+ const { shopSelector } = storefrontConfig;
52
+ const shopsList = convertShopsToList(
53
+ "shops" in storefrontConfig ? storefrontConfig.shops : storefrontConfig.stores
54
+ );
53
55
  const headers = getRequestHeaders(event);
54
56
  const shopId = headers["x-shop-id"];
55
57
  if (shopId) {