@scayle/storefront-nuxt 7.85.7 → 7.85.9
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 +5 -15
- package/dist/index.d.ts +5 -15
- package/dist/index.mjs +2 -16
- package/dist/module.d.mts +4 -4
- package/dist/module.d.ts +4 -4
- package/dist/module.mjs +5 -25
- package/dist/rpc.d.mts +1 -16
- package/dist/rpc.d.ts +1 -16
- package/dist/rpc.mjs +1 -20
- package/dist/runtime/api/rpcHandler.d.ts +55 -1
- package/dist/runtime/api/rpcHandler.mjs +1 -1
- package/dist/runtime/composables/core/useAvailableShops.d.ts +1 -1
- package/dist/runtime/composables/core/useRpc.d.ts +3 -3
- package/dist/runtime/composables/storefront/useFacet.d.ts +28 -24
- package/dist/runtime/composables/storefront/useOrder.d.ts +15 -14
- package/dist/runtime/composables/storefront/useOrder.mjs +4 -20
- package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +15 -14
- package/dist/runtime/composables/storefront/useOrderConfirmation.mjs +1 -19
- package/dist/runtime/composables/storefront/useSearch.d.ts +3 -3
- package/dist/runtime/composables/storefront/useStorefrontSearch.d.ts +2 -2
- package/dist/runtime/context.mjs +1 -1
- package/dist/runtime/error/handler.d.ts +1 -1
- package/dist/runtime/nitro/plugins/cacheRuntimeConfig.d.ts +1 -1
- package/dist/runtime/nitro/plugins/cacheRuntimeConfig.mjs +2 -1
- package/dist/runtime/nitro/plugins/configValidation.d.ts +8 -3
- package/dist/runtime/nitro/plugins/configValidation.mjs +7 -5
- package/dist/runtime/nitro/plugins/nitroLogger.d.ts +1 -1
- package/dist/runtime/nitro/plugins/nitroLogger.mjs +2 -1
- package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.d.ts +1 -1
- package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.mjs +7 -5
- package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.d.ts +1 -1
- package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.mjs +1 -1
- package/dist/runtime/server/middleware/bootstrap.mjs +1 -1
- package/dist/runtime/server/middleware/bootstrap.utils.d.ts +6 -2
- package/dist/runtime/server/middleware/bootstrap.utils.mjs +2 -2
- package/dist/runtime/server/tsconfig.json +1 -1
- package/dist/runtime/utils/zodSchema.d.ts +261 -153
- package/dist/runtime/utils/zodSchema.mjs +16 -7
- package/dist/shared/storefront-nuxt.77c99ba5.d.mts +102 -0
- package/dist/shared/storefront-nuxt.77c99ba5.d.ts +102 -0
- package/package.json +13 -13
- package/dist/module.json +0 -8
- package/dist/shared/storefront-nuxt.891170da.d.mts +0 -1205
- package/dist/shared/storefront-nuxt.891170da.d.ts +0 -1205
- package/dist/types.d.mts +0 -14
- package/dist/types.d.ts +0 -14
package/dist/runtime/context.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
generateBasketKey,
|
|
9
9
|
generateWishlistKey
|
|
10
10
|
} from "@scayle/storefront-core/dist/utils/keys";
|
|
11
|
-
import { useNitroApp } from "
|
|
11
|
+
import { useNitroApp } from "nitropack/runtime";
|
|
12
12
|
import { fetchCampaignKey } from "./campaignKey.mjs";
|
|
13
13
|
async function getWishlistKey(appKeys, session, $log, $shopConfig) {
|
|
14
14
|
return session.data.user ? await generateWishlistKey({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const resolveError: (error: Error | unknown) => {
|
|
2
|
-
statusCode: 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 506 | 507 | 508 | 510 | 511
|
|
2
|
+
statusCode: 100 | 101 | 102 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 426 | 428 | 429 | 431 | 451 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
|
|
3
3
|
statusMessage: string;
|
|
4
4
|
name: string;
|
|
5
5
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineNitroPlugin
|
|
1
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
3
|
export default defineNitroPlugin((nitroApp) => {
|
|
3
4
|
const runtimeConfig = useRuntimeConfig();
|
|
4
5
|
nitroApp.hooks.hook("request", (event) => {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { RuntimeConfig } from '@nuxt/schema';
|
|
2
2
|
import type { ZodIssue } from 'zod';
|
|
3
3
|
export declare const sensitiveKeys: string[];
|
|
4
|
-
export declare const getValue: (object:
|
|
5
|
-
export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) =>
|
|
6
|
-
|
|
4
|
+
export declare const getValue: (object: Record<string | number, unknown>, pathArray: (string | number)[]) => string;
|
|
5
|
+
export declare const formatZodError: (issues: Array<ZodIssue>, runtimeConfig: RuntimeConfig) => (ZodIssue | {
|
|
6
|
+
code: string;
|
|
7
|
+
path: string;
|
|
8
|
+
message: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
})[];
|
|
11
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
7
12
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineNitroPlugin
|
|
1
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
3
|
import { RuntimeConfigSchema } from "../../utils/zodSchema.mjs";
|
|
3
4
|
import { purifySensitiveValue } from "@scayle/storefront-core";
|
|
4
5
|
export const sensitiveKeys = [
|
|
@@ -9,9 +10,10 @@ export const sensitiveKeys = [
|
|
|
9
10
|
"secret"
|
|
10
11
|
];
|
|
11
12
|
export const getValue = (object, pathArray) => {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
return JSON.stringify(pathArray.reduce(
|
|
14
|
+
(acc, key) => typeof acc === "object" ? acc[key] : void 0,
|
|
15
|
+
object
|
|
16
|
+
));
|
|
15
17
|
};
|
|
16
18
|
export const formatZodError = (issues, runtimeConfig) => {
|
|
17
19
|
const errorMessages = [];
|
|
@@ -22,7 +24,7 @@ export const formatZodError = (issues, runtimeConfig) => {
|
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
26
|
const key = issue.path[issue.path.length - 1];
|
|
25
|
-
let value;
|
|
27
|
+
let value = "";
|
|
26
28
|
if (sensitiveKeys.includes(key)) {
|
|
27
29
|
value = purifySensitiveValue(getValue(runtimeConfig, issue.path), true);
|
|
28
30
|
} else if (issue.code !== "too_small") {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createConsola } from "consola";
|
|
2
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
3
|
+
import { useRuntimeConfig } from "#imports";
|
|
2
4
|
import createLog from "../../createLog.mjs";
|
|
3
|
-
import { defineNitroPlugin, useRuntimeConfig } from "#imports";
|
|
4
5
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
6
|
const config = useRuntimeConfig();
|
|
6
7
|
const logConfig = config.public.storefront.log;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
} from "../../server/utils/cacheStorage.mjs";
|
|
6
6
|
import createLog from "../../createLog.mjs";
|
|
7
7
|
import drivers from "#virtual/storage-drivers";
|
|
8
|
-
import { defineNitroPlugin
|
|
8
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
9
|
+
import { useStorage } from "nitropack/runtime/storage";
|
|
10
|
+
import { useRuntimeConfig } from "#imports";
|
|
9
11
|
function createMountDriver(options) {
|
|
10
12
|
if (options?.driver) {
|
|
11
13
|
const compression = options?.compression;
|
|
@@ -50,7 +52,7 @@ function getCacheConfig(config, log) {
|
|
|
50
52
|
log.error(
|
|
51
53
|
`Failed to initialize global cache storage configuration. Neither new 'storefront.storage.cache' option nor legacy 'storefront.cache.provider' is set.`
|
|
52
54
|
);
|
|
53
|
-
return
|
|
55
|
+
return void 0;
|
|
54
56
|
}
|
|
55
57
|
return transformLegacyConfig(
|
|
56
58
|
config.storefront.cache?.provider,
|
|
@@ -67,7 +69,7 @@ function getSessionConfig(config, log) {
|
|
|
67
69
|
log.error(
|
|
68
70
|
`Failed to initialize global session storage configuration. Neither new 'storefront.storage.session' option nor legacy 'storefront.session.provider' is set.`
|
|
69
71
|
);
|
|
70
|
-
return
|
|
72
|
+
return void 0;
|
|
71
73
|
}
|
|
72
74
|
return transformLegacyConfig(
|
|
73
75
|
config.storefront.session?.provider,
|
|
@@ -87,7 +89,7 @@ function getShopCacheConfig(config, shop, log) {
|
|
|
87
89
|
log.error(
|
|
88
90
|
`Failed to initialize shop ${shop.shopId} cache storage configuration. Neither new 'storefront.storage.session' option nor legacy 'storefront.session.provider' is set.`
|
|
89
91
|
);
|
|
90
|
-
return
|
|
92
|
+
return void 0;
|
|
91
93
|
}
|
|
92
94
|
return transformLegacyConfig(
|
|
93
95
|
cacheProvider,
|
|
@@ -108,7 +110,7 @@ function getShopSessionConfig(config, shop, log) {
|
|
|
108
110
|
log.error(
|
|
109
111
|
`Failed to initialize shop ${shop.shopId} session storage configuration. Neither new 'storefront.storage.session' option nor legacy 'storefront.session.provider' is set.`
|
|
110
112
|
);
|
|
111
|
-
return
|
|
113
|
+
return void 0;
|
|
112
114
|
}
|
|
113
115
|
return transformLegacyConfig(
|
|
114
116
|
sessionProvider,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type H3Event } from 'h3';
|
|
2
2
|
import type { ModuleBaseOptions, PublicShopConfig, ShopConfig, ShopConfigIndexed } from '../../../module';
|
|
3
|
-
import type {
|
|
3
|
+
import type { NitroRuntimeConfigApp } from 'nitropack';
|
|
4
4
|
type BootstrapPath = {
|
|
5
5
|
path: string;
|
|
6
6
|
originalPath: string;
|
|
@@ -9,7 +9,11 @@ export declare function getBootstrapPath(event: H3Event): BootstrapPath;
|
|
|
9
9
|
export declare const getShopByPath: (event: H3Event, shops: ShopConfig[], appBasePath: string) => ShopConfig | undefined;
|
|
10
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, storefrontConfig: ModuleBaseOptions,
|
|
12
|
+
export declare function getCurrentShopConfigForRequest(event: H3Event, storefrontConfig: Pick<Extract<ModuleBaseOptions, {
|
|
13
|
+
shops: ShopConfigIndexed;
|
|
14
|
+
}>, 'shops' | 'shopSelector'> | Pick<Extract<ModuleBaseOptions, {
|
|
15
|
+
stores: ShopConfigIndexed;
|
|
16
|
+
}>, 'stores' | 'shopSelector'>, runtimeConfig: NitroRuntimeConfigApp): ShopConfig | undefined;
|
|
13
17
|
export declare function getPublicShopData(data: ShopConfig, currentShopId: number, apiBasePath: string, publicShopData?: (keyof ShopConfig)[]): PublicShopConfig & {
|
|
14
18
|
isActive: boolean;
|
|
15
19
|
};
|
|
@@ -59,12 +59,12 @@ export function getCurrentShopConfigForRequest(event, storefrontConfig, runtimeC
|
|
|
59
59
|
} else if (shopSelector === "domain") {
|
|
60
60
|
$shopConfig = getShopByDomain(event, shopsList);
|
|
61
61
|
} else if (shopSelector === "path") {
|
|
62
|
-
$shopConfig = getShopByPath(event, shopsList, runtimeConfig.
|
|
62
|
+
$shopConfig = getShopByPath(event, shopsList, runtimeConfig.baseURL);
|
|
63
63
|
} else if (shopSelector === "path_or_default") {
|
|
64
64
|
$shopConfig = getShopByPathOrDefault(
|
|
65
65
|
event,
|
|
66
66
|
shopsList,
|
|
67
|
-
runtimeConfig.
|
|
67
|
+
runtimeConfig.baseURL
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
return $shopConfig;
|