@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.
- package/CHANGELOG.md +15 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/module.d.mts +2 -2
- package/dist/module.d.ts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +10 -10
- package/dist/rpc.d.mts +1 -1
- package/dist/rpc.d.ts +1 -1
- package/dist/runtime/api/cacheAuth.mjs +1 -0
- package/dist/runtime/composables/core/useIDP.mjs +2 -11
- package/dist/runtime/composables/core/useRpc.mjs +3 -1
- package/dist/runtime/composables/core/useSession.mjs +10 -17
- package/dist/runtime/composables/core/useUser.mjs +7 -14
- package/dist/runtime/composables/storefront/useBasket.mjs +11 -24
- package/dist/runtime/composables/storefront/useCategories.mjs +2 -10
- package/dist/runtime/composables/storefront/useCurrentPromotions.mjs +7 -1
- package/dist/runtime/composables/storefront/useSearch.mjs +3 -10
- package/dist/runtime/composables/storefront/useStorefrontSearch.mjs +5 -15
- package/dist/runtime/composables/storefront/useWishlist.mjs +9 -24
- package/dist/runtime/nitro/plugins/configValidation.d.ts +4 -0
- package/dist/runtime/nitro/plugins/configValidation.mjs +2 -2
- package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.mjs +2 -1
- package/dist/runtime/server/middleware/bootstrap.mjs +3 -1
- package/dist/runtime/server/middleware/bootstrap.utils.d.ts +2 -2
- package/dist/runtime/server/middleware/bootstrap.utils.mjs +9 -7
- package/dist/runtime/utils/zodSchema.d.ts +987 -148
- package/dist/runtime/utils/zodSchema.mjs +34 -10
- package/dist/shared/{storefront-nuxt.87331293.d.mts → storefront-nuxt.d852fe87.d.mts} +21 -7
- package/dist/shared/{storefront-nuxt.87331293.d.ts → storefront-nuxt.d852fe87.d.ts} +21 -7
- 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 = (
|
|
29
|
-
if (Array.isArray(
|
|
30
|
-
return
|
|
28
|
+
export const convertShopsToList = (shops) => {
|
|
29
|
+
if (Array.isArray(shops)) {
|
|
30
|
+
return shops;
|
|
31
31
|
}
|
|
32
|
-
return Object.values(
|
|
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,
|
|
49
|
+
export function getCurrentShopConfigForRequest(event, storefrontConfig, runtimeConfig) {
|
|
50
50
|
let $shopConfig;
|
|
51
|
-
const { shopSelector
|
|
52
|
-
const shopsList = convertShopsToList(
|
|
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) {
|