@scayle/storefront-nuxt 8.41.3 → 8.42.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,158 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.42.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added `promotions` field to `BasketItem` type to support multiple promotions per basket item.
|
|
8
|
+
|
|
9
|
+
The `promotions` field is an array of `BasketItemPromotion` objects.
|
|
10
|
+
With the introduction of the new `promotions` array field, the `promotion` field is now deprecated.
|
|
11
|
+
|
|
12
|
+
Before:
|
|
13
|
+
|
|
14
|
+
```json
|
|
15
|
+
"promotion": {
|
|
16
|
+
"id": "123",
|
|
17
|
+
"name": "Promotion 1",
|
|
18
|
+
"isActive": true,
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
After:
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
"promotions": [{
|
|
26
|
+
"id": "123",
|
|
27
|
+
"name": "Promotion 1",
|
|
28
|
+
"isActive": true,
|
|
29
|
+
}]
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For more details, see the [Storefront API documentation](https://scayle.dev/en/api-guides/storefront-api/resources/baskets/get-a-basket).
|
|
33
|
+
|
|
34
|
+
- Updated the parameters of the RPC functions `updateBasketItemRpc` and `updateBasketItem` with the new `promotions` attribute.
|
|
35
|
+
|
|
36
|
+
This attribute is used to support multiple promotions on basket items.
|
|
37
|
+
|
|
38
|
+
Before:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
const updateBasketItemRpc = useRpcCall('updateBasketItem')
|
|
42
|
+
const addItemToBasketRpc = useRpcCall('addItemToBasket')
|
|
43
|
+
|
|
44
|
+
updateBasketItemRpc({
|
|
45
|
+
// ...
|
|
46
|
+
promotionId: 'promotionId',
|
|
47
|
+
promotionCode: 'promotionCode',
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
addItemToBasketRpc({
|
|
51
|
+
// ...
|
|
52
|
+
promotionId: 'promotionId',
|
|
53
|
+
promotionCode: 'promotionCode',
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
// Or with useBasket composable
|
|
57
|
+
|
|
58
|
+
const { addItem } = useBasket()
|
|
59
|
+
addItem({
|
|
60
|
+
// ...
|
|
61
|
+
promotionId: 'promotionId',
|
|
62
|
+
})
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After:
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
const updateBasketItemRpc = useRpcCall('updateBasketItem')
|
|
69
|
+
const addItemToBasketRpc = useRpcCall('addItemToBasket')
|
|
70
|
+
|
|
71
|
+
updateBasketItemRpc({
|
|
72
|
+
// ...
|
|
73
|
+
promotions: [
|
|
74
|
+
{ id: 'promotionId', code: 'promotionCode' },
|
|
75
|
+
{
|
|
76
|
+
id: 'promotionId2',
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
addItemToBasketRpc({
|
|
82
|
+
// ...
|
|
83
|
+
promotions: [
|
|
84
|
+
{ id: 'promotionId', code: 'promotionCode' },
|
|
85
|
+
{
|
|
86
|
+
id: 'promotionId2',
|
|
87
|
+
},
|
|
88
|
+
],
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
// Or for useBasket with composable
|
|
92
|
+
|
|
93
|
+
const { addItem } = useBasket()
|
|
94
|
+
addItem({
|
|
95
|
+
// ...
|
|
96
|
+
promotions: [
|
|
97
|
+
{ id: 'promotionId', code: 'promotionCode' },
|
|
98
|
+
{
|
|
99
|
+
id: 'promotionId2',
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
})
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
For more details, see the [Add a variant](https://scayle.dev/en/api-guides/storefront-api/resources/baskets/add-a-variant) and [Update an item](https://scayle.dev/en/api-guides/storefront-api/resources/baskets/update-an-item) guides.
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
**Dependencies**
|
|
110
|
+
|
|
111
|
+
**@scayle/storefront-core v8.42.0**
|
|
112
|
+
|
|
113
|
+
- Minor
|
|
114
|
+
|
|
115
|
+
- Added `promotions` field to `BasketItem` type to support multiple promotions per basket item.
|
|
116
|
+
|
|
117
|
+
The `promotions` field is an array of `BasketItemPromotion` objects.
|
|
118
|
+
With the introduction of the new `promotions` array field, the `promotion` field is now deprecated.
|
|
119
|
+
|
|
120
|
+
Before:
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
"promotion": {
|
|
124
|
+
"id": "123",
|
|
125
|
+
"name": "Promotion 1",
|
|
126
|
+
"isActive": true,
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
After:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
"promotions": [{
|
|
134
|
+
"id": "123",
|
|
135
|
+
"name": "Promotion 1",
|
|
136
|
+
"isActive": true,
|
|
137
|
+
}]
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
For more details, see the [Storefront API documentation](https://scayle.dev/en/api-guides/storefront-api/resources/baskets/get-a-basket).
|
|
141
|
+
|
|
142
|
+
## 8.41.4
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- Updated dependency `@vercel/nft@0.30.0` to `@vercel/nft@0.30.1`
|
|
147
|
+
|
|
148
|
+
**Dependencies**
|
|
149
|
+
|
|
150
|
+
- Updated dependency to @scayle/unstorage-compression-driver@1.1.0
|
|
151
|
+
|
|
152
|
+
**@scayle/storefront-core v8.41.4**
|
|
153
|
+
|
|
154
|
+
- No changes in this release.
|
|
155
|
+
|
|
3
156
|
## 8.41.3
|
|
4
157
|
|
|
5
158
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -51,6 +51,7 @@ export function useBasket({
|
|
|
51
51
|
const addItem = async ({
|
|
52
52
|
variantId,
|
|
53
53
|
promotionId,
|
|
54
|
+
promotions,
|
|
54
55
|
quantity,
|
|
55
56
|
existingItemHandling,
|
|
56
57
|
displayData,
|
|
@@ -60,6 +61,7 @@ export function useBasket({
|
|
|
60
61
|
try {
|
|
61
62
|
const { basket, errors: basketErrors } = await addItemToBasketRpc({
|
|
62
63
|
promotionId,
|
|
64
|
+
promotions,
|
|
63
65
|
variantId,
|
|
64
66
|
quantity,
|
|
65
67
|
existingItemHandling,
|
|
@@ -122,7 +122,7 @@ declare const StorageSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
|
122
122
|
}>>;
|
|
123
123
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
124
124
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
125
|
-
}, z.core.$strip>]>;
|
|
125
|
+
}, z.core.$strip>], "driver">;
|
|
126
126
|
declare const CheckoutShopConfigSchema: z.ZodMiniObject<{
|
|
127
127
|
token: z.ZodMiniString<string>;
|
|
128
128
|
secret: z.ZodMiniString<string>;
|
|
@@ -275,7 +275,7 @@ declare const ShopConfigSchema: z.ZodMiniObject<{
|
|
|
275
275
|
}>>;
|
|
276
276
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
277
277
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
278
|
-
}, z.core.$strip>]>>;
|
|
278
|
+
}, z.core.$strip>], "driver">>;
|
|
279
279
|
cache: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
280
280
|
driver: z.ZodMiniEnum<{
|
|
281
281
|
null: "null";
|
|
@@ -354,7 +354,7 @@ declare const ShopConfigSchema: z.ZodMiniObject<{
|
|
|
354
354
|
}>>;
|
|
355
355
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
356
356
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
357
|
-
}, z.core.$strip>]>>;
|
|
357
|
+
}, z.core.$strip>], "driver">>;
|
|
358
358
|
}, z.core.$strip>>;
|
|
359
359
|
isDefault: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniString<string>]>>;
|
|
360
360
|
}, z.core.$strip>;
|
|
@@ -472,7 +472,7 @@ declare const StorefrontConfigSchema: z.ZodMiniObject<{
|
|
|
472
472
|
}>>;
|
|
473
473
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
474
474
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
475
|
-
}, z.core.$strip>]>>;
|
|
475
|
+
}, z.core.$strip>], "driver">>;
|
|
476
476
|
cache: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
477
477
|
driver: z.ZodMiniEnum<{
|
|
478
478
|
null: "null";
|
|
@@ -551,7 +551,7 @@ declare const StorefrontConfigSchema: z.ZodMiniObject<{
|
|
|
551
551
|
}>>;
|
|
552
552
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
553
553
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
554
|
-
}, z.core.$strip>]>>;
|
|
554
|
+
}, z.core.$strip>], "driver">>;
|
|
555
555
|
}, z.core.$strip>>;
|
|
556
556
|
oauth: z.ZodMiniObject<{
|
|
557
557
|
apiHost: z.ZodMiniURL;
|
|
@@ -767,7 +767,7 @@ export declare const RuntimeConfigSchema: z.ZodMiniObject<{
|
|
|
767
767
|
}>>;
|
|
768
768
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
769
769
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
770
|
-
}, z.core.$strip>]>>;
|
|
770
|
+
}, z.core.$strip>], "driver">>;
|
|
771
771
|
cache: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
772
772
|
driver: z.ZodMiniEnum<{
|
|
773
773
|
null: "null";
|
|
@@ -846,7 +846,7 @@ export declare const RuntimeConfigSchema: z.ZodMiniObject<{
|
|
|
846
846
|
}>>;
|
|
847
847
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
848
848
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
849
|
-
}, z.core.$strip>]>>;
|
|
849
|
+
}, z.core.$strip>], "driver">>;
|
|
850
850
|
}, z.core.$strip>>;
|
|
851
851
|
isDefault: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniString<string>]>>;
|
|
852
852
|
}, z.core.$strip>>;
|
|
@@ -958,7 +958,7 @@ export declare const RuntimeConfigSchema: z.ZodMiniObject<{
|
|
|
958
958
|
}>>;
|
|
959
959
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
960
960
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
961
|
-
}, z.core.$strip>]>>;
|
|
961
|
+
}, z.core.$strip>], "driver">>;
|
|
962
962
|
cache: z.ZodMiniOptional<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
|
|
963
963
|
driver: z.ZodMiniEnum<{
|
|
964
964
|
null: "null";
|
|
@@ -1037,7 +1037,7 @@ export declare const RuntimeConfigSchema: z.ZodMiniObject<{
|
|
|
1037
1037
|
}>>;
|
|
1038
1038
|
ttl: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
|
|
1039
1039
|
disableClusterMode: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
|
|
1040
|
-
}, z.core.$strip>]>>;
|
|
1040
|
+
}, z.core.$strip>], "driver">>;
|
|
1041
1041
|
}, z.core.$strip>>;
|
|
1042
1042
|
oauth: z.ZodMiniObject<{
|
|
1043
1043
|
apiHost: z.ZodMiniURL;
|
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.42.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"@opentelemetry/api": "^1.9.0",
|
|
76
76
|
"@scayle/h3-session": "0.6.1",
|
|
77
|
-
"@vercel/nft": "0.30.
|
|
77
|
+
"@vercel/nft": "0.30.1",
|
|
78
78
|
"@vueuse/core": "13.7.0",
|
|
79
79
|
"consola": "^3.2.3",
|
|
80
80
|
"core-js": "^3.37.1",
|
|
@@ -90,8 +90,8 @@
|
|
|
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.
|
|
94
|
-
"@scayle/unstorage-compression-driver": "1.0
|
|
93
|
+
"@scayle/storefront-core": "8.42.0",
|
|
94
|
+
"@scayle/unstorage-compression-driver": "1.1.0"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@arethetypeswrong/cli": "0.18.2",
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"@nuxt/module-builder": "1.0.2",
|
|
103
103
|
"@nuxt/schema": "3.17.7",
|
|
104
104
|
"@nuxt/test-utils": "3.19.2",
|
|
105
|
-
"@types/node": "22.
|
|
105
|
+
"@types/node": "22.18.0",
|
|
106
106
|
"@vitest/coverage-v8": "3.2.4",
|
|
107
107
|
"dprint": "0.50.1",
|
|
108
108
|
"eslint-formatter-gitlab": "6.0.1",
|
|
@@ -118,10 +118,10 @@
|
|
|
118
118
|
"unbuild": "3.6.1",
|
|
119
119
|
"vitest": "3.2.4",
|
|
120
120
|
"vue-tsc": "3.0.6",
|
|
121
|
-
"@scayle/eslint-config-storefront": "4.7.
|
|
122
|
-
"@scayle/vitest-config-storefront": "1.0.0",
|
|
121
|
+
"@scayle/eslint-config-storefront": "4.7.6",
|
|
123
122
|
"@scayle/eslint-plugin-vue-composable": "0.2.1",
|
|
124
|
-
"@scayle/
|
|
123
|
+
"@scayle/vitest-config-storefront": "1.0.0",
|
|
124
|
+
"@scayle/unstorage-scayle-kv-driver": "1.1.0"
|
|
125
125
|
},
|
|
126
126
|
"volta": {
|
|
127
127
|
"node": "22.18.0"
|