@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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 7.85.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Update @nuxt/module-builder to 0.7.1
8
+
9
+ ## 7.85.9
10
+
11
+ ### Patch Changes
12
+
13
+ - Update @nuxt/module-builder to 0.6.0
14
+
3
15
  ## 7.85.8
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,23 +1,13 @@
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
- export { rpcCall } from './rpc.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.80aa5060.mjs';
2
+ export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
3
+ export { extendPromise } from '../dist/runtime/utils/promise.js';
3
4
  export * from '@scayle/storefront-core';
4
5
  export { LogLevel } from '@scayle/storefront-core';
5
6
  export { unwrap } from '@scayle/storefront-core/dist/utils/response';
6
7
  import '@scayle/unstorage-compression-driver';
7
8
  import 'unstorage';
8
- import 'zod';
9
+ import '../dist/runtime/utils/zodSchema.js';
9
10
  import '@nuxt/schema';
10
- import 'nuxt/app';
11
-
12
- /**
13
- * This function accepts a Promise which has the same interface as its resolved value.
14
- * It returns a new Promise which extends the original Promise and the original Promise's resolve value
15
- * with all the properties in source.
16
- * @param promise
17
- * @param source
18
- * @returns
19
- */
20
- declare function extendPromise<T extends object, U>(promise: T & Promise<T>, source: U): T & U & Promise<T & U>;
21
11
 
22
12
  interface RpcMethodsStorefront {
23
13
  }
@@ -26,4 +16,4 @@ declare module '@scayle/storefront-core' {
26
16
  }
27
17
  }
28
18
 
29
- export { type RpcMethodsStorefront, extendPromise };
19
+ export type { RpcMethodsStorefront };
package/dist/index.d.ts CHANGED
@@ -1,23 +1,13 @@
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
- export { rpcCall } from './rpc.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.80aa5060.js';
2
+ export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
3
+ export { extendPromise } from '../dist/runtime/utils/promise.js';
3
4
  export * from '@scayle/storefront-core';
4
5
  export { LogLevel } from '@scayle/storefront-core';
5
6
  export { unwrap } from '@scayle/storefront-core/dist/utils/response';
6
7
  import '@scayle/unstorage-compression-driver';
7
8
  import 'unstorage';
8
- import 'zod';
9
+ import '../dist/runtime/utils/zodSchema.js';
9
10
  import '@nuxt/schema';
10
- import 'nuxt/app';
11
-
12
- /**
13
- * This function accepts a Promise which has the same interface as its resolved value.
14
- * It returns a new Promise which extends the original Promise and the original Promise's resolve value
15
- * with all the properties in source.
16
- * @param promise
17
- * @param source
18
- * @returns
19
- */
20
- declare function extendPromise<T extends object, U>(promise: T & Promise<T>, source: U): T & U & Promise<T & U>;
21
11
 
22
12
  interface RpcMethodsStorefront {
23
13
  }
@@ -26,4 +16,4 @@ declare module '@scayle/storefront-core' {
26
16
  }
27
17
  }
28
18
 
29
- export { type RpcMethodsStorefront, extendPromise };
19
+ export type { RpcMethodsStorefront };
package/dist/index.mjs CHANGED
@@ -1,18 +1,4 @@
1
- export { rpcCall } from './rpc.mjs';
1
+ export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
2
+ export { extendPromise } from '../dist/runtime/utils/promise.js';
2
3
  export * from '@scayle/storefront-core';
3
4
  export { unwrap } from '@scayle/storefront-core/dist/utils/response';
4
-
5
- function extendPromise(promise, source) {
6
- const newPromise = promise.then(
7
- (result) => Object.assign(result, source)
8
- );
9
- const withoutPromise = Object.assign({}, promise);
10
- for (const key of Object.getOwnPropertyNames(
11
- Promise.prototype
12
- )) {
13
- delete withoutPromise[key];
14
- }
15
- return Object.assign(newPromise, Object.assign(withoutPromise, source));
16
- }
17
-
18
- export { extendPromise };
package/dist/module.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
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';
2
+ import { M as ModuleBaseOptions } from './shared/storefront-nuxt.80aa5060.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.80aa5060.mjs';
4
4
  export { LogLevel } from '@scayle/storefront-core';
5
5
  import '@scayle/unstorage-compression-driver';
6
6
  import 'unstorage';
7
- import 'zod';
7
+ import '../dist/runtime/utils/zodSchema.js';
8
8
 
9
- declare const _default: _nuxt_schema.NuxtModule<Omit<ModuleBaseOptions, "sapi" | "bapi">>;
9
+ declare const _default: _nuxt_schema.NuxtModule<ModuleBaseOptions, ModuleBaseOptions, false>;
10
10
 
11
11
  export { ModuleBaseOptions, _default as default };
package/dist/module.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
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';
2
+ import { M as ModuleBaseOptions } from './shared/storefront-nuxt.80aa5060.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.80aa5060.js';
4
4
  export { LogLevel } from '@scayle/storefront-core';
5
5
  import '@scayle/unstorage-compression-driver';
6
6
  import 'unstorage';
7
- import 'zod';
7
+ import '../dist/runtime/utils/zodSchema.js';
8
8
 
9
- declare const _default: _nuxt_schema.NuxtModule<Omit<ModuleBaseOptions, "sapi" | "bapi">>;
9
+ declare const _default: _nuxt_schema.NuxtModule<ModuleBaseOptions, ModuleBaseOptions, false>;
10
10
 
11
11
  export { ModuleBaseOptions, _default as default };
package/dist/module.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "7.85.8",
3
+ "version": "7.85.10",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
7
+ },
8
+ "builder": {
9
+ "@nuxt/module-builder": "0.7.1",
10
+ "unbuild": "2.0.0"
7
11
  }
8
12
  }
package/dist/module.mjs CHANGED
@@ -4,30 +4,7 @@ import { defu } from 'defu';
4
4
  import { genImport, genSafeVariableName } from 'knitwork';
5
5
  import { builtinDrivers } from 'unstorage';
6
6
  import { createConsola } from 'consola';
7
- import 'h3';
8
- import { joinURL } from 'ufo';
9
-
10
- const convertShopsToList = (shops) => {
11
- if (Array.isArray(shops)) {
12
- return shops;
13
- }
14
- return Object.values(shops);
15
- };
16
- function getApiBasePath(storefrontConfig, shop, baseUrl) {
17
- const path = Array.isArray(shop.path) ? shop.path[0] : shop.path;
18
- const apiPath = shop.apiBasePath || storefrontConfig.apiBasePath || "/api";
19
- if (storefrontConfig.shopSelector === "path") {
20
- const pathElements = [path, apiPath].filter(Boolean);
21
- return joinURL(baseUrl, ...pathElements);
22
- } else if (storefrontConfig.shopSelector === "path_or_default") {
23
- if (shop.isDefault) {
24
- return joinURL(baseUrl, apiPath);
25
- }
26
- const pathElements = [path, apiPath].filter(Boolean);
27
- return joinURL(baseUrl, ...pathElements);
28
- }
29
- return joinURL(baseUrl, apiPath);
30
- }
7
+ import { convertShopsToList, getApiBasePath } from '../dist/runtime/server/middleware/bootstrap-utils.js';
31
8
 
32
9
  function stringToBoolean(value, defaultValue = false) {
33
10
  return value ? value.toLowerCase() === "true" : defaultValue;
@@ -71,7 +48,7 @@ export default {
71
48
  }`;
72
49
  }
73
50
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
74
- const PACKAGE_VERSION = "7.85.8";
51
+ const PACKAGE_VERSION = "7.85.10";
75
52
  const logger = createConsola({
76
53
  fancy: true,
77
54
  formatOptions: {
@@ -81,6 +58,9 @@ const logger = createConsola({
81
58
  defaults: {
82
59
  tag: PACKAGE_NAME
83
60
  }
61
+ // At runtime consola/basic will be loaded which supports the fancy option
62
+ // However when typechecking it will resolve to consola/browser which does have the fancy option
63
+ // This assertion avoids the typescript error
84
64
  });
85
65
  const module = defineNuxtModule({
86
66
  meta: {
package/dist/rpc.d.mts CHANGED
@@ -1,16 +1 @@
1
- import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
2
- import { NuxtApp } from 'nuxt/app';
3
- import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.mjs';
4
- import '@scayle/unstorage-compression-driver';
5
- import 'unstorage';
6
- import 'zod';
7
- import '@nuxt/schema';
8
-
9
- /**
10
- * rpcCall can be used to invoke an RPC method either on the client or server
11
- * It makes an HTTP request on the client and direct call on the server using $fetch
12
- * https://nuxt.com/docs/api/utils/dollarfetch
13
- */
14
- declare const rpcCall: <N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>, TakesParameters = P extends RpcContext ? undefined : boolean>(nuxtApp: NuxtApp, method: N, shop: PublicShopConfig) => TakesParameters extends undefined ? () => Promise<TResult> : (params: P) => Promise<TResult>;
15
-
16
- export { rpcCall };
1
+ export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
package/dist/rpc.d.ts CHANGED
@@ -1,16 +1 @@
1
- import { RpcMethodName, RpcMethodParameters, RpcMethodReturnType, RpcContext } from '@scayle/storefront-core';
2
- import { NuxtApp } from 'nuxt/app';
3
- import { P as PublicShopConfig } from './shared/storefront-nuxt.891170da.js';
4
- import '@scayle/unstorage-compression-driver';
5
- import 'unstorage';
6
- import 'zod';
7
- import '@nuxt/schema';
8
-
9
- /**
10
- * rpcCall can be used to invoke an RPC method either on the client or server
11
- * It makes an HTTP request on the client and direct call on the server using $fetch
12
- * https://nuxt.com/docs/api/utils/dollarfetch
13
- */
14
- declare const rpcCall: <N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>, TakesParameters = P extends RpcContext ? undefined : boolean>(nuxtApp: NuxtApp, method: N, shop: PublicShopConfig) => TakesParameters extends undefined ? () => Promise<TResult> : (params: P) => Promise<TResult>;
15
-
16
- export { rpcCall };
1
+ export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
package/dist/rpc.mjs CHANGED
@@ -1,20 +1 @@
1
- import { unwrap } from '@scayle/storefront-core/dist/utils/response';
2
-
3
- const rpcCall = (nuxtApp, method, shop) => {
4
- const fetch = nuxtApp.ssrContext?.event.$fetch ?? $fetch;
5
- return async (params = void 0) => {
6
- const data = await fetch(`${shop.apiBasePath ?? "/api"}/rpc/${method}`, {
7
- // @ts-expect-error Type '"POST"' is not assignable to type 'AvailableRouterMethod<`${string}/rpc/${N}`> | Uppercase<AvailableRouterMethod<`${string}/rpc/${N}`>> | undefined'.ts(2322)
8
- method: "POST",
9
- body: {
10
- payload: params
11
- },
12
- headers: {
13
- "x-shop-id": shop.shopId.toString()
14
- }
15
- });
16
- return await unwrap(data);
17
- };
18
- };
19
-
20
- export { rpcCall };
1
+ export { rpcCall } from '../dist/runtime/rpc/rpcCall.js';
@@ -1,6 +1,6 @@
1
1
  import { defineEventHandler, setResponseStatus } from "h3";
2
2
  import { HttpStatusCode } from "@scayle/storefront-core";
3
- import { eventHandlerWithCacheAuth } from "./cacheAuth.mjs";
3
+ import { eventHandlerWithCacheAuth } from "./cacheAuth.js";
4
4
  export default eventHandlerWithCacheAuth(
5
5
  defineEventHandler(async (event) => {
6
6
  const logger = event.context.$rpcContext.log.space("purge-all");
@@ -1,6 +1,6 @@
1
1
  import { defineEventHandler, setResponseStatus, readBody } from "h3";
2
2
  import { HttpStatusCode } from "@scayle/storefront-core";
3
- import { eventHandlerWithCacheAuth } from "./cacheAuth.mjs";
3
+ import { eventHandlerWithCacheAuth } from "./cacheAuth.js";
4
4
  export default eventHandlerWithCacheAuth(
5
5
  defineEventHandler(async (event) => {
6
6
  const tags = await readBody(event);
@@ -1,2 +1,56 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | true | string[] | import("@scayle/storefront-core").ShopUser | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant> | {
2
+ type: "failure";
3
+ statusCode: number;
4
+ basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
5
+ } | {
6
+ readonly type: "success";
7
+ readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
8
+ } | {
9
+ readonly type: "failure";
10
+ readonly basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
11
+ readonly errors: import("@scayle/storefront-api").AddOrUpdateItemError[];
12
+ } | import("@scayle/storefront-api").BrandsEndpointResponseData | import("@scayle/storefront-api").Brand | {
13
+ categories: import("@scayle/storefront-api").Category[];
14
+ activeNode: undefined;
15
+ } | import("@scayle/storefront-api").Category | {
16
+ categories: import("@scayle/storefront-api").Category;
17
+ activeNode: import("@scayle/storefront-api").Category;
18
+ } | import("@scayle/storefront-core").Order | {
19
+ category: string | undefined;
20
+ categoryId: number | undefined;
21
+ } | import("@scayle/storefront-api").Product[] | {
22
+ count: number;
23
+ } | {
24
+ filters: import("@scayle/storefront-api").FiltersEndpointResponseData;
25
+ unfilteredCount: number;
26
+ } | {
27
+ products: import("@scayle/storefront-api").Product[];
28
+ pagination: {
29
+ current: number;
30
+ total: number;
31
+ perPage: number;
32
+ page: number;
33
+ first: number;
34
+ prev: number;
35
+ next: number;
36
+ last: number;
37
+ };
38
+ } | import("@scayle/storefront-api").TypeaheadSuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
39
+ user: import("@scayle/storefront-core").ShopUser | undefined;
40
+ } | import("@scayle/storefront-api").Wishlist | Response | import("@scayle/storefront-core").ShopUserAddress[] | {
41
+ accessToken: string;
42
+ checkoutJwt: string;
43
+ } | import("@scayle/storefront-api").VariantDetail[] | import("@scayle/storefront-api").NavigationAllEndpointResponseData | import("@scayle/storefront-api").NavigationTree | {
44
+ success: true;
45
+ } | {
46
+ success: false;
47
+ } | {
48
+ result: true;
49
+ } | {
50
+ result: false;
51
+ } | import("@scayle/storefront-api").PromotionsEndpointResponseData | {
52
+ [k: string]: string;
53
+ } | {
54
+ message: string;
55
+ } | null | undefined>>;
2
56
  export default _default;
@@ -1,9 +1,9 @@
1
1
  import { defineEventHandler, readBody, createError, getRequestURL } from "h3";
2
2
  import { purifySensitiveData } from "@scayle/storefront-core";
3
3
  import { trace, SpanStatusCode } from "@opentelemetry/api";
4
- import { handler } from "../handler.mjs";
5
- import { resolveError } from "../error/handler.mjs";
6
- import { useNitroApp } from "#imports";
4
+ import { handler } from "../handler.js";
5
+ import { resolveError } from "../error/handler.js";
6
+ import { useNitroApp } from "nitropack/runtime";
7
7
  const tracer = trace.getTracer(
8
8
  "storefront-nuxt",
9
9
  "__sfc_version"
@@ -1,2 +1,2 @@
1
- import type { PublicShopConfig } from '../../../module';
2
- export declare function useAvailableShops(): import("vue").Ref<PublicShopConfig[]>;
1
+ import type { PublicShopConfig } from '../../../module.js';
2
+ export declare function useAvailableShops(): import("vue").Ref<PublicShopConfig[], PublicShopConfig[]>;
@@ -1,3 +1,3 @@
1
1
  import type { Ref } from 'vue';
2
- import type { PublicShopConfig } from '../../../module';
2
+ import type { PublicShopConfig } from '../../../module.js';
3
3
  export declare const useCurrentShop: () => Ref<PublicShopConfig>;
@@ -1,5 +1,5 @@
1
1
  import { getDefaultFractionDigits } from "@scayle/storefront-core";
2
- import { useCurrentShop } from "./useCurrentShop.mjs";
2
+ import { useCurrentShop } from "./useCurrentShop.js";
3
3
  export function useFormatHelpers() {
4
4
  const currentShop = useCurrentShop();
5
5
  const formatCurrency = (value, options) => {
@@ -1,6 +1,6 @@
1
1
  import type { MaybeRefOrGetter } from 'vue';
2
2
  import type { RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
3
- import { type UseRpcReturn } from '../core/useRpc';
3
+ import { type UseRpcReturn } from '../core/useRpc.js';
4
4
  type UseIDPBaseReturn = Pick<Awaited<UseRpcReturn<'getExternalIdpRedirect'>>, 'data' | 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
5
5
  handleIDPLoginCallback: (params: RpcMethodParameters<'handleIDPLoginCallback'>) => RpcMethodReturnType<'handleIDPLoginCallback'>;
6
6
  };
@@ -1,6 +1,6 @@
1
- import { useRpc } from "../core/useRpc.mjs";
2
- import { extendPromise } from "../../utils/promise.mjs";
3
- import { useRpcCall } from "../core/useRpcCall.mjs";
1
+ import { useRpc } from "../core/useRpc.js";
2
+ import { extendPromise } from "../../utils/promise.js";
3
+ import { useRpcCall } from "../core/useRpcCall.js";
4
4
  export function useIDP(params = {}, key) {
5
5
  const useRpcPromise = useRpc(
6
6
  "getExternalIdpRedirect",
@@ -1,8 +1,8 @@
1
1
  import { unwrap } from "@scayle/storefront-core/dist/utils/response";
2
2
  import { useNuxtApp, useAsyncData } from "nuxt/app";
3
- import { useCoreLog } from "../useCoreLog.mjs";
4
- import { useCurrentShop } from "./useCurrentShop.mjs";
5
- import { extendPromise } from "../../utils/promise.mjs";
3
+ import { useCoreLog } from "../useCoreLog.js";
4
+ import { useCurrentShop } from "./useCurrentShop.js";
5
+ import { extendPromise } from "../../utils/promise.js";
6
6
  import { toValue, computed, isRef } from "#imports";
7
7
  import { useRuntimeConfig } from "#app/nuxt";
8
8
  function getFetch(nuxtApp, log) {
@@ -1,6 +1,6 @@
1
- import { rpcCall } from "../../rpc/rpcCall.mjs";
1
+ import { rpcCall } from "../../rpc/rpcCall.js";
2
2
  import { useNuxtApp } from "nuxt/app";
3
- import { useCurrentShop } from "./useCurrentShop.mjs";
3
+ import { useCurrentShop } from "./useCurrentShop.js";
4
4
  export function useRpcCall(method) {
5
5
  const nuxtApp = useNuxtApp();
6
6
  const currentShop = useCurrentShop();
@@ -1,4 +1,4 @@
1
- import { useRpcCall } from "../core/useRpcCall.mjs";
1
+ import { useRpcCall } from "../core/useRpcCall.js";
2
2
  export function useSession() {
3
3
  return {
4
4
  login: useRpcCall("oauthLogin"),
@@ -1,5 +1,5 @@
1
1
  import type { ShopUser, UpdatePasswordParams } from '@scayle/storefront-core';
2
- import { type UseRpcReturn } from './useRpc';
2
+ import { type UseRpcReturn } from './useRpc.js';
3
3
  import { type ComputedRef } from '#imports';
4
4
  export type ExtendedUseUserParams = {
5
5
  key?: string;
@@ -1,10 +1,10 @@
1
1
  import { useNuxtApp } from "nuxt/app";
2
2
  import { computed } from "vue";
3
- import { useCoreLog } from "../useCoreLog.mjs";
4
- import { extendPromise } from "../../utils/promise.mjs";
5
- import { useRpc } from "./useRpc.mjs";
3
+ import { useCoreLog } from "../useCoreLog.js";
4
+ import { extendPromise } from "../../utils/promise.js";
5
+ import { useRpc } from "./useRpc.js";
6
6
  import { toValue } from "#imports";
7
- import { useRpcCall } from "../core/useRpcCall.mjs";
7
+ import { useRpcCall } from "../core/useRpcCall.js";
8
8
  export function useUser(options = {}) {
9
9
  const nuxtApp = useNuxtApp();
10
10
  const log = useCoreLog("useUser");
@@ -1,36 +1,36 @@
1
- export * from './core/useAvailableShops';
2
- export * from './core/useCurrentShop';
3
- export * from './core/useFormatHelpers';
4
- export * from './core/useIDP';
5
- export * from './core/useLog';
6
- export * from './core/useRpc';
7
- export * from './core/useRpcCall';
8
- export * from './core/useSession';
9
- export * from './core/useUser';
10
- export * from './storefront/useBasket';
11
- export * from './storefront/useBrand';
12
- export * from './storefront/useBrands';
13
- export * from './storefront/useCategories';
14
- export * from './storefront/useCategoryById';
15
- export * from './storefront/useCategoryByPath';
16
- export * from './storefront/useCurrentPromotions';
17
- export * from './storefront/useFacet';
18
- export * from './storefront/useFilters';
19
- export * from './storefront/useNavigationTree';
20
- export * from './storefront/useNavigationTrees';
21
- export * from './storefront/useOrder';
22
- export * from './storefront/useOrderConfirmation';
23
- export * from './storefront/useProduct';
24
- export * from './storefront/useProducts';
25
- export * from './storefront/useProductsByIds';
26
- export * from './storefront/useProductsByReferenceKeys';
27
- export * from './storefront/useProductsCount';
28
- export * from './storefront/usePromotions';
29
- export * from './storefront/usePromotionsByIds';
30
- export * from './storefront/useQueryFilterState';
31
- export * from './storefront/useSearch';
32
- export * from './storefront/useShopConfiguration';
33
- export * from './storefront/useStorefrontSearch';
34
- export * from './storefront/useUserAddresses';
35
- export * from './storefront/useVariant';
36
- export * from './storefront/useWishlist';
1
+ export * from './core/useAvailableShops.js';
2
+ export * from './core/useCurrentShop.js';
3
+ export * from './core/useFormatHelpers.js';
4
+ export * from './core/useIDP.js';
5
+ export * from './core/useLog.js';
6
+ export * from './core/useRpc.js';
7
+ export * from './core/useRpcCall.js';
8
+ export * from './core/useSession.js';
9
+ export * from './core/useUser.js';
10
+ export * from './storefront/useBasket.js';
11
+ export * from './storefront/useBrand.js';
12
+ export * from './storefront/useBrands.js';
13
+ export * from './storefront/useCategories.js';
14
+ export * from './storefront/useCategoryById.js';
15
+ export * from './storefront/useCategoryByPath.js';
16
+ export * from './storefront/useCurrentPromotions.js';
17
+ export * from './storefront/useFacet.js';
18
+ export * from './storefront/useFilters.js';
19
+ export * from './storefront/useNavigationTree.js';
20
+ export * from './storefront/useNavigationTrees.js';
21
+ export * from './storefront/useOrder.js';
22
+ export * from './storefront/useOrderConfirmation.js';
23
+ export * from './storefront/useProduct.js';
24
+ export * from './storefront/useProducts.js';
25
+ export * from './storefront/useProductsByIds.js';
26
+ export * from './storefront/useProductsByReferenceKeys.js';
27
+ export * from './storefront/useProductsCount.js';
28
+ export * from './storefront/usePromotions.js';
29
+ export * from './storefront/usePromotionsByIds.js';
30
+ export * from './storefront/useQueryFilterState.js';
31
+ export * from './storefront/useSearch.js';
32
+ export * from './storefront/useShopConfiguration.js';
33
+ export * from './storefront/useStorefrontSearch.js';
34
+ export * from './storefront/useUserAddresses.js';
35
+ export * from './storefront/useVariant.js';
36
+ export * from './storefront/useWishlist.js';
@@ -0,0 +1,36 @@
1
+ export * from "./core/useAvailableShops.js";
2
+ export * from "./core/useCurrentShop.js";
3
+ export * from "./core/useFormatHelpers.js";
4
+ export * from "./core/useIDP.js";
5
+ export * from "./core/useLog.js";
6
+ export * from "./core/useRpc.js";
7
+ export * from "./core/useRpcCall.js";
8
+ export * from "./core/useSession.js";
9
+ export * from "./core/useUser.js";
10
+ export * from "./storefront/useBasket.js";
11
+ export * from "./storefront/useBrand.js";
12
+ export * from "./storefront/useBrands.js";
13
+ export * from "./storefront/useCategories.js";
14
+ export * from "./storefront/useCategoryById.js";
15
+ export * from "./storefront/useCategoryByPath.js";
16
+ export * from "./storefront/useCurrentPromotions.js";
17
+ export * from "./storefront/useFacet.js";
18
+ export * from "./storefront/useFilters.js";
19
+ export * from "./storefront/useNavigationTree.js";
20
+ export * from "./storefront/useNavigationTrees.js";
21
+ export * from "./storefront/useOrder.js";
22
+ export * from "./storefront/useOrderConfirmation.js";
23
+ export * from "./storefront/useProduct.js";
24
+ export * from "./storefront/useProducts.js";
25
+ export * from "./storefront/useProductsByIds.js";
26
+ export * from "./storefront/useProductsByReferenceKeys.js";
27
+ export * from "./storefront/useProductsCount.js";
28
+ export * from "./storefront/usePromotions.js";
29
+ export * from "./storefront/usePromotionsByIds.js";
30
+ export * from "./storefront/useQueryFilterState.js";
31
+ export * from "./storefront/useSearch.js";
32
+ export * from "./storefront/useShopConfiguration.js";
33
+ export * from "./storefront/useStorefrontSearch.js";
34
+ export * from "./storefront/useUserAddresses.js";
35
+ export * from "./storefront/useVariant.js";
36
+ export * from "./storefront/useWishlist.js";
@@ -1,6 +1,6 @@
1
1
  import type { AddOrUpdateItemType, RpcMethodParameters, RpcMethodReturnType, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
2
2
  import { ExistingItemHandling } from '@scayle/storefront-core';
3
- import { type UseRpcReturn } from '../core/useRpc';
3
+ import { type UseRpcReturn } from '../core/useRpc.js';
4
4
  import { type MaybeRefOrGetter, type ComputedRef } from '#imports';
5
5
  import type { BasketKey, BasketPackageInformation } from '@scayle/storefront-api';
6
6
  type UseBasketOptions = Partial<{
@@ -8,9 +8,9 @@ import {
8
8
  } from "@scayle/storefront-core";
9
9
  import { useNuxtApp } from "nuxt/app";
10
10
  import { computed } from "vue";
11
- import { extendPromise } from "../../utils/promise.mjs";
12
- import { useRpc } from "../core/useRpc.mjs";
13
- import { useRpcCall } from "../core/useRpcCall.mjs";
11
+ import { extendPromise } from "../../utils/promise.js";
12
+ import { useRpc } from "../core/useRpc.js";
13
+ import { useRpcCall } from "../core/useRpcCall.js";
14
14
  import {
15
15
  toValue,
16
16
  toRef
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc';
2
+ import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  export declare function useBrand<DataT = NormalizedRpcResponse<'getBrandById'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, key: _key, }?: Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getBrandById'>>;
@@ -1,4 +1,4 @@
1
- import { useRpc } from "../core/useRpc.mjs";
1
+ import { useRpc } from "../core/useRpc.js";
2
2
  export function useBrand({
3
3
  params,
4
4
  options,
@@ -1,5 +1,5 @@
1
1
  import type { RpcMethodParameters } from '@scayle/storefront-core';
2
- import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc';
2
+ import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
3
3
  import type { MaybeRefOrGetter } from '#imports';
4
4
  export declare function useBrands<DataT = NormalizedRpcResponse<'getBrands'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, key: _key, }?: Partial<{
5
5
  params: MaybeRefOrGetter<RpcMethodParameters<'getBrands'>>;
@@ -1,4 +1,4 @@
1
- import { useRpc } from "../core/useRpc.mjs";
1
+ import { useRpc } from "../core/useRpc.js";
2
2
  export function useBrands({
3
3
  params,
4
4
  options,