@scayle/storefront-nuxt 7.85.14 → 7.85.15
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 +48 -41
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.85.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
- Updated dependency to @scayle/storefront-core@7.65.7
|
|
10
|
+
|
|
3
11
|
## 7.85.14
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -127,28 +135,28 @@ For example:
|
|
|
127
135
|
```ts
|
|
128
136
|
useBrand({
|
|
129
137
|
params: { brandId: 1 },
|
|
130
|
-
}).data satisfies Ref<Brand
|
|
138
|
+
}).data satisfies Ref<Brand>;
|
|
131
139
|
|
|
132
140
|
useBrand({
|
|
133
141
|
params: { brandId: 1 },
|
|
134
142
|
options: {
|
|
135
|
-
pick: [
|
|
143
|
+
pick: ["id", "isActive"],
|
|
136
144
|
},
|
|
137
|
-
}).data satisfies Ref<Brand
|
|
145
|
+
}).data satisfies Ref<Brand>;
|
|
138
146
|
|
|
139
147
|
useBrand({
|
|
140
148
|
params: { brandId: 1 },
|
|
141
149
|
options: {
|
|
142
150
|
transform: (brand) => brand.slug,
|
|
143
151
|
},
|
|
144
|
-
}).data satisfies Ref<Brand
|
|
152
|
+
}).data satisfies Ref<Brand>;
|
|
145
153
|
|
|
146
154
|
useBrand({
|
|
147
155
|
params: { brandId: 1 },
|
|
148
156
|
options: {
|
|
149
|
-
default: () =>
|
|
157
|
+
default: () => "Brand not found",
|
|
150
158
|
},
|
|
151
|
-
}).data satisfies Ref<Brand
|
|
159
|
+
}).data satisfies Ref<Brand>;
|
|
152
160
|
```
|
|
153
161
|
|
|
154
162
|
**In 7.85.0**
|
|
@@ -156,28 +164,28 @@ useBrand({
|
|
|
156
164
|
```ts
|
|
157
165
|
useBrand({
|
|
158
166
|
params: { brandId: 1 },
|
|
159
|
-
}).data satisfies Ref<Brand | null
|
|
167
|
+
}).data satisfies Ref<Brand | null>;
|
|
160
168
|
|
|
161
169
|
useBrand({
|
|
162
170
|
params: { brandId: 1 },
|
|
163
171
|
options: {
|
|
164
|
-
pick: [
|
|
172
|
+
pick: ["id", "isActive"],
|
|
165
173
|
},
|
|
166
|
-
}).data satisfies Ref<Pick<Brand,
|
|
174
|
+
}).data satisfies Ref<Pick<Brand, "id" | "isActive"> | null>;
|
|
167
175
|
|
|
168
176
|
useBrand({
|
|
169
177
|
params: { brandId: 1 },
|
|
170
178
|
options: {
|
|
171
179
|
transform: (brand) => brand.slug,
|
|
172
180
|
},
|
|
173
|
-
}).data satisfies Ref<string | null
|
|
181
|
+
}).data satisfies Ref<string | null>;
|
|
174
182
|
|
|
175
183
|
useBrand({
|
|
176
184
|
params: { brandId: 1 },
|
|
177
185
|
options: {
|
|
178
|
-
default: () =>
|
|
186
|
+
default: () => "Brand not found",
|
|
179
187
|
},
|
|
180
|
-
}).data satisfies Ref<Brand | string
|
|
188
|
+
}).data satisfies Ref<Brand | string>;
|
|
181
189
|
```
|
|
182
190
|
|
|
183
191
|
For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.com/docs/api/composables/use-async-data)
|
|
@@ -211,8 +219,7 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
211
219
|
|
|
212
220
|
### Patch Changes
|
|
213
221
|
|
|
214
|
-
-
|
|
215
|
-
- Updated dependencies
|
|
222
|
+
- - Updated dependencies
|
|
216
223
|
- @scayle/storefront-core@7.64.0
|
|
217
224
|
|
|
218
225
|
## 7.84.2
|
|
@@ -337,27 +344,27 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
337
344
|
Hooks can be registered by adding a nitro plugin inside ´server/plugins/´:
|
|
338
345
|
|
|
339
346
|
```ts
|
|
340
|
-
import { defineNitroPlugin } from
|
|
347
|
+
import { defineNitroPlugin } from "#imports";
|
|
341
348
|
|
|
342
349
|
export default defineNitroPlugin((nitroApp) => {
|
|
343
|
-
nitroApp.hooks.hook(
|
|
344
|
-
rpcContext.log.debug(`Before: ${rpcName}`)
|
|
345
|
-
})
|
|
350
|
+
nitroApp.hooks.hook("storefront:rpc:before", (rpcName, rpcContext) => {
|
|
351
|
+
rpcContext.log.debug(`Before: ${rpcName}`);
|
|
352
|
+
});
|
|
346
353
|
|
|
347
354
|
nitroApp.hooks.hook(
|
|
348
|
-
|
|
355
|
+
"storefront:rpc:after",
|
|
349
356
|
(rpcName, rpcContext, result) => {
|
|
350
|
-
rpcContext.log.debug(`After: ${rpcName} returned ${result}`)
|
|
351
|
-
}
|
|
352
|
-
)
|
|
357
|
+
rpcContext.log.debug(`After: ${rpcName} returned ${result}`);
|
|
358
|
+
}
|
|
359
|
+
);
|
|
353
360
|
|
|
354
361
|
nitroApp.hooks.hook(
|
|
355
|
-
|
|
362
|
+
"storefront:rpc:error",
|
|
356
363
|
(rpcName, rpcContext, error) => {
|
|
357
|
-
rpcContext.log.error(`ERROR: ${rpcName} did throw ${error}`)
|
|
358
|
-
}
|
|
359
|
-
)
|
|
360
|
-
})
|
|
364
|
+
rpcContext.log.error(`ERROR: ${rpcName} did throw ${error}`);
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
});
|
|
361
368
|
```
|
|
362
369
|
|
|
363
370
|
Added [`callHook`](https://github.com/unjs/hookable?tab=readme-ov-file#async-callhook-name-args), `callHookParallel` and [`callHookWith`](https://github.com/unjs/hookable?tab=readme-ov-file#callhookwith-name-callerfn) to `RpcContext` to allow triggering hooks within RPCs
|
|
@@ -625,20 +632,20 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
625
632
|
- It is now also possible to extend the RPCContext using the `storefront:context:created` nitro runtime hook.
|
|
626
633
|
|
|
627
634
|
```ts
|
|
628
|
-
import { defineNitroPlugin } from
|
|
635
|
+
import { defineNitroPlugin } from "nitropack/runtime/plugin";
|
|
629
636
|
// Augment RpxContext type
|
|
630
|
-
declare module
|
|
637
|
+
declare module "@scayle/storefront-nuxt" {
|
|
631
638
|
interface AdditionalRpcContext {
|
|
632
|
-
myNewProp: string
|
|
639
|
+
myNewProp: string;
|
|
633
640
|
}
|
|
634
641
|
}
|
|
635
642
|
|
|
636
643
|
// Set new value on rpcContext
|
|
637
644
|
export default defineNitroPlugin((nitroApp) => {
|
|
638
|
-
nitroApp.hooks.hook(
|
|
639
|
-
rpcContext.myNewProp =
|
|
640
|
-
})
|
|
641
|
-
})
|
|
645
|
+
nitroApp.hooks.hook("storefront:context:created", (rpcContext) => {
|
|
646
|
+
rpcContext.myNewProp = "My campaign key";
|
|
647
|
+
});
|
|
648
|
+
});
|
|
642
649
|
```
|
|
643
650
|
|
|
644
651
|
### Patch Changes
|
|
@@ -841,8 +848,8 @@ For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.
|
|
|
841
848
|
|
|
842
849
|
```ts
|
|
843
850
|
const { data: externalIDPRedirects } = await useIDP({
|
|
844
|
-
queryParams: { redirectTo:
|
|
845
|
-
})
|
|
851
|
+
queryParams: { redirectTo: "/account" },
|
|
852
|
+
});
|
|
846
853
|
```
|
|
847
854
|
|
|
848
855
|
Please note that `code` and `state` are not supported as these are used by the SCAYLE Authentication API.
|
|
@@ -1261,16 +1268,16 @@ There is an `unwrap` function exported by this package (>=7.55.0) that can be us
|
|
|
1261
1268
|
Before:
|
|
1262
1269
|
|
|
1263
1270
|
```typescript
|
|
1264
|
-
toCurrency(100, { currency:
|
|
1265
|
-
formatPrice(100, { currencyFractionDigits: 2 })
|
|
1271
|
+
toCurrency(100, { currency: "EUR" });
|
|
1272
|
+
formatPrice(100, { currencyFractionDigits: 2 });
|
|
1266
1273
|
```
|
|
1267
1274
|
|
|
1268
1275
|
After:
|
|
1269
1276
|
|
|
1270
1277
|
```typescript
|
|
1271
|
-
const { formatCurrency } = useFormatHelpers()
|
|
1272
|
-
formatCurrency(100, { currency:
|
|
1273
|
-
formatCurrency(100, { style:
|
|
1278
|
+
const { formatCurrency } = useFormatHelpers();
|
|
1279
|
+
formatCurrency(100, { currency: "EUR" });
|
|
1280
|
+
formatCurrency(100, { style: "decimal", currencyFractionDigits: 2 });
|
|
1274
1281
|
```
|
|
1275
1282
|
|
|
1276
1283
|
## 7.44.1
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.85.
|
|
4
|
+
"version": "7.85.15",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@nuxt/kit": "^3.12.2",
|
|
62
62
|
"@opentelemetry/api": "^1.9.0",
|
|
63
63
|
"@scayle/h3-session": "^0.4.1",
|
|
64
|
-
"@scayle/storefront-core": "7.65.
|
|
64
|
+
"@scayle/storefront-core": "7.65.7",
|
|
65
65
|
"@scayle/unstorage-compression-driver": "^0.1.4",
|
|
66
66
|
"@vueuse/core": "11.1.0",
|
|
67
67
|
"consola": "^3.2.3",
|