@scayle/storefront-nuxt 7.83.0 → 7.84.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.
- package/CHANGELOG.md +21 -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.d.ts +11 -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
|
@@ -112,7 +112,9 @@ async function bootstrap(event, $shopConfig, $storefrontConfig, apiBasePath, con
|
|
|
112
112
|
apiBasePath,
|
|
113
113
|
$storefrontConfig.publicShopData
|
|
114
114
|
);
|
|
115
|
-
event.context.$availableShops = convertShopsToList(
|
|
115
|
+
event.context.$availableShops = convertShopsToList(
|
|
116
|
+
"shops" in $storefrontConfig ? $storefrontConfig.shops : $storefrontConfig.stores
|
|
117
|
+
).filter((store) => store.isEnabled !== false).map(
|
|
116
118
|
(config2) => getPublicShopData(
|
|
117
119
|
config2,
|
|
118
120
|
$shopConfig.shopId,
|
|
@@ -7,9 +7,9 @@ type BootstrapPath = {
|
|
|
7
7
|
};
|
|
8
8
|
export declare function getBootstrapPath(event: H3Event): BootstrapPath;
|
|
9
9
|
export declare const getShopByPath: (event: H3Event, shops: ShopConfig[], appBasePath: string) => ShopConfig | undefined;
|
|
10
|
-
export declare const convertShopsToList: (
|
|
10
|
+
export declare const convertShopsToList: (shops: ShopConfig[] | ShopConfigIndexed) => ShopConfig[];
|
|
11
11
|
export declare function getApiBasePath(storefrontConfig: ModuleBaseOptions, shop: ShopConfig, baseUrl: string): string;
|
|
12
|
-
export declare function getCurrentShopConfigForRequest(event: H3Event,
|
|
12
|
+
export declare function getCurrentShopConfigForRequest(event: H3Event, storefrontConfig: ModuleBaseOptions, runtimeConfig: NitroRuntimeConfig): ShopConfig | undefined;
|
|
13
13
|
export declare function getPublicShopData(data: ShopConfig, currentShopId: number, apiBasePath: string, publicShopData?: (keyof ShopConfig)[]): PublicShopConfig & {
|
|
14
14
|
isActive: boolean;
|
|
15
15
|
};
|
|
@@ -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) {
|