@scayle/storefront-nuxt 7.83.0 → 7.84.0

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 (31) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/index.d.mts +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/module.d.mts +2 -2
  5. package/dist/module.d.ts +2 -2
  6. package/dist/module.json +1 -1
  7. package/dist/module.mjs +10 -10
  8. package/dist/rpc.d.mts +1 -1
  9. package/dist/rpc.d.ts +1 -1
  10. package/dist/runtime/api/cacheAuth.mjs +1 -0
  11. package/dist/runtime/composables/core/useIDP.mjs +2 -11
  12. package/dist/runtime/composables/core/useRpc.mjs +3 -1
  13. package/dist/runtime/composables/core/useSession.mjs +10 -17
  14. package/dist/runtime/composables/core/useUser.mjs +7 -14
  15. package/dist/runtime/composables/storefront/useBasket.mjs +11 -24
  16. package/dist/runtime/composables/storefront/useCategories.mjs +2 -10
  17. package/dist/runtime/composables/storefront/useCurrentPromotions.mjs +7 -1
  18. package/dist/runtime/composables/storefront/useSearch.mjs +3 -10
  19. package/dist/runtime/composables/storefront/useStorefrontSearch.mjs +5 -15
  20. package/dist/runtime/composables/storefront/useWishlist.mjs +9 -24
  21. package/dist/runtime/nitro/plugins/configValidation.d.ts +4 -0
  22. package/dist/runtime/nitro/plugins/configValidation.mjs +2 -2
  23. package/dist/runtime/nitro/plugins/nitroRuntimeStorageConfig.mjs +2 -1
  24. package/dist/runtime/server/middleware/bootstrap.mjs +3 -1
  25. package/dist/runtime/server/middleware/bootstrap.utils.d.ts +2 -2
  26. package/dist/runtime/server/middleware/bootstrap.utils.mjs +9 -7
  27. package/dist/runtime/utils/zodSchema.d.ts +987 -148
  28. package/dist/runtime/utils/zodSchema.mjs +34 -10
  29. package/dist/shared/{storefront-nuxt.87331293.d.mts → storefront-nuxt.d852fe87.d.mts} +21 -7
  30. package/dist/shared/{storefront-nuxt.87331293.d.ts → storefront-nuxt.d852fe87.d.ts} +21 -7
  31. package/package.json +11 -11
@@ -96,7 +96,6 @@ const ShopConfigSchema = z.object({
96
96
  auth: z.object({
97
97
  resetPasswordUrl: z.string()
98
98
  }),
99
- storeCampaignKeyword: z.string().optional(),
100
99
  currency: z.string(),
101
100
  checkout: CheckoutShopConfigSchema,
102
101
  appKeys: AppKeysSchema.optional(),
@@ -111,7 +110,11 @@ const ShopConfigSchema = z.object({
111
110
  }).optional(),
112
111
  isDefault: z.boolean().optional().or(emptyString),
113
112
  /** @deprecated shop-specific storefront.redis config is being removed in favor of global nitro.storage config */
114
- redis: RedisConfigSchema.optional()
113
+ redis: RedisConfigSchema.optional(),
114
+ /**
115
+ * @deprecated storeCampaignKeyword will be removed in a future release.
116
+ */
117
+ storeCampaignKeyword: z.string().optional()
115
118
  });
116
119
  const CacheSchema = z.object({
117
120
  auth: z.object({
@@ -139,22 +142,43 @@ const StorefrontConfigSchema = z.intersection(
139
142
  }),
140
143
  z.union([
141
144
  z.object({ sapi: SapiSchema, bapi: z.undefined() }),
142
- z.object({ bapi: SapiSchema, sapi: z.undefined() })
145
+ z.object({
146
+ /**
147
+ * bapi was renamed. Use {@link sapi} instead.
148
+ */
149
+ bapi: SapiSchema,
150
+ sapi: z.undefined()
151
+ })
143
152
  ])
144
153
  );
145
- const ModuleOptionSchema = z.object(
146
- {
147
- shopSelector: ShopSelectorSchema,
148
- stores: z.record(ShopConfigSchema),
149
- redirects: RedirectsSchema.optional()
150
- }
154
+ const ModuleOptionSchema = z.intersection(
155
+ z.object(
156
+ {
157
+ shopSelector: ShopSelectorSchema,
158
+ redirects: RedirectsSchema.optional()
159
+ }
160
+ ),
161
+ z.union([
162
+ z.object({
163
+ /**
164
+ * @deprecated stores was renamed. Use {@link shops} instead
165
+ */
166
+ stores: z.record(ShopConfigSchema),
167
+ shops: z.undefined()
168
+ }),
169
+ z.object({
170
+ stores: z.undefined(),
171
+ shops: z.record(ShopConfigSchema)
172
+ })
173
+ ])
151
174
  );
152
175
  const logLevel = z.enum(["debug", "info", "warn", "error"]);
153
176
  const PublicRuntimeConfigSchema = z.object({
154
177
  log: z.object({
155
178
  name: z.string(),
156
179
  level: logLevel
157
- })
180
+ }),
181
+ disableDefaultGetCachedDataOverride: z.boolean().optional()
158
182
  });
159
183
  export const RuntimeConfigSchema = z.object({
160
184
  storefront: z.intersection(ModuleOptionSchema, StorefrontConfigSchema),
@@ -191,7 +191,6 @@ declare const ShopConfigSchema: z.ZodObject<{
191
191
  }, {
192
192
  resetPasswordUrl: string;
193
193
  }>;
194
- storeCampaignKeyword: z.ZodOptional<z.ZodString>;
195
194
  currency: z.ZodString;
196
195
  checkout: z.ZodObject<{
197
196
  token: z.ZodString;
@@ -441,6 +440,10 @@ declare const ShopConfigSchema: z.ZodObject<{
441
440
  prefix?: string | undefined;
442
441
  sslTransit?: boolean | undefined;
443
442
  }>]>>;
443
+ /**
444
+ * @deprecated storeCampaignKeyword will be removed in a future release.
445
+ */
446
+ storeCampaignKeyword: z.ZodOptional<z.ZodString>;
444
447
  }, "strip", z.ZodTypeAny, {
445
448
  shopId: number;
446
449
  locale: string;
@@ -476,7 +479,6 @@ declare const ShopConfigSchema: z.ZodObject<{
476
479
  idpRedirectURL: string;
477
480
  } | undefined;
478
481
  apiBasePath?: string | undefined;
479
- storeCampaignKeyword?: string | undefined;
480
482
  appKeys?: {
481
483
  wishlistKey: string;
482
484
  basketKey: string;
@@ -526,6 +528,7 @@ declare const ShopConfigSchema: z.ZodObject<{
526
528
  } | undefined;
527
529
  } | undefined;
528
530
  isDefault?: boolean | "" | undefined;
531
+ storeCampaignKeyword?: string | undefined;
529
532
  }, {
530
533
  shopId: number;
531
534
  locale: string;
@@ -561,7 +564,6 @@ declare const ShopConfigSchema: z.ZodObject<{
561
564
  idpRedirectURL: string;
562
565
  } | undefined;
563
566
  apiBasePath?: string | undefined;
564
- storeCampaignKeyword?: string | undefined;
565
567
  appKeys?: {
566
568
  wishlistKey: string;
567
569
  basketKey: string;
@@ -611,6 +613,7 @@ declare const ShopConfigSchema: z.ZodObject<{
611
613
  } | undefined;
612
614
  } | undefined;
613
615
  isDefault?: string | boolean | undefined;
616
+ storeCampaignKeyword?: string | undefined;
614
617
  }>;
615
618
  declare const ShopSelectorSchema: z.ZodEnum<["path", "domain", "path_or_default"]>;
616
619
  type ShopConfigType = z.infer<typeof ShopConfigSchema>;
@@ -1041,6 +1044,9 @@ declare const StorefrontConfigSchema: z.ZodIntersection<z.ZodObject<{
1041
1044
  };
1042
1045
  bapi?: undefined;
1043
1046
  }>, z.ZodObject<{
1047
+ /**
1048
+ * bapi was renamed. Use {@link sapi} instead.
1049
+ */
1044
1050
  bapi: z.ZodObject<{
1045
1051
  host: z.ZodString;
1046
1052
  token: z.ZodString;
@@ -1076,16 +1082,19 @@ declare const PublicRuntimeConfigSchema: z.ZodObject<{
1076
1082
  name: string;
1077
1083
  level: LogLevel;
1078
1084
  }>;
1085
+ disableDefaultGetCachedDataOverride: z.ZodOptional<z.ZodBoolean>;
1079
1086
  }, "strip", z.ZodTypeAny, {
1080
1087
  log: {
1081
1088
  name: string;
1082
1089
  level: LogLevel;
1083
1090
  };
1091
+ disableDefaultGetCachedDataOverride?: boolean | undefined;
1084
1092
  }, {
1085
1093
  log: {
1086
1094
  name: string;
1087
1095
  level: LogLevel;
1088
1096
  };
1097
+ disableDefaultGetCachedDataOverride?: boolean | undefined;
1089
1098
  }>;
1090
1099
  type CheckoutShopConfigType = z.infer<typeof CheckoutShopConfigSchema>;
1091
1100
  type SessionType = z.infer<typeof SessionSchema>;
@@ -1137,8 +1146,7 @@ interface AppKeys {
1137
1146
  }
1138
1147
  interface AdditionalShopConfig {
1139
1148
  }
1140
- interface ShopConfig extends ShopConfigType, AdditionalShopConfig {
1141
- }
1149
+ type ShopConfig = ShopConfigType & AdditionalShopConfig;
1142
1150
  type ShopConfigIndexed = Record<string, ShopConfig>;
1143
1151
  interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'locale' | 'currency' | 'currencyFractionDigits'> {
1144
1152
  checkout: Pick<CheckoutShopConfig, 'host'>;
@@ -1151,9 +1159,15 @@ type StorefrontConfig = StorefrontConfigType & {
1151
1159
  };
1152
1160
  type ModuleOption = {
1153
1161
  shopSelector: ShopSelectorType;
1154
- stores: ShopConfigIndexed;
1155
1162
  redirects?: RedirectType;
1156
- };
1163
+ } & ({
1164
+ /**
1165
+ * @deprecated stores got renamed. Use {@link ModuleOption.shops} instead
1166
+ */
1167
+ stores: ShopConfigIndexed;
1168
+ } | {
1169
+ shops: ShopConfigIndexed;
1170
+ });
1157
1171
  type ModuleBaseOptions = StorefrontConfig & ModuleOption & {
1158
1172
  rpcDir?: string;
1159
1173
  rpcMethodNames?: string[];
@@ -191,7 +191,6 @@ declare const ShopConfigSchema: z.ZodObject<{
191
191
  }, {
192
192
  resetPasswordUrl: string;
193
193
  }>;
194
- storeCampaignKeyword: z.ZodOptional<z.ZodString>;
195
194
  currency: z.ZodString;
196
195
  checkout: z.ZodObject<{
197
196
  token: z.ZodString;
@@ -441,6 +440,10 @@ declare const ShopConfigSchema: z.ZodObject<{
441
440
  prefix?: string | undefined;
442
441
  sslTransit?: boolean | undefined;
443
442
  }>]>>;
443
+ /**
444
+ * @deprecated storeCampaignKeyword will be removed in a future release.
445
+ */
446
+ storeCampaignKeyword: z.ZodOptional<z.ZodString>;
444
447
  }, "strip", z.ZodTypeAny, {
445
448
  shopId: number;
446
449
  locale: string;
@@ -476,7 +479,6 @@ declare const ShopConfigSchema: z.ZodObject<{
476
479
  idpRedirectURL: string;
477
480
  } | undefined;
478
481
  apiBasePath?: string | undefined;
479
- storeCampaignKeyword?: string | undefined;
480
482
  appKeys?: {
481
483
  wishlistKey: string;
482
484
  basketKey: string;
@@ -526,6 +528,7 @@ declare const ShopConfigSchema: z.ZodObject<{
526
528
  } | undefined;
527
529
  } | undefined;
528
530
  isDefault?: boolean | "" | undefined;
531
+ storeCampaignKeyword?: string | undefined;
529
532
  }, {
530
533
  shopId: number;
531
534
  locale: string;
@@ -561,7 +564,6 @@ declare const ShopConfigSchema: z.ZodObject<{
561
564
  idpRedirectURL: string;
562
565
  } | undefined;
563
566
  apiBasePath?: string | undefined;
564
- storeCampaignKeyword?: string | undefined;
565
567
  appKeys?: {
566
568
  wishlistKey: string;
567
569
  basketKey: string;
@@ -611,6 +613,7 @@ declare const ShopConfigSchema: z.ZodObject<{
611
613
  } | undefined;
612
614
  } | undefined;
613
615
  isDefault?: string | boolean | undefined;
616
+ storeCampaignKeyword?: string | undefined;
614
617
  }>;
615
618
  declare const ShopSelectorSchema: z.ZodEnum<["path", "domain", "path_or_default"]>;
616
619
  type ShopConfigType = z.infer<typeof ShopConfigSchema>;
@@ -1041,6 +1044,9 @@ declare const StorefrontConfigSchema: z.ZodIntersection<z.ZodObject<{
1041
1044
  };
1042
1045
  bapi?: undefined;
1043
1046
  }>, z.ZodObject<{
1047
+ /**
1048
+ * bapi was renamed. Use {@link sapi} instead.
1049
+ */
1044
1050
  bapi: z.ZodObject<{
1045
1051
  host: z.ZodString;
1046
1052
  token: z.ZodString;
@@ -1076,16 +1082,19 @@ declare const PublicRuntimeConfigSchema: z.ZodObject<{
1076
1082
  name: string;
1077
1083
  level: LogLevel;
1078
1084
  }>;
1085
+ disableDefaultGetCachedDataOverride: z.ZodOptional<z.ZodBoolean>;
1079
1086
  }, "strip", z.ZodTypeAny, {
1080
1087
  log: {
1081
1088
  name: string;
1082
1089
  level: LogLevel;
1083
1090
  };
1091
+ disableDefaultGetCachedDataOverride?: boolean | undefined;
1084
1092
  }, {
1085
1093
  log: {
1086
1094
  name: string;
1087
1095
  level: LogLevel;
1088
1096
  };
1097
+ disableDefaultGetCachedDataOverride?: boolean | undefined;
1089
1098
  }>;
1090
1099
  type CheckoutShopConfigType = z.infer<typeof CheckoutShopConfigSchema>;
1091
1100
  type SessionType = z.infer<typeof SessionSchema>;
@@ -1137,8 +1146,7 @@ interface AppKeys {
1137
1146
  }
1138
1147
  interface AdditionalShopConfig {
1139
1148
  }
1140
- interface ShopConfig extends ShopConfigType, AdditionalShopConfig {
1141
- }
1149
+ type ShopConfig = ShopConfigType & AdditionalShopConfig;
1142
1150
  type ShopConfigIndexed = Record<string, ShopConfig>;
1143
1151
  interface PublicShopConfig extends Pick<ShopConfig, 'shopId' | 'domain' | 'locale' | 'currency' | 'currencyFractionDigits'> {
1144
1152
  checkout: Pick<CheckoutShopConfig, 'host'>;
@@ -1151,9 +1159,15 @@ type StorefrontConfig = StorefrontConfigType & {
1151
1159
  };
1152
1160
  type ModuleOption = {
1153
1161
  shopSelector: ShopSelectorType;
1154
- stores: ShopConfigIndexed;
1155
1162
  redirects?: RedirectType;
1156
- };
1163
+ } & ({
1164
+ /**
1165
+ * @deprecated stores got renamed. Use {@link ModuleOption.shops} instead
1166
+ */
1167
+ stores: ShopConfigIndexed;
1168
+ } | {
1169
+ shops: ShopConfigIndexed;
1170
+ });
1157
1171
  type ModuleBaseOptions = StorefrontConfig & ModuleOption & {
1158
1172
  rpcDir?: string;
1159
1173
  rpcMethodNames?: string[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.83.0",
4
+ "version": "7.84.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  "@nuxt/kit": "^3.12.2",
61
61
  "@opentelemetry/api": "^1.9.0",
62
62
  "@scayle/h3-session": "^0.4.0",
63
- "@scayle/storefront-core": "^7.62.0",
63
+ "@scayle/storefront-core": "^7.63.0",
64
64
  "@scayle/unstorage-compression-driver": "^0.1.3",
65
65
  "@vueuse/core": "^10.11.0",
66
66
  "consola": "^3.2.3",
@@ -80,23 +80,23 @@
80
80
  "zod": "^3.23.8"
81
81
  },
82
82
  "devDependencies": {
83
- "@nuxt/eslint": "0.3.13",
83
+ "@nuxt/eslint": "0.4.0",
84
84
  "@nuxt/module-builder": "0.5.5",
85
85
  "@nuxt/schema": "3.12.4",
86
- "@nuxt/test-utils": "3.13.1",
87
- "@scayle/eslint-config-storefront": "4.2.0",
86
+ "@nuxt/test-utils": "3.14.0",
87
+ "@scayle/eslint-config-storefront": "4.3.0",
88
88
  "@scayle/eslint-plugin-vue-composable": "0.2.0",
89
- "@types/node": "20.14.12",
89
+ "@types/node": "20.14.13",
90
90
  "dprint": "0.47.2",
91
- "eslint": "9.7.0",
91
+ "eslint": "9.8.0",
92
92
  "eslint-formatter-gitlab": "5.1.0",
93
93
  "fishery": "2.2.2",
94
94
  "h3": "1.12.0",
95
- "node-mocks-http": "1.15.0",
95
+ "node-mocks-http": "1.15.1",
96
96
  "nuxi": "3.12.0",
97
97
  "nuxt": "3.12.4",
98
98
  "publint": "0.2.9",
99
- "vitest": "2.0.4",
99
+ "vitest": "2.0.5",
100
100
  "vue-tsc": "2.0.29"
101
101
  },
102
102
  "peerDependencies": {
@@ -107,11 +107,11 @@
107
107
  },
108
108
  "resolutions": {
109
109
  "h3": "1.12.0",
110
- "vue": "3.4.32",
110
+ "vue": "3.4.35",
111
111
  "@nuxt/kit": "3.12.4",
112
112
  "@nuxt/schema": "3.12.4"
113
113
  },
114
114
  "volta": {
115
- "node": "20.15.1"
115
+ "node": "20.16.0"
116
116
  }
117
117
  }