@scayle/storefront-nuxt 8.36.0 → 8.37.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @scayle/storefront-nuxt
2
2
 
3
+ ## 8.37.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Created the composable `useCampaign` which uses the RPC `getCampaign` to fetch the first active campaign
8
+
9
+ ### Patch Changes
10
+
11
+ **Dependencies**
12
+
13
+ **@scayle/storefront-core v8.37.0**
14
+
15
+ - Minor
16
+ - The `where` parameter for the `getProductsByCategory` and `getProductsCount` RPCs was extended to include the previously missing options `sellableAt`, `hasCampaignReduction`, and `containsSearch`.
17
+ - Patch
18
+ - Added missing export of the RPC `getCampaign`
19
+
3
20
  ## 8.36.0
4
21
 
5
22
  ### Patch Changes
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
- "version": "8.36.0",
3
+ "version": "8.37.0",
4
4
  "configKey": "storefront",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.9.0"
package/dist/module.mjs CHANGED
@@ -54,7 +54,7 @@ export default {
54
54
  }`;
55
55
  }
56
56
  const PACKAGE_NAME = "@scayle/storefront-nuxt";
57
- const PACKAGE_VERSION = "8.36.0";
57
+ const PACKAGE_VERSION = "8.37.0";
58
58
  const logger = createConsola({
59
59
  fancy: true,
60
60
  formatOptions: {
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * @returns The result of the RPC call or a `Response` object with an error status.
12
12
  */
13
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | boolean | void | string[] | import("@scayle/storefront-core").ShopUser | Record<string, string> | Response | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").Product[] | import("@scayle/storefront-core").FetchProductsCountResponse | import("@scayle/storefront-core").FetchFiltersResponse | import("@scayle/storefront-core").FetchProductsByCategoryResponse | {
13
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | boolean | void | string[] | import("@scayle/storefront-api").Campaign | import("@scayle/storefront-core").ShopUser | Record<string, string> | Response | import("@scayle/storefront-api").Product | import("@scayle/storefront-api").Product[] | import("@scayle/storefront-core").FetchProductsCountResponse | import("@scayle/storefront-core").FetchFiltersResponse | import("@scayle/storefront-core").FetchProductsByCategoryResponse | {
14
14
  basket: import("@scayle/storefront-api").BasketResponseData<import("@scayle/storefront-api").Product, import("@scayle/storefront-api").Variant>;
15
15
  } | {
16
16
  fromBasketKey: string;
@@ -10,6 +10,7 @@ export * from './core/useUser.js';
10
10
  export * from './storefront/useBasket.js';
11
11
  export * from './storefront/useBrand.js';
12
12
  export * from './storefront/useBrands.js';
13
+ export * from './storefront/useCampaign.js';
13
14
  export * from './storefront/useCategories.js';
14
15
  export * from './storefront/useCategoryById.js';
15
16
  export * from './storefront/useCategoryByPath.js';
@@ -10,6 +10,7 @@ export * from "./core/useUser.js";
10
10
  export * from "./storefront/useBasket.js";
11
11
  export * from "./storefront/useBrand.js";
12
12
  export * from "./storefront/useBrands.js";
13
+ export * from "./storefront/useCampaign.js";
13
14
  export * from "./storefront/useCategories.js";
14
15
  export * from "./storefront/useCategoryById.js";
15
16
  export * from "./storefront/useCategoryByPath.js";
@@ -0,0 +1,18 @@
1
+ import type { UseRpcOptions, UseRpcReturn, NormalizedRpcResponse, KeysOf } from '../core/useRpc.js';
2
+ /**
3
+ * Retrieves the first active campaign.
4
+ *
5
+ * This function acts as a wrapper around the `useRpc` composable,
6
+ * simplifying the process of fetching data. It internally calls `useRpc`
7
+ * with the provided parameters and options.
8
+ *
9
+ * @param params An object containing parameters and options for the `getCampaign` RPC call.
10
+ * @param params.options The options for the underlying `useRpc` call, controlling data handling and loading state.
11
+ * @param key A unique key for this RPC call. Used internally by `useRpc` for caching and state management.
12
+ *
13
+ * @returns The result of the `useRpc` call, which includes the fetched campaign data,
14
+ * loading state, and any error information.
15
+ */
16
+ export declare function useCampaign<DataT = NormalizedRpcResponse<'getCampaign'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ options, }?: Partial<{
17
+ options: UseRpcOptions<'getCampaign', DataT, PickKeys, DefaultT>;
18
+ }>, key?: string): UseRpcReturn<'getCampaign', DataT, PickKeys, DefaultT>;
@@ -0,0 +1,11 @@
1
+ import { useRpc } from "../core/useRpc.js";
2
+ export function useCampaign({
3
+ options
4
+ } = {}, key = "useCampaign") {
5
+ return useRpc(
6
+ "getCampaign",
7
+ key,
8
+ void 0,
9
+ options
10
+ );
11
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scayle/storefront-nuxt",
3
3
  "type": "module",
4
- "version": "8.36.0",
4
+ "version": "8.37.0",
5
5
  "description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
6
6
  "author": "SCAYLE Commerce Engine",
7
7
  "license": "MIT",
@@ -90,7 +90,7 @@
90
90
  "utility-types": "^3.11.0",
91
91
  "vue-router": "^4.4.0",
92
92
  "zod": "^4.0.0",
93
- "@scayle/storefront-core": "8.36.0",
93
+ "@scayle/storefront-core": "8.37.0",
94
94
  "@scayle/unstorage-compression-driver": "1.0.0"
95
95
  },
96
96
  "devDependencies": {