@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.
Files changed (47) hide show
  1. package/CHANGELOG.md +15 -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.mjs +5 -25
  8. package/dist/rpc.d.mts +1 -16
  9. package/dist/rpc.d.ts +1 -16
  10. package/dist/rpc.mjs +1 -20
  11. package/dist/runtime/api/rpcHandler.d.ts +55 -1
  12. package/dist/runtime/api/rpcHandler.mjs +1 -1
  13. package/dist/runtime/composables/core/useAvailableShops.d.ts +1 -1
  14. package/dist/runtime/composables/core/useRpc.d.ts +3 -3
  15. package/dist/runtime/composables/storefront/useFacet.d.ts +28 -24
  16. package/dist/runtime/composables/storefront/useOrder.d.ts +15 -14
  17. package/dist/runtime/composables/storefront/useOrder.mjs +4 -20
  18. package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +15 -14
  19. package/dist/runtime/composables/storefront/useOrderConfirmation.mjs +1 -19
  20. package/dist/runtime/composables/storefront/useSearch.d.ts +3 -3
  21. package/dist/runtime/composables/storefront/useStorefrontSearch.d.ts +2 -2
  22. package/dist/runtime/context.mjs +1 -1
  23. package/dist/runtime/error/handler.d.ts +1 -1
  24. package/dist/runtime/nitro/plugins/cacheRuntimeConfig.d.ts +1 -1
  25. package/dist/runtime/nitro/plugins/cacheRuntimeConfig.mjs +2 -1
  26. package/dist/runtime/nitro/plugins/configValidation.d.ts +8 -3
  27. package/dist/runtime/nitro/plugins/configValidation.mjs +7 -5
  28. package/dist/runtime/nitro/plugins/nitroLogger.d.ts +1 -1
  29. package/dist/runtime/nitro/plugins/nitroLogger.mjs +2 -1
  30. package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.d.ts +1 -1
  31. package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.mjs +7 -5
  32. package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.d.ts +1 -1
  33. package/dist/runtime/nitro/plugins/nitroSetXPoweredByHeader.mjs +1 -1
  34. package/dist/runtime/server/middleware/bootstrap.mjs +1 -1
  35. package/dist/runtime/server/middleware/bootstrap.utils.d.ts +6 -2
  36. package/dist/runtime/server/middleware/bootstrap.utils.mjs +2 -2
  37. package/dist/runtime/server/tsconfig.json +1 -1
  38. package/dist/runtime/utils/zodSchema.d.ts +261 -153
  39. package/dist/runtime/utils/zodSchema.mjs +16 -7
  40. package/dist/shared/storefront-nuxt.77c99ba5.d.mts +102 -0
  41. package/dist/shared/storefront-nuxt.77c99ba5.d.ts +102 -0
  42. package/package.json +13 -13
  43. package/dist/module.json +0 -8
  44. package/dist/shared/storefront-nuxt.891170da.d.mts +0 -1205
  45. package/dist/shared/storefront-nuxt.891170da.d.ts +0 -1205
  46. package/dist/types.d.mts +0 -14
  47. package/dist/types.d.ts +0 -14
@@ -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 '../runtime/utils/zodSchema.ts';
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 '../runtime/utils/zodSchema.ts';
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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.85.7",
4
+ "version": "7.85.9",
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
  },
@@ -61,7 +61,7 @@
61
61
  "@nuxt/kit": "^3.12.2",
62
62
  "@opentelemetry/api": "^1.9.0",
63
63
  "@scayle/h3-session": "^0.4.0",
64
- "@scayle/storefront-core": "7.65.3",
64
+ "@scayle/storefront-core": "7.65.4",
65
65
  "@scayle/unstorage-compression-driver": "^0.1.3",
66
66
  "@vueuse/core": "11.1.0",
67
67
  "consola": "^3.2.3",
@@ -80,20 +80,20 @@
80
80
  },
81
81
  "devDependencies": {
82
82
  "@nuxt/eslint": "0.5.7",
83
- "@nuxt/module-builder": "0.5.5",
84
- "@nuxt/schema": "3.12.4",
83
+ "@nuxt/module-builder": "0.6.0",
84
+ "@nuxt/schema": "3.13.2",
85
85
  "@nuxt/test-utils": "3.14.2",
86
86
  "@scayle/eslint-config-storefront": "4.3.0",
87
- "@scayle/eslint-plugin-vue-composable": "0.2.0",
88
- "@types/node": "20.16.5",
87
+ "@scayle/eslint-plugin-vue-composable": "0.2.1",
88
+ "@types/node": "20.16.9",
89
89
  "dprint": "0.47.2",
90
- "eslint": "9.10.0",
90
+ "eslint": "9.11.1",
91
91
  "eslint-formatter-gitlab": "5.1.0",
92
92
  "fishery": "2.2.2",
93
93
  "h3": "1.12.0",
94
94
  "node-mocks-http": "1.16.0",
95
- "nuxi": "3.13.2",
96
- "nuxt": "3.12.4",
95
+ "nuxi": "3.14.0",
96
+ "nuxt": "3.13.2",
97
97
  "publint": "0.2.11",
98
98
  "vitest": "2.1.1",
99
99
  "vue-tsc": "2.1.6"
@@ -106,9 +106,9 @@
106
106
  },
107
107
  "resolutions": {
108
108
  "h3": "1.12.0",
109
- "vue": "3.4.38",
110
- "@nuxt/kit": "3.12.4",
111
- "@nuxt/schema": "3.12.4"
109
+ "vue": "3.5.9",
110
+ "@nuxt/kit": "3.13.2",
111
+ "@nuxt/schema": "3.13.2"
112
112
  },
113
113
  "volta": {
114
114
  "node": "20.17.0"
package/dist/module.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@scayle/storefront-nuxt",
3
- "version": "7.85.7",
4
- "configKey": "storefront",
5
- "compatibility": {
6
- "nuxt": "^3.9.0"
7
- }
8
- }