@scayle/storefront-nuxt 7.85.8 → 7.85.10

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 (131) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/index.d.mts +5 -15
  3. package/dist/index.d.ts +5 -15
  4. package/dist/index.mjs +2 -16
  5. package/dist/module.d.mts +4 -4
  6. package/dist/module.d.ts +4 -4
  7. package/dist/module.json +5 -1
  8. package/dist/module.mjs +5 -25
  9. package/dist/rpc.d.mts +1 -16
  10. package/dist/rpc.d.ts +1 -16
  11. package/dist/rpc.mjs +1 -20
  12. package/dist/runtime/api/{purgeAll.mjs → purgeAll.js} +1 -1
  13. package/dist/runtime/api/{purgeTags.mjs → purgeTags.js} +1 -1
  14. package/dist/runtime/api/rpcHandler.d.ts +55 -1
  15. package/dist/runtime/api/{rpcHandler.mjs → rpcHandler.js} +3 -3
  16. package/dist/runtime/composables/core/useAvailableShops.d.ts +2 -2
  17. package/dist/runtime/composables/core/useCurrentShop.d.ts +1 -1
  18. package/dist/runtime/composables/core/{useFormatHelpers.mjs → useFormatHelpers.js} +1 -1
  19. package/dist/runtime/composables/core/useIDP.d.ts +1 -1
  20. package/dist/runtime/composables/core/{useIDP.mjs → useIDP.js} +3 -3
  21. package/dist/runtime/composables/core/{useRpc.mjs → useRpc.js} +3 -3
  22. package/dist/runtime/composables/core/{useRpcCall.mjs → useRpcCall.js} +2 -2
  23. package/dist/runtime/composables/core/{useSession.mjs → useSession.js} +1 -1
  24. package/dist/runtime/composables/core/useUser.d.ts +1 -1
  25. package/dist/runtime/composables/core/{useUser.mjs → useUser.js} +4 -4
  26. package/dist/runtime/composables/index.d.ts +36 -36
  27. package/dist/runtime/composables/index.js +36 -0
  28. package/dist/runtime/composables/storefront/useBasket.d.ts +1 -1
  29. package/dist/runtime/composables/storefront/{useBasket.mjs → useBasket.js} +3 -3
  30. package/dist/runtime/composables/storefront/useBrand.d.ts +1 -1
  31. package/dist/runtime/composables/storefront/{useBrand.mjs → useBrand.js} +1 -1
  32. package/dist/runtime/composables/storefront/useBrands.d.ts +1 -1
  33. package/dist/runtime/composables/storefront/{useBrands.mjs → useBrands.js} +1 -1
  34. package/dist/runtime/composables/storefront/useCategories.d.ts +1 -1
  35. package/dist/runtime/composables/storefront/{useCategories.mjs → useCategories.js} +3 -3
  36. package/dist/runtime/composables/storefront/useCategoryById.d.ts +1 -1
  37. package/dist/runtime/composables/storefront/{useCategoryById.mjs → useCategoryById.js} +1 -1
  38. package/dist/runtime/composables/storefront/useCategoryByPath.d.ts +1 -1
  39. package/dist/runtime/composables/storefront/{useCategoryByPath.mjs → useCategoryByPath.js} +1 -1
  40. package/dist/runtime/composables/storefront/useCurrentPromotions.d.ts +1 -1
  41. package/dist/runtime/composables/storefront/{useCurrentPromotions.mjs → useCurrentPromotions.js} +1 -1
  42. package/dist/runtime/composables/storefront/useFacet.d.ts +28 -24
  43. package/dist/runtime/composables/storefront/{useFacet.mjs → useFacet.js} +5 -5
  44. package/dist/runtime/composables/storefront/useFilters.d.ts +1 -1
  45. package/dist/runtime/composables/storefront/{useFilters.mjs → useFilters.js} +1 -1
  46. package/dist/runtime/composables/storefront/useNavigationTree.d.ts +1 -1
  47. package/dist/runtime/composables/storefront/{useNavigationTree.mjs → useNavigationTree.js} +1 -1
  48. package/dist/runtime/composables/storefront/useNavigationTrees.d.ts +1 -1
  49. package/dist/runtime/composables/storefront/{useNavigationTrees.mjs → useNavigationTrees.js} +1 -1
  50. package/dist/runtime/composables/storefront/useOrder.d.ts +1 -1
  51. package/dist/runtime/composables/storefront/{useOrder.mjs → useOrder.js} +1 -1
  52. package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +1 -1
  53. package/dist/runtime/composables/storefront/{useOrderConfirmation.mjs → useOrderConfirmation.js} +1 -1
  54. package/dist/runtime/composables/storefront/useProduct.d.ts +1 -1
  55. package/dist/runtime/composables/storefront/{useProduct.mjs → useProduct.js} +1 -1
  56. package/dist/runtime/composables/storefront/useProducts.d.ts +1 -1
  57. package/dist/runtime/composables/storefront/{useProducts.mjs → useProducts.js} +1 -1
  58. package/dist/runtime/composables/storefront/useProductsByIds.d.ts +1 -1
  59. package/dist/runtime/composables/storefront/{useProductsByIds.mjs → useProductsByIds.js} +1 -1
  60. package/dist/runtime/composables/storefront/useProductsByReferenceKeys.d.ts +1 -1
  61. package/dist/runtime/composables/storefront/{useProductsByReferenceKeys.mjs → useProductsByReferenceKeys.js} +1 -1
  62. package/dist/runtime/composables/storefront/useProductsCount.d.ts +1 -1
  63. package/dist/runtime/composables/storefront/{useProductsCount.mjs → useProductsCount.js} +1 -1
  64. package/dist/runtime/composables/storefront/usePromotions.d.ts +1 -1
  65. package/dist/runtime/composables/storefront/{usePromotions.mjs → usePromotions.js} +1 -1
  66. package/dist/runtime/composables/storefront/usePromotionsByIds.d.ts +1 -1
  67. package/dist/runtime/composables/storefront/{usePromotionsByIds.mjs → usePromotionsByIds.js} +1 -1
  68. package/dist/runtime/composables/storefront/{useQueryFilterState.mjs → useQueryFilterState.js} +1 -1
  69. package/dist/runtime/composables/storefront/useSearch.d.ts +3 -3
  70. package/dist/runtime/composables/storefront/{useSearch.mjs → useSearch.js} +1 -1
  71. package/dist/runtime/composables/storefront/useShopConfiguration.d.ts +1 -1
  72. package/dist/runtime/composables/storefront/{useShopConfiguration.mjs → useShopConfiguration.js} +1 -1
  73. package/dist/runtime/composables/storefront/useStorefrontSearch.d.ts +2 -2
  74. package/dist/runtime/composables/storefront/{useStorefrontSearch.mjs → useStorefrontSearch.js} +1 -1
  75. package/dist/runtime/composables/storefront/useUserAddresses.d.ts +1 -1
  76. package/dist/runtime/composables/storefront/{useUserAddresses.mjs → useUserAddresses.js} +1 -1
  77. package/dist/runtime/composables/storefront/useVariant.d.ts +1 -1
  78. package/dist/runtime/composables/storefront/{useVariant.mjs → useVariant.js} +1 -1
  79. package/dist/runtime/composables/storefront/useWishlist.d.ts +1 -1
  80. package/dist/runtime/composables/storefront/{useWishlist.mjs → useWishlist.js} +3 -3
  81. package/dist/runtime/composables/{useCoreLog.mjs → useCoreLog.js} +1 -1
  82. package/dist/runtime/context.d.ts +1 -1
  83. package/dist/runtime/{context.mjs → context.js} +2 -2
  84. package/dist/runtime/createLog.d.ts +2 -2
  85. package/dist/runtime/{createLog.mjs → createLog.js} +1 -1
  86. package/dist/runtime/error/handler.d.ts +1 -1
  87. package/dist/runtime/nitro/plugins/cacheRuntimeConfig.d.ts +1 -1
  88. package/dist/runtime/nitro/plugins/{cacheRuntimeConfig.mjs → cacheRuntimeConfig.js} +2 -1
  89. package/dist/runtime/nitro/plugins/configValidation.d.ts +8 -3
  90. package/dist/runtime/nitro/plugins/{configValidation.mjs → configValidation.js} +8 -6
  91. package/dist/runtime/nitro/plugins/nitroLogger.d.ts +1 -1
  92. package/dist/runtime/nitro/plugins/{nitroLogger.mjs → nitroLogger.js} +3 -2
  93. package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.d.ts +1 -1
  94. package/dist/runtime/nitro/plugins/{nitroRuntimeStorageConfig.mjs → nitroRuntimeStorageConfig.js} +9 -7
  95. package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.d.ts +1 -1
  96. package/dist/runtime/nitro/plugins/{nitroSetXPoweredByHeader.mjs → nitroSetXPoweredByHeader.js} +1 -1
  97. package/dist/runtime/plugin/{log.client.mjs → log.client.js} +1 -1
  98. package/dist/runtime/plugin/{shop.mjs → shop.js} +2 -2
  99. package/dist/runtime/rpc/rpcCall.d.ts +1 -1
  100. package/dist/runtime/server/middleware/{bootstrap.utils.d.ts → bootstrap-utils.d.ts} +7 -3
  101. package/dist/runtime/server/middleware/{bootstrap.utils.mjs → bootstrap-utils.js} +2 -2
  102. package/dist/runtime/server/middleware/bootstrap.d.ts +1 -1
  103. package/dist/runtime/server/middleware/{bootstrap.mjs → bootstrap.js} +5 -5
  104. package/dist/runtime/server/middleware/{redirects.mjs → redirects.js} +1 -1
  105. package/dist/runtime/server/tsconfig.json +1 -1
  106. package/dist/runtime/server/utils/cacheStorage.d.ts +1 -1
  107. package/dist/runtime/utils/zodSchema.d.ts +261 -153
  108. package/dist/runtime/utils/{zodSchema.mjs → zodSchema.js} +16 -7
  109. package/dist/shared/storefront-nuxt.80aa5060.d.mts +102 -0
  110. package/dist/shared/storefront-nuxt.80aa5060.d.ts +102 -0
  111. package/dist/types.d.mts +48 -0
  112. package/dist/types.d.ts +48 -0
  113. package/package.json +15 -13
  114. package/dist/runtime/composables/index.mjs +0 -36
  115. package/dist/shared/storefront-nuxt.891170da.d.mts +0 -1205
  116. package/dist/shared/storefront-nuxt.891170da.d.ts +0 -1205
  117. /package/dist/runtime/api/{cacheAuth.mjs → cacheAuth.js} +0 -0
  118. /package/dist/runtime/api/{up.mjs → up.js} +0 -0
  119. /package/dist/runtime/{campaignKey.mjs → campaignKey.js} +0 -0
  120. /package/dist/runtime/composables/core/{useAvailableShops.mjs → useAvailableShops.js} +0 -0
  121. /package/dist/runtime/composables/core/{useCurrentShop.mjs → useCurrentShop.js} +0 -0
  122. /package/dist/runtime/composables/core/{useLog.mjs → useLog.js} +0 -0
  123. /package/dist/runtime/error/{handler.mjs → handler.js} +0 -0
  124. /package/dist/runtime/{handler.mjs → handler.js} +0 -0
  125. /package/dist/runtime/{log.mjs → log.js} +0 -0
  126. /package/dist/runtime/plugin/{log.server.mjs → log.server.js} +0 -0
  127. /package/dist/runtime/rpc/{rpcCall.mjs → rpcCall.js} +0 -0
  128. /package/dist/runtime/server/middleware/{redirects.utils.mjs → redirects.utils.js} +0 -0
  129. /package/dist/runtime/server/utils/{cacheStorage.mjs → cacheStorage.js} +0 -0
  130. /package/dist/runtime/utils/{promise.mjs → promise.js} +0 -0
  131. /package/dist/runtime/utils/{route.mjs → route.js} +0 -0
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { HashAlgorithm } from "@scayle/storefront-core";
3
2
  import { builtinDrivers } from "unstorage";
4
3
  export const RedirectsSchema = z.object({
5
4
  enabled: z.boolean(),
@@ -39,7 +38,12 @@ const SessionSchema = z.object({
39
38
  /**
40
39
  * Controls the domain option on the session cookie
41
40
  */
42
- domain: z.string().optional()
41
+ domain: z.string().optional(),
42
+ /**
43
+ * The provider to use for the persistent storage.
44
+ * @deprecated Storefront Core is now relying on a unified cache configuration. Use the storage option instead.
45
+ */
46
+ provider: z.enum(["redis", "memory"]).optional()
43
47
  });
44
48
  const SapiSchema = z.object({
45
49
  host: z.string().url(),
@@ -68,12 +72,11 @@ const StorageSchema = z.object({
68
72
  tls: z.boolean().optional(),
69
73
  ttl: z.number().optional()
70
74
  });
71
- const hashValues = Object.values(HashAlgorithm);
72
75
  const AppKeysSchema = z.object(
73
76
  {
74
77
  wishlistKey: z.string(),
75
78
  basketKey: z.string(),
76
- hashAlgorithm: z.enum(hashValues)
79
+ hashAlgorithm: z.enum(["md5", "sha256", "none"])
77
80
  }
78
81
  );
79
82
  const CheckoutShopConfigSchema = z.object({
@@ -81,7 +84,8 @@ const CheckoutShopConfigSchema = z.object({
81
84
  secret: z.string().min(1),
82
85
  host: z.string().url(),
83
86
  user: z.string().or(z.number()),
84
- cbdExpiration: z.number().optional()
87
+ cbdExpiration: z.number().optional(),
88
+ shopId: z.number().optional()
85
89
  });
86
90
  const emptyString = z.string().refine((val) => val === "", {
87
91
  message: "Expected boolean, received string"
@@ -120,8 +124,13 @@ const CacheSchema = z.object({
120
124
  auth: z.object({
121
125
  username: z.string(),
122
126
  password: z.string()
123
- }),
124
- enabled: z.boolean().optional()
127
+ }).optional(),
128
+ enabled: z.boolean().optional(),
129
+ /**
130
+ * The provider to use for the persistent storage.
131
+ * @deprecated Storefront Core is now relying on a unified cache configuration. Use the storage option instead.
132
+ */
133
+ provider: z.enum(["redis", "memory"]).optional()
125
134
  });
126
135
  const ShopSelectorSchema = z.enum(["path", "domain", "path_or_default"]);
127
136
  const StorefrontConfigSchema = z.intersection(
@@ -0,0 +1,102 @@
1
+ import { StorefrontHooks, RpcContext, RpcMethodName, HashAlgorithm, WithParams, rpcMethods, ShopUser } from '@scayle/storefront-core';
2
+ import { CompressionEncodings } from '@scayle/unstorage-compression-driver';
3
+ import { BuiltinDriverName, BuiltinDriverOptions } from 'unstorage';
4
+ import { CheckoutShopConfigType, SessionType, RedisConfigType, StorageType, SapiConfigType, ShopConfigType, IdpType, StorefrontConfigType, ModulePublicRuntimeConfigType, ShopSelectorType, RedirectType } from '../../dist/runtime/utils/zodSchema.js';
5
+ import { HookResult } from '@nuxt/schema';
6
+
7
+ type StorageProvider = 'memory' | 'redis';
8
+ type CheckoutShopConfig = CheckoutShopConfigType;
9
+ /**
10
+ * Options to configure how the storefront core manages sessions
11
+ */
12
+ type SessionConfig = SessionType & {
13
+ /**
14
+ * The provider to use for the persistent storage.
15
+ * @deprecated Storefront Core is now relying on a unified cache configuration. Use the storage option instead.
16
+ */
17
+ provider?: StorageProvider;
18
+ };
19
+ /**
20
+ * @deprecated
21
+ */
22
+ type RedisConfig = RedisConfigType;
23
+ type CustomDriverName = string & {
24
+ _custom?: unknown;
25
+ };
26
+ type StorageEntity<Driver extends BuiltinDriverName | CustomDriverName | unknown = unknown, DriverOptions = Driver extends keyof BuiltinDriverOptions ? BuiltinDriverOptions[Driver] : unknown> = {
27
+ driver: Driver;
28
+ compression?: CompressionEncodings;
29
+ } & DriverOptions;
30
+ interface StorageConfig {
31
+ cache?: StorageType;
32
+ session?: StorageType;
33
+ }
34
+ /**
35
+ * @deprecated Use {@link SapiConfig} instead
36
+ */
37
+ type BapiConfig = SapiConfigType;
38
+ type SapiConfig = SapiConfigType;
39
+ interface AppKeys {
40
+ wishlistKey: string;
41
+ basketKey: string;
42
+ hashAlgorithm: HashAlgorithm;
43
+ }
44
+ interface AdditionalShopConfig {
45
+ }
46
+ type ShopConfig = ShopConfigType & AdditionalShopConfig;
47
+ type ShopConfigIndexed = Record<string, ShopConfig>;
48
+ interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'locale' | 'currency' | 'currencyFractionDigits'> {
49
+ checkout: Pick<CheckoutShopConfig, 'host'>;
50
+ apiBasePath: string;
51
+ idp?: IdpType;
52
+ path?: string;
53
+ }
54
+ type StorefrontConfig = StorefrontConfigType & {
55
+ withParams?: WithParams;
56
+ };
57
+ type ModuleOption = {
58
+ shopSelector: ShopSelectorType;
59
+ redirects?: RedirectType;
60
+ } & ({
61
+ /**
62
+ * @deprecated stores got renamed. Use {@link ModuleOption.shops} instead
63
+ */
64
+ stores: ShopConfigIndexed;
65
+ } | {
66
+ shops: ShopConfigIndexed;
67
+ });
68
+ type ModuleBaseOptions = StorefrontConfig & ModuleOption & {
69
+ rpcDir?: string;
70
+ rpcMethodNames?: string[];
71
+ rpcMethodOverrides?: Array<keyof typeof rpcMethods>;
72
+ };
73
+ interface CheckoutEvent {
74
+ action?: 'authenticated';
75
+ type?: 'tracking';
76
+ user: ShopUser;
77
+ accessToken: string;
78
+ event?: {
79
+ event: 'login' | 'add_to_cart' | 'remove_from_cart';
80
+ status: 'successful' | 'error';
81
+ };
82
+ }
83
+ interface ModulePublicRuntimeConfig extends ModulePublicRuntimeConfigType {
84
+ }
85
+ declare module '@nuxt/schema' {
86
+ interface RuntimeConfig {
87
+ storefront: ModuleBaseOptions;
88
+ }
89
+ interface PublicRuntimeConfig {
90
+ storefront: ModulePublicRuntimeConfig;
91
+ }
92
+ }
93
+ declare module 'nitropack' {
94
+ interface NitroRuntimeHooks extends StorefrontHooks {
95
+ 'storefront:context:created': (context: RpcContext) => HookResult;
96
+ 'storefront:rpc:before': (rpcName: RpcMethodName, context: RpcContext, payload: unknown) => HookResult;
97
+ 'storefront:rpc:after': (rpcName: RpcMethodName, context: RpcContext, result: unknown) => HookResult;
98
+ 'storefront:rpc:error': (rpcName: RpcMethodName, context: RpcContext, error: unknown) => HookResult;
99
+ }
100
+ }
101
+
102
+ export type { AppKeys as A, BapiConfig as B, CheckoutShopConfig as C, ModuleBaseOptions as M, PublicShopConfig as P, RedisConfig as R, StorageProvider as S, SessionConfig as a, StorageEntity as b, StorageConfig as c, SapiConfig as d, AdditionalShopConfig as e, ShopConfig as f, ShopConfigIndexed as g, StorefrontConfig as h, CheckoutEvent as i, ModulePublicRuntimeConfig as j };
@@ -0,0 +1,102 @@
1
+ import { StorefrontHooks, RpcContext, RpcMethodName, HashAlgorithm, WithParams, rpcMethods, ShopUser } from '@scayle/storefront-core';
2
+ import { CompressionEncodings } from '@scayle/unstorage-compression-driver';
3
+ import { BuiltinDriverName, BuiltinDriverOptions } from 'unstorage';
4
+ import { CheckoutShopConfigType, SessionType, RedisConfigType, StorageType, SapiConfigType, ShopConfigType, IdpType, StorefrontConfigType, ModulePublicRuntimeConfigType, ShopSelectorType, RedirectType } from '../../dist/runtime/utils/zodSchema.js';
5
+ import { HookResult } from '@nuxt/schema';
6
+
7
+ type StorageProvider = 'memory' | 'redis';
8
+ type CheckoutShopConfig = CheckoutShopConfigType;
9
+ /**
10
+ * Options to configure how the storefront core manages sessions
11
+ */
12
+ type SessionConfig = SessionType & {
13
+ /**
14
+ * The provider to use for the persistent storage.
15
+ * @deprecated Storefront Core is now relying on a unified cache configuration. Use the storage option instead.
16
+ */
17
+ provider?: StorageProvider;
18
+ };
19
+ /**
20
+ * @deprecated
21
+ */
22
+ type RedisConfig = RedisConfigType;
23
+ type CustomDriverName = string & {
24
+ _custom?: unknown;
25
+ };
26
+ type StorageEntity<Driver extends BuiltinDriverName | CustomDriverName | unknown = unknown, DriverOptions = Driver extends keyof BuiltinDriverOptions ? BuiltinDriverOptions[Driver] : unknown> = {
27
+ driver: Driver;
28
+ compression?: CompressionEncodings;
29
+ } & DriverOptions;
30
+ interface StorageConfig {
31
+ cache?: StorageType;
32
+ session?: StorageType;
33
+ }
34
+ /**
35
+ * @deprecated Use {@link SapiConfig} instead
36
+ */
37
+ type BapiConfig = SapiConfigType;
38
+ type SapiConfig = SapiConfigType;
39
+ interface AppKeys {
40
+ wishlistKey: string;
41
+ basketKey: string;
42
+ hashAlgorithm: HashAlgorithm;
43
+ }
44
+ interface AdditionalShopConfig {
45
+ }
46
+ type ShopConfig = ShopConfigType & AdditionalShopConfig;
47
+ type ShopConfigIndexed = Record<string, ShopConfig>;
48
+ interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'locale' | 'currency' | 'currencyFractionDigits'> {
49
+ checkout: Pick<CheckoutShopConfig, 'host'>;
50
+ apiBasePath: string;
51
+ idp?: IdpType;
52
+ path?: string;
53
+ }
54
+ type StorefrontConfig = StorefrontConfigType & {
55
+ withParams?: WithParams;
56
+ };
57
+ type ModuleOption = {
58
+ shopSelector: ShopSelectorType;
59
+ redirects?: RedirectType;
60
+ } & ({
61
+ /**
62
+ * @deprecated stores got renamed. Use {@link ModuleOption.shops} instead
63
+ */
64
+ stores: ShopConfigIndexed;
65
+ } | {
66
+ shops: ShopConfigIndexed;
67
+ });
68
+ type ModuleBaseOptions = StorefrontConfig & ModuleOption & {
69
+ rpcDir?: string;
70
+ rpcMethodNames?: string[];
71
+ rpcMethodOverrides?: Array<keyof typeof rpcMethods>;
72
+ };
73
+ interface CheckoutEvent {
74
+ action?: 'authenticated';
75
+ type?: 'tracking';
76
+ user: ShopUser;
77
+ accessToken: string;
78
+ event?: {
79
+ event: 'login' | 'add_to_cart' | 'remove_from_cart';
80
+ status: 'successful' | 'error';
81
+ };
82
+ }
83
+ interface ModulePublicRuntimeConfig extends ModulePublicRuntimeConfigType {
84
+ }
85
+ declare module '@nuxt/schema' {
86
+ interface RuntimeConfig {
87
+ storefront: ModuleBaseOptions;
88
+ }
89
+ interface PublicRuntimeConfig {
90
+ storefront: ModulePublicRuntimeConfig;
91
+ }
92
+ }
93
+ declare module 'nitropack' {
94
+ interface NitroRuntimeHooks extends StorefrontHooks {
95
+ 'storefront:context:created': (context: RpcContext) => HookResult;
96
+ 'storefront:rpc:before': (rpcName: RpcMethodName, context: RpcContext, payload: unknown) => HookResult;
97
+ 'storefront:rpc:after': (rpcName: RpcMethodName, context: RpcContext, result: unknown) => HookResult;
98
+ 'storefront:rpc:error': (rpcName: RpcMethodName, context: RpcContext, error: unknown) => HookResult;
99
+ }
100
+ }
101
+
102
+ export type { AppKeys as A, BapiConfig as B, CheckoutShopConfig as C, ModuleBaseOptions as M, PublicShopConfig as P, RedisConfig as R, StorageProvider as S, SessionConfig as a, StorageEntity as b, StorageConfig as c, SapiConfig as d, AdditionalShopConfig as e, ShopConfig as f, ShopConfigIndexed as g, StorefrontConfig as h, CheckoutEvent as i, ModulePublicRuntimeConfig as j };
package/dist/types.d.mts CHANGED
@@ -1,12 +1,60 @@
1
1
 
2
2
  import type { ModulePublicRuntimeConfig } from './module.js'
3
3
 
4
+ export interface ModuleOptions {
5
+ session: {
6
+ /** @default "$session" */
7
+ cookieName: string,
8
+
9
+ /** @default "lax" */
10
+ sameSite: string,
11
+ },
12
+
13
+ /** @default "domain" */
14
+ shopSelector: string,
15
+
16
+ oauth: {
17
+ /** @default "" */
18
+ apiHost: string,
19
+
20
+ /** @default "" */
21
+ clientId: string,
22
+
23
+ /** @default "" */
24
+ clientSecret: string,
25
+ },
26
+
27
+ idp: {
28
+ /** @default false */
29
+ enabled: boolean,
30
+
31
+ idpKeys: Array<any>,
32
+
33
+ /** @default "" */
34
+ idpRedirectURL: string,
35
+ },
36
+
37
+ appKeys: {
38
+ /** @default "wishlist_{shopId}_{userId}" */
39
+ wishlistKey: string,
40
+
41
+ /** @default "basket_{shopId}_{userId}" */
42
+ basketKey: string,
43
+
44
+ /** @default "sha256" */
45
+ hashAlgorithm: string,
46
+ },
47
+ }
4
48
 
5
49
  declare module '@nuxt/schema' {
50
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
51
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
6
52
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
7
53
  }
8
54
 
9
55
  declare module 'nuxt/schema' {
56
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
57
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
10
58
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
11
59
  }
12
60
 
package/dist/types.d.ts CHANGED
@@ -1,12 +1,60 @@
1
1
 
2
2
  import type { ModulePublicRuntimeConfig } from './module'
3
3
 
4
+ export interface ModuleOptions {
5
+ session: {
6
+ /** @default "$session" */
7
+ cookieName: string,
8
+
9
+ /** @default "lax" */
10
+ sameSite: string,
11
+ },
12
+
13
+ /** @default "domain" */
14
+ shopSelector: string,
15
+
16
+ oauth: {
17
+ /** @default "" */
18
+ apiHost: string,
19
+
20
+ /** @default "" */
21
+ clientId: string,
22
+
23
+ /** @default "" */
24
+ clientSecret: string,
25
+ },
26
+
27
+ idp: {
28
+ /** @default false */
29
+ enabled: boolean,
30
+
31
+ idpKeys: Array<any>,
32
+
33
+ /** @default "" */
34
+ idpRedirectURL: string,
35
+ },
36
+
37
+ appKeys: {
38
+ /** @default "wishlist_{shopId}_{userId}" */
39
+ wishlistKey: string,
40
+
41
+ /** @default "basket_{shopId}_{userId}" */
42
+ basketKey: string,
43
+
44
+ /** @default "sha256" */
45
+ hashAlgorithm: string,
46
+ },
47
+ }
4
48
 
5
49
  declare module '@nuxt/schema' {
50
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
51
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
6
52
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
7
53
  }
8
54
 
9
55
  declare module 'nuxt/schema' {
56
+ interface NuxtConfig { ['storefront']?: Partial<ModuleOptions> }
57
+ interface NuxtOptions { ['storefront']?: ModuleOptions }
10
58
  interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
11
59
  }
12
60
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.85.8",
4
+ "version": "7.85.10",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "import": "./dist/rpc.mjs"
22
22
  },
23
23
  "./module": {
24
- "types": "./dist/types.d.ts",
24
+ "types": "./dist/module.d.ts",
25
25
  "require": "./dist/module.cjs",
26
26
  "import": "./dist/module.mjs"
27
27
  },
@@ -31,7 +31,7 @@
31
31
  }
32
32
  },
33
33
  "imports": {
34
- "#storefront/composables": "./dist/runtime/composables/index.mjs"
34
+ "#storefront/composables": "./dist/runtime/composables/index.js"
35
35
  },
36
36
  "main": "./dist/index.mjs",
37
37
  "types": "./dist/index.d.ts",
@@ -55,7 +55,8 @@
55
55
  "package:lint": "publint",
56
56
  "test": "vitest run",
57
57
  "test:ci": "vitest run",
58
- "test:watch": "vitest watch"
58
+ "test:watch": "vitest watch",
59
+ "postinstall": "patch-package"
59
60
  },
60
61
  "dependencies": {
61
62
  "@nuxt/kit": "^3.12.2",
@@ -80,20 +81,21 @@
80
81
  },
81
82
  "devDependencies": {
82
83
  "@nuxt/eslint": "0.5.7",
83
- "@nuxt/module-builder": "0.5.5",
84
- "@nuxt/schema": "3.12.4",
84
+ "@nuxt/module-builder": "0.7.1",
85
+ "@nuxt/schema": "3.13.2",
85
86
  "@nuxt/test-utils": "3.14.2",
86
87
  "@scayle/eslint-config-storefront": "4.3.0",
87
- "@scayle/eslint-plugin-vue-composable": "0.2.0",
88
- "@types/node": "20.16.6",
88
+ "@scayle/eslint-plugin-vue-composable": "0.2.1",
89
+ "@types/node": "20.16.10",
89
90
  "dprint": "0.47.2",
90
91
  "eslint": "9.11.1",
91
92
  "eslint-formatter-gitlab": "5.1.0",
92
93
  "fishery": "2.2.2",
93
94
  "h3": "1.12.0",
94
95
  "node-mocks-http": "1.16.0",
95
- "nuxi": "3.13.2",
96
- "nuxt": "3.12.4",
96
+ "nuxi": "3.14.0",
97
+ "nuxt": "3.13.2",
98
+ "patch-package": "8.0.0",
97
99
  "publint": "0.2.11",
98
100
  "vitest": "2.1.1",
99
101
  "vue-tsc": "2.1.6"
@@ -106,9 +108,9 @@
106
108
  },
107
109
  "resolutions": {
108
110
  "h3": "1.12.0",
109
- "vue": "3.4.38",
110
- "@nuxt/kit": "3.12.4",
111
- "@nuxt/schema": "3.12.4"
111
+ "vue": "3.5.10",
112
+ "@nuxt/kit": "3.13.2",
113
+ "@nuxt/schema": "3.13.2"
112
114
  },
113
115
  "volta": {
114
116
  "node": "20.17.0"
@@ -1,36 +0,0 @@
1
- export * from "./core/useAvailableShops.mjs";
2
- export * from "./core/useCurrentShop.mjs";
3
- export * from "./core/useFormatHelpers.mjs";
4
- export * from "./core/useIDP.mjs";
5
- export * from "./core/useLog.mjs";
6
- export * from "./core/useRpc.mjs";
7
- export * from "./core/useRpcCall.mjs";
8
- export * from "./core/useSession.mjs";
9
- export * from "./core/useUser.mjs";
10
- export * from "./storefront/useBasket.mjs";
11
- export * from "./storefront/useBrand.mjs";
12
- export * from "./storefront/useBrands.mjs";
13
- export * from "./storefront/useCategories.mjs";
14
- export * from "./storefront/useCategoryById.mjs";
15
- export * from "./storefront/useCategoryByPath.mjs";
16
- export * from "./storefront/useCurrentPromotions.mjs";
17
- export * from "./storefront/useFacet.mjs";
18
- export * from "./storefront/useFilters.mjs";
19
- export * from "./storefront/useNavigationTree.mjs";
20
- export * from "./storefront/useNavigationTrees.mjs";
21
- export * from "./storefront/useOrder.mjs";
22
- export * from "./storefront/useOrderConfirmation.mjs";
23
- export * from "./storefront/useProduct.mjs";
24
- export * from "./storefront/useProducts.mjs";
25
- export * from "./storefront/useProductsByIds.mjs";
26
- export * from "./storefront/useProductsByReferenceKeys.mjs";
27
- export * from "./storefront/useProductsCount.mjs";
28
- export * from "./storefront/usePromotions.mjs";
29
- export * from "./storefront/usePromotionsByIds.mjs";
30
- export * from "./storefront/useQueryFilterState.mjs";
31
- export * from "./storefront/useSearch.mjs";
32
- export * from "./storefront/useShopConfiguration.mjs";
33
- export * from "./storefront/useStorefrontSearch.mjs";
34
- export * from "./storefront/useUserAddresses.mjs";
35
- export * from "./storefront/useVariant.mjs";
36
- export * from "./storefront/useWishlist.mjs";