@scayle/storefront-nuxt 7.71.2 → 7.72.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.
@@ -0,0 +1,113 @@
1
+ import { z } from "zod";
2
+ import { HashAlgorithm } from "@scayle/storefront-core";
3
+ import { builtinDrivers } from "unstorage";
4
+ const RedirectsSchema = z.object({
5
+ enabled: z.boolean(),
6
+ queryParamWhitelist: z.array(z.string()).optional()
7
+ });
8
+ const SessionSchema = z.object({
9
+ sameSite: z.enum(["lax", "strict", "none"]).optional(),
10
+ maxAge: z.number().optional(),
11
+ cookieName: z.string().optional(),
12
+ secret: z.string().optional(),
13
+ domain: z.string().optional()
14
+ });
15
+ const BapiSchema = z.object({
16
+ host: z.string().url(),
17
+ token: z.string().min(1)
18
+ });
19
+ const OAuthSchema = z.object({
20
+ apiHost: z.string().url(),
21
+ clientId: z.number().or(z.string().min(1)),
22
+ clientSecret: z.string().min(1)
23
+ });
24
+ const IdpSchema = z.object({
25
+ enabled: z.boolean(),
26
+ idpKeys: z.array(z.string()),
27
+ idpRedirectURL: z.string()
28
+ });
29
+ const builtinDriverKeys = Object.keys(builtinDrivers);
30
+ const StorageSchema = z.object({
31
+ driver: z.enum(builtinDriverKeys),
32
+ compression: z.enum(["deflate", "gzip", "brotli", "none"]).optional(),
33
+ url: z.string().url().optional(),
34
+ token: z.string().optional(),
35
+ host: z.string().optional(),
36
+ port: z.number().optional(),
37
+ username: z.string().optional(),
38
+ password: z.string().optional(),
39
+ tls: z.boolean().optional(),
40
+ ttl: z.number().optional()
41
+ });
42
+ const hashValues = Object.values(HashAlgorithm);
43
+ const AppKeysSchema = z.object(
44
+ {
45
+ wishlistKey: z.string(),
46
+ basketKey: z.string(),
47
+ hashAlgorithm: z.enum(hashValues)
48
+ }
49
+ );
50
+ const ShopConfigSchema = z.record(z.object({
51
+ idp: IdpSchema.optional(),
52
+ shopId: z.number(),
53
+ path: z.string().optional(),
54
+ apiBasePath: z.string().optional(),
55
+ domain: z.string(),
56
+ locale: z.string(),
57
+ auth: z.object({
58
+ resetPasswordUrl: z.string()
59
+ }),
60
+ storeCampaignKeyword: z.string().optional(),
61
+ currency: z.string(),
62
+ checkout: z.object({
63
+ token: z.string().min(1),
64
+ secret: z.string().min(1),
65
+ host: z.string().url(),
66
+ user: z.string().or(z.number()),
67
+ cbdExpiration: z.number().optional()
68
+ }),
69
+ appKeys: AppKeysSchema.optional(),
70
+ currencyFractionDigits: z.string().optional(),
71
+ isEnabled: z.boolean().optional(),
72
+ sessionConfig: SessionSchema.optional(),
73
+ bapi: BapiSchema.optional(),
74
+ storage: z.object({
75
+ session: StorageSchema,
76
+ cache: StorageSchema
77
+ }).optional()
78
+ }));
79
+ const CacheSchema = z.object({
80
+ auth: z.object({
81
+ username: z.string().min(1),
82
+ password: z.string().min(1)
83
+ }),
84
+ enabled: z.boolean()
85
+ });
86
+ const storefrontRuntimeConfigPrivateSchema = z.object({
87
+ publicShopData: z.array(z.string()),
88
+ redirects: RedirectsSchema.optional(),
89
+ session: SessionSchema.optional(),
90
+ bapi: BapiSchema,
91
+ oauth: OAuthSchema,
92
+ idp: IdpSchema.optional(),
93
+ shopSelector: z.enum(["path", "domain", "path_or_default"]),
94
+ stores: ShopConfigSchema,
95
+ storage: z.object({
96
+ session: StorageSchema,
97
+ cache: StorageSchema
98
+ }),
99
+ cache: CacheSchema.optional(),
100
+ appKeys: AppKeysSchema
101
+ });
102
+ const publicRuntimeConfigSchema = z.object({
103
+ storefront: z.object({
104
+ log: z.object({
105
+ name: z.string(),
106
+ level: z.string()
107
+ })
108
+ })
109
+ });
110
+ export const runtimeConfigSchema = z.object({
111
+ storefront: storefrontRuntimeConfigPrivateSchema,
112
+ public: publicRuntimeConfigSchema
113
+ });
@@ -1,5 +1,5 @@
1
1
  import { HookResult } from '@nuxt/schema';
2
- import { RpcContext, HashAlgorithm, IDPConfig, WithParams, ShopUser, LogLevel } from '@scayle/storefront-core';
2
+ import { RpcContext, HashAlgorithm, IDPConfig, WithParams, rpcMethods, ShopUser, LogLevel } from '@scayle/storefront-core';
3
3
  import { CompressionEncodings } from '@scayle/unstorage-compression-driver';
4
4
  import { BuiltinDriverName, BuiltinDriverOptions } from 'unstorage';
5
5
 
@@ -149,6 +149,7 @@ type ModuleOptions = StorefrontConfig & {
149
149
  stores: ShopConfigIndexed;
150
150
  rpcDir?: string;
151
151
  rpcMethodNames?: string[];
152
+ rpcMethodOverrides?: Array<keyof typeof rpcMethods>;
152
153
  redirects?: RedirectsConfig;
153
154
  };
154
155
  interface CheckoutEvent {
@@ -1,5 +1,5 @@
1
1
  import { HookResult } from '@nuxt/schema';
2
- import { RpcContext, HashAlgorithm, IDPConfig, WithParams, ShopUser, LogLevel } from '@scayle/storefront-core';
2
+ import { RpcContext, HashAlgorithm, IDPConfig, WithParams, rpcMethods, ShopUser, LogLevel } from '@scayle/storefront-core';
3
3
  import { CompressionEncodings } from '@scayle/unstorage-compression-driver';
4
4
  import { BuiltinDriverName, BuiltinDriverOptions } from 'unstorage';
5
5
 
@@ -149,6 +149,7 @@ type ModuleOptions = StorefrontConfig & {
149
149
  stores: ShopConfigIndexed;
150
150
  rpcDir?: string;
151
151
  rpcMethodNames?: string[];
152
+ rpcMethodOverrides?: Array<keyof typeof rpcMethods>;
152
153
  redirects?: RedirectsConfig;
153
154
  };
154
155
  interface CheckoutEvent {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.71.2",
4
+ "version": "7.72.1",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -57,7 +57,7 @@
57
57
  "@nuxt/kit": "3.11.1",
58
58
  "@opentelemetry/api": "1.8.0",
59
59
  "@scayle/h3-session": "0.4.0",
60
- "@scayle/storefront-core": "7.51.1",
60
+ "@scayle/storefront-core": "7.52.0",
61
61
  "@scayle/unstorage-compression-driver": "0.1.3",
62
62
  "@vueuse/core": "10.9.0",
63
63
  "consola": "3.2.3",
@@ -71,18 +71,19 @@
71
71
  "uncrypto": "0.1.3",
72
72
  "unstorage": "1.10.2",
73
73
  "vue-router": "4.3.2",
74
- "yn": "5.0.0"
74
+ "yn": "5.0.0",
75
+ "zod": "3.23.5"
75
76
  },
76
77
  "devDependencies": {
77
78
  "@nuxt/eslint": "0.3.13",
78
79
  "@nuxt/module-builder": "0.5.5",
79
80
  "@nuxt/schema": "3.11.1",
80
- "@nuxt/test-utils": "3.13.0",
81
+ "@nuxt/test-utils": "3.13.1",
81
82
  "@scayle/eslint-config-storefront": "4.2.0",
82
83
  "@scayle/eslint-plugin-vue-composable": "0.2.0",
83
84
  "@types/node": "20.12.12",
84
85
  "dprint": "0.45.1",
85
- "eslint": "9.2.0",
86
+ "eslint": "9.3.0",
86
87
  "eslint-formatter-gitlab": "5.1.0",
87
88
  "fishery": "2.2.2",
88
89
  "h3": "1.11.1",