@scayle/storefront-nuxt 8.26.2 → 8.28.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 +40 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/composables/storefront/useBasket.d.ts +2 -1
- package/dist/runtime/composables/storefront/useBasket.js +10 -0
- package/dist/runtime/composables/storefront/useCategoryTree.d.ts +9 -0
- package/dist/runtime/composables/storefront/useCategoryTree.js +9 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.28.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Introduced the `useCategoryTree` composable for streamlined category tree retrieval.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
const { data, status, error } = useCategoryTree({
|
|
11
|
+
params: {
|
|
12
|
+
children: 10,
|
|
13
|
+
includeHidden: true,
|
|
14
|
+
properties: { withName: ['sale'] },
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
**Dependencies**
|
|
22
|
+
|
|
23
|
+
**@scayle/storefront-core v8.28.0**
|
|
24
|
+
|
|
25
|
+
- Minor
|
|
26
|
+
- Introduced the `getCategoryTree` RPC for retrieving the complete category tree.
|
|
27
|
+
|
|
28
|
+
## 8.27.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- Updated `useBasket` to include a `getApplicablePromotionsByCode` function. This function fetches the applicable promotions for the current basket.
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
**Dependencies**
|
|
37
|
+
|
|
38
|
+
**@scayle/storefront-core v8.27.0**
|
|
39
|
+
|
|
40
|
+
- Minor
|
|
41
|
+
- Added a new `getApplicablePromotionsByCode` RPC method which can be used to fetch applicable promotions for a basket.
|
|
42
|
+
|
|
3
43
|
## 8.26.2
|
|
4
44
|
|
|
5
45
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { generateBasketKey } from '@scayle/storefront-core/dist/utils/keys';
|
|
2
|
-
import type { AddOrUpdateItemType, RpcMethodParameters, RpcMethodReturnType, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
|
|
2
|
+
import type { AddOrUpdateItemType, RpcMethodParameters, BasketResponseData, RpcMethodReturnType, BasketItem, Product, BasketTotalPrice } from '@scayle/storefront-core';
|
|
3
3
|
import { ExistingItemHandling } from '@scayle/storefront-core';
|
|
4
4
|
import { type NormalizedRpcResponse, type UseRpcReturn } from '../core/useRpc.js';
|
|
5
5
|
import { type MaybeRefOrGetter, type ComputedRef, type Ref } from 'vue';
|
|
@@ -21,6 +21,7 @@ type UseBasketBaseReturn = Omit<Awaited<UseRpcReturn<'getBasket'>>, 'data'> & {
|
|
|
21
21
|
addItems: (items: AddOrUpdateItemType[], existingItemHandling?: typeof ExistingItemHandling.ADD_QUANTITY_TO_EXISTING) => Promise<void>;
|
|
22
22
|
removeItemByKey: (itemKey: string) => Promise<void>;
|
|
23
23
|
updateItem: (basketItemKey: string, update: BasketItemUpdateData) => Promise<void>;
|
|
24
|
+
getApplicablePromotionsByCode: (promotionCode: string) => Promise<BasketResponseData>;
|
|
24
25
|
clear: () => Promise<void>;
|
|
25
26
|
items: ComputedRef<BasketItem[] | undefined>;
|
|
26
27
|
cost: ComputedRef<BasketTotalPrice | undefined>;
|
|
@@ -26,6 +26,9 @@ export function useBasket({
|
|
|
26
26
|
const mergeBasketsRpc = useRpcCall("mergeBaskets");
|
|
27
27
|
const clearBasketRpc = useRpcCall("clearBasket");
|
|
28
28
|
const removeItemFromBasketRpc = useRpcCall("removeItemFromBasket");
|
|
29
|
+
const getApplicablePromotionsByCodeRpc = useRpcCall(
|
|
30
|
+
"getApplicablePromotionsByCode"
|
|
31
|
+
);
|
|
29
32
|
const sanitizedParams = computed(() => {
|
|
30
33
|
const rawParams = toValue(params);
|
|
31
34
|
if (rawParams && "orderCustomData" in rawParams) {
|
|
@@ -154,6 +157,12 @@ export function useBasket({
|
|
|
154
157
|
});
|
|
155
158
|
data.value = basket;
|
|
156
159
|
};
|
|
160
|
+
const getApplicablePromotionsByCode = async (promotionCode) => {
|
|
161
|
+
const { basket } = await getApplicablePromotionsByCodeRpc({
|
|
162
|
+
promotionCode
|
|
163
|
+
});
|
|
164
|
+
return basket;
|
|
165
|
+
};
|
|
157
166
|
const clear = async () => {
|
|
158
167
|
await clearBasketRpc();
|
|
159
168
|
};
|
|
@@ -217,6 +226,7 @@ export function useBasket({
|
|
|
217
226
|
removeItemByKey,
|
|
218
227
|
updateItem,
|
|
219
228
|
clear,
|
|
229
|
+
getApplicablePromotionsByCode,
|
|
220
230
|
key: basketKey,
|
|
221
231
|
packages,
|
|
222
232
|
shippingDates,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { type KeysOf, type NormalizedRpcResponse, type UseRpcOptions, type UseRpcReturn } from '../core/useRpc.js';
|
|
3
|
+
import type { RpcMethodParameters } from '@scayle/storefront-core';
|
|
4
|
+
type UseCategoriesBaseReturn<DataT, PickKeys extends KeysOf<DataT>, DefaultT> = Awaited<UseRpcReturn<'getCategoryTree', DataT, PickKeys, DefaultT>> & Promise<Awaited<UseRpcReturn<'getCategoryTree', DataT, PickKeys, DefaultT>>>;
|
|
5
|
+
export declare function useCategoryTree<DataT = NormalizedRpcResponse<'getCategoryTree'>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: Partial<{
|
|
6
|
+
params: MaybeRefOrGetter<RpcMethodParameters<'getCategoryTree'>>;
|
|
7
|
+
options: UseRpcOptions<'getCategoryTree', DataT, PickKeys, DefaultT>;
|
|
8
|
+
}>, key?: string): UseCategoriesBaseReturn<DataT, PickKeys, DefaultT>;
|
|
9
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.28.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"dependencies": {
|
|
82
82
|
"@opentelemetry/api": "^1.9.0",
|
|
83
83
|
"@scayle/h3-session": "0.6.1",
|
|
84
|
-
"@scayle/storefront-core": "8.
|
|
84
|
+
"@scayle/storefront-core": "8.28.0",
|
|
85
85
|
"@scayle/unstorage-compression-driver": "^0.2.7",
|
|
86
86
|
"@vercel/nft": "0.29.3",
|
|
87
87
|
"@vueuse/core": "13.2.0",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@scayle/eslint-config-storefront": "4.5.2",
|
|
111
111
|
"@scayle/eslint-plugin-vue-composable": "0.2.1",
|
|
112
112
|
"@scayle/unstorage-scayle-kv-driver": "0.1.2",
|
|
113
|
-
"@types/node": "22.15.
|
|
113
|
+
"@types/node": "22.15.21",
|
|
114
114
|
"dprint": "0.50.0",
|
|
115
115
|
"eslint-formatter-gitlab": "6.0.0",
|
|
116
116
|
"eslint": "9.27.0",
|