@scayle/storefront-nuxt 7.84.4 → 7.84.5

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.84.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @scayle/storefront-core@7.64.1
9
+
3
10
  ## 7.84.4
4
11
 
5
12
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.d852fe87.mjs';
1
+ export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.mjs';
2
2
  export { rpcCall } from './rpc.mjs';
3
3
  export * from '@scayle/storefront-core';
4
4
  export { LogLevel } from '@scayle/storefront-core';
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.d852fe87.js';
1
+ export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, M as ModuleBaseOptions, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.js';
2
2
  export { rpcCall } from './rpc.js';
3
3
  export * from '@scayle/storefront-core';
4
4
  export { LogLevel } from '@scayle/storefront-core';
package/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { M as ModuleBaseOptions } from './shared/storefront-nuxt.d852fe87.mjs';
3
- export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.d852fe87.mjs';
2
+ import { M as ModuleBaseOptions } from './shared/storefront-nuxt.891170da.mjs';
3
+ export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.mjs';
4
4
  export { LogLevel } from '@scayle/storefront-core';
5
5
  import '@scayle/unstorage-compression-driver';
6
6
  import 'unstorage';
package/dist/module.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
- import { M as ModuleBaseOptions } from './shared/storefront-nuxt.d852fe87.js';
3
- export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.d852fe87.js';
2
+ import { M as ModuleBaseOptions } from './shared/storefront-nuxt.891170da.js';
3
+ export { e as AdditionalShopConfig, A as AppKeys, B as BapiConfig, i as CheckoutEvent, C as CheckoutShopConfig, j as ModulePublicRuntimeConfig, P as PublicShopConfig, R as RedisConfig, d as SapiConfig, a as SessionConfig, f as ShopConfig, g as ShopConfigIndexed, c as StorageConfig, b as StorageEntity, S as StorageProvider, h as StorefrontConfig } from './shared/storefront-nuxt.891170da.js';
4
4
  export { LogLevel } from '@scayle/storefront-core';
5
5
  import '@scayle/unstorage-compression-driver';
6
6
  import 'unstorage';
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "7.84.4",
3
+ "version": "7.84.5",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -66,7 +66,7 @@ export default {
66
66
  }`;
67
67
  }
68
68
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
69
- const PACKAGE_VERSION = "7.84.4";
69
+ const PACKAGE_VERSION = "7.84.5";
70
70
  const logger = createConsola({
71
71
  fancy: true,
72
72
  formatOptions: {
package/dist/rpc.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
2
2
  import { NuxtApp } from 'nuxt/app';
3
- import { P as PublicShopConfig } from './shared/storefront-nuxt.d852fe87.mjs';
3
+ import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.mjs';
4
4
  import '@scayle/unstorage-compression-driver';
5
5
  import 'unstorage';
6
6
  import 'zod';
package/dist/rpc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
2
2
  import { NuxtApp } from 'nuxt/app';
3
- import { P as PublicShopConfig } from './shared/storefront-nuxt.d852fe87.js';
3
+ import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.js';
4
4
  import '@scayle/unstorage-compression-driver';
5
5
  import 'unstorage';
6
6
  import 'zod';
@@ -10,6 +10,9 @@ import { computed } from "vue";
10
10
  import { getCurrentPage } from "../../utils/route.mjs";
11
11
  import { useRoute, useRouter } from "#imports";
12
12
  const DEFAULT_QUERY_KEYS = ["page", "sort", "term"];
13
+ function queryValueToString(value) {
14
+ return Array.isArray(value) ? value.map((v) => v?.toString()).filter(Boolean).join(",") : value?.toString();
15
+ }
13
16
  export function useQueryFilterState(options = {}) {
14
17
  const router = useRouter();
15
18
  const route = useRoute();
@@ -17,7 +20,7 @@ export function useQueryFilterState(options = {}) {
17
20
  const allowedFilters = Object.fromEntries(
18
21
  Object.entries(route.query).filter(
19
22
  ([key]) => !DEFAULT_QUERY_KEYS.includes(key)
20
- )
23
+ ).map(([key, value]) => [key, queryValueToString(value)]).filter(([_key, value]) => !!value)
21
24
  );
22
25
  return deserializeFilters(allowedFilters);
23
26
  });
@@ -1,21 +1,4 @@
1
1
  import { Log } from "./log.mjs";
2
- function prepareData(data) {
3
- if (!data) {
4
- return data;
5
- }
6
- if (data.response) {
7
- const { response, message, name, code, ...other } = data;
8
- return {
9
- message,
10
- name,
11
- code,
12
- status: response?.status,
13
- statusText: response?.statusText,
14
- ...other
15
- };
16
- }
17
- return data;
18
- }
19
2
  const levelMap = {
20
3
  error: 0,
21
4
  warn: 1,
@@ -30,7 +13,7 @@ export default function createLog(createConsola, space = "default-storefront", l
30
13
  level: toConsolaLogLevel(level)
31
14
  });
32
15
  const handler = (entry) => {
33
- const data = prepareData(entry.data);
16
+ const data = entry.data;
34
17
  const log = logger[entry.level] || logger.info;
35
18
  const message = `[${entry.space}] ${entry.message}`;
36
19
  const args = data ? [message, data] : [message];
@@ -3,7 +3,7 @@ export interface LogEntry {
3
3
  level: LogLevel;
4
4
  space: string;
5
5
  message: string;
6
- data?: object;
6
+ data?: object | undefined;
7
7
  }
8
8
  export type LogHandler = (entry: LogEntry) => void;
9
9
  export interface LogOptions {
@@ -20,11 +20,11 @@ export declare class Log {
20
20
  _space: string;
21
21
  _type: string;
22
22
  constructor(options?: LogOptions);
23
- debug(message: string, data?: any): void;
24
- info(message: string, data?: any): void;
25
- warn(message: string, data?: any): void;
26
- error(message: string | Error, data?: any): void;
27
- write(level: LogLevel, message: string, data?: any): void;
23
+ debug(message: string, data?: unknown): void;
24
+ info(message: string, data?: unknown): void;
25
+ warn(message: string, data?: unknown): void;
26
+ error(message: string | Error, data?: unknown): void;
27
+ write(level: LogLevel, message: string, data?: unknown): void;
28
28
  /**
29
29
  * Create a new sub-space.
30
30
  * All spaces are being separated by a dot. E.g. `global.api` and `global.api.getUser`
@@ -1,3 +1,9 @@
1
+ function dataToObject(data) {
2
+ if (data === null || data === void 0) {
3
+ return void 0;
4
+ }
5
+ return typeof data !== "object" ? { data } : data;
6
+ }
1
7
  export class Log {
2
8
  static default = new this({
3
9
  space: "global",
@@ -24,18 +30,16 @@ export class Log {
24
30
  if (error) {
25
31
  data = {
26
32
  error: message,
27
- ...data
33
+ ...dataToObject(data)
28
34
  };
29
35
  }
30
36
  this.write("error", error?.message ?? message, data);
31
37
  }
32
38
  write(level, message, data) {
33
- if (typeof data !== "undefined") {
34
- data = typeof data !== "object" ? { data } : data;
35
- }
39
+ const d = dataToObject(data);
36
40
  if (this._handler) {
37
41
  try {
38
- this._handler({ level, message, data, space: this._space });
42
+ this._handler({ level, message, data: d, space: this._space });
39
43
  } catch (e) {
40
44
  console.error(`Error writing log message: "${message}" -- ${e}`);
41
45
  }
@@ -1124,9 +1124,9 @@ type SessionConfig = SessionType & {
1124
1124
  */
1125
1125
  type RedisConfig = RedisConfigType;
1126
1126
  type CustomDriverName = string & {
1127
- _custom?: any;
1127
+ _custom?: unknown;
1128
1128
  };
1129
- type StorageEntity<Driver extends BuiltinDriverName | CustomDriverName = any, DriverOptions = Driver extends keyof BuiltinDriverOptions ? BuiltinDriverOptions[Driver] : any> = {
1129
+ type StorageEntity<Driver extends BuiltinDriverName | CustomDriverName, DriverOptions = Driver extends keyof BuiltinDriverOptions ? BuiltinDriverOptions[Driver] : unknown> = {
1130
1130
  driver: Driver;
1131
1131
  compression?: CompressionEncodings;
1132
1132
  } & DriverOptions;
@@ -1124,9 +1124,9 @@ type SessionConfig = SessionType & {
1124
1124
  */
1125
1125
  type RedisConfig = RedisConfigType;
1126
1126
  type CustomDriverName = string & {
1127
- _custom?: any;
1127
+ _custom?: unknown;
1128
1128
  };
1129
- type StorageEntity<Driver extends BuiltinDriverName | CustomDriverName = any, DriverOptions = Driver extends keyof BuiltinDriverOptions ? BuiltinDriverOptions[Driver] : any> = {
1129
+ type StorageEntity<Driver extends BuiltinDriverName | CustomDriverName, DriverOptions = Driver extends keyof BuiltinDriverOptions ? BuiltinDriverOptions[Driver] : unknown> = {
1130
1130
  driver: Driver;
1131
1131
  compression?: CompressionEncodings;
1132
1132
  } & DriverOptions;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "7.84.4",
4
+ "version": "7.84.5",
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.64.0",
63
+ "@scayle/storefront-core": "7.64.1",
64
64
  "@scayle/unstorage-compression-driver": "^0.1.3",
65
65
  "@vueuse/core": "^10.11.0",
66
66
  "consola": "^3.2.3",
@@ -107,7 +107,7 @@
107
107
  },
108
108
  "resolutions": {
109
109
  "h3": "1.12.0",
110
- "vue": "3.4.36",
110
+ "vue": "3.4.37",
111
111
  "@nuxt/kit": "3.12.4",
112
112
  "@nuxt/schema": "3.12.4"
113
113
  },