@scayle/storefront-nuxt 8.11.11 → 8.12.1
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 +20 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/api/rpcHandler.d.ts +1 -1
- package/dist/runtime/composables/storefront/useOrder.d.ts +4 -20
- package/dist/runtime/composables/storefront/useOrder.js +4 -1
- package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +4 -20
- package/dist/runtime/composables/storefront/useOrderConfirmation.js +4 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
- Updated dependency to @scayle/storefront-core@8.14.1
|
|
10
|
+
|
|
11
|
+
## 8.12.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- `OrderItem` and `Order` now accept generics: Both `OrderItem` and `Order` interfaces now accept generic type parameters for `Product` and `Variant`. Previously, these were implicitly typed as `Record<string, unknown>`. This change allows to strongly type the `product` and `variant` data within orders and order items, leading to better type checking and potentially fewer runtime errors. This allows for compile-time checks and autocompletion when working with `product` and `variant` properties of `OrderItem` and items property of `Order`.
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
**Dependencies**
|
|
20
|
+
|
|
21
|
+
- Updated dependency to @scayle/storefront-core@8.14.0
|
|
22
|
+
|
|
3
23
|
## 8.11.11
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -28,7 +28,7 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
|
|
|
28
28
|
} | import("@scayle/storefront-api").Category | {
|
|
29
29
|
categories: import("@scayle/storefront-api").Category;
|
|
30
30
|
activeNode: import("@scayle/storefront-api").Category;
|
|
31
|
-
} | import("@scayle/storefront-core").Order | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
|
|
31
|
+
} | import("@scayle/storefront-core").Order<Record<string, unknown>, Record<string, unknown>> | import("@scayle/storefront-api").SearchV2SuggestionsEndpointResponseData | import("@scayle/storefront-api").SearchEntity | import("@scayle/storefront-api").ShopConfiguration | {
|
|
32
32
|
user: import("@scayle/storefront-core").ShopUser | undefined;
|
|
33
33
|
} | import("@scayle/storefront-core").ShopUserAddress[] | import("@scayle/storefront-api").NavigationAllEndpointResponseData | import("@scayle/storefront-api").NavigationTree | {
|
|
34
34
|
success: true;
|
|
@@ -2,11 +2,6 @@ import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
|
2
2
|
import type { AsyncDataOptions } from 'nuxt/app';
|
|
3
3
|
import { type KeysOf, type ExtendedAsyncData } from '../core/useRpc.js';
|
|
4
4
|
import type { MaybeRefOrGetter } from 'vue';
|
|
5
|
-
type ItemsType = Exclude<Order['items'], undefined>;
|
|
6
|
-
type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
7
|
-
product: P;
|
|
8
|
-
variant: V;
|
|
9
|
-
};
|
|
10
5
|
/**
|
|
11
6
|
* Retrieves order data by ID using the `getOrderById` RPC method.
|
|
12
7
|
*
|
|
@@ -19,7 +14,7 @@ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
|
19
14
|
*
|
|
20
15
|
* @template P The type of the `product` property within the order items. Defaults to an object with any keys.
|
|
21
16
|
* @template V The type of the `variant` property within the order items. Defaults to an object with any keys.
|
|
22
|
-
* @template DataT The type of the transformed data. Defaults to `Order
|
|
17
|
+
* @template DataT The type of the transformed data. Defaults to `Order<P, V>`.
|
|
23
18
|
* @template PickKeys Keys of the `DataT` type that will be present. This defaults to all keys of DataT.
|
|
24
19
|
* @template DefaultT The default return type. Useful for showing loading skeletons. Defaults to `null`.
|
|
25
20
|
*
|
|
@@ -30,18 +25,7 @@ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
|
30
25
|
*
|
|
31
26
|
* @returns An extended async data object containing the order data.
|
|
32
27
|
*/
|
|
33
|
-
export declare function useOrder<P = {
|
|
34
|
-
[k: string]: unknown;
|
|
35
|
-
}, V = {
|
|
36
|
-
[k: string]: unknown;
|
|
37
|
-
}, DataT = Order & {
|
|
38
|
-
items?: NewItemsType<P, V>[];
|
|
39
|
-
}, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options }?: {
|
|
28
|
+
export declare function useOrder<P = Record<string, unknown>, V = Record<string, unknown>, DataT = Order<P, V>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: {
|
|
40
29
|
params?: MaybeRefOrGetter<RpcMethodParameters<'getOrderById'>>;
|
|
41
|
-
options?: AsyncDataOptions<Order
|
|
42
|
-
|
|
43
|
-
}, DataT, PickKeys, DefaultT>;
|
|
44
|
-
}, key?: string): ExtendedAsyncData<Order & {
|
|
45
|
-
items?: NewItemsType<P, V>[];
|
|
46
|
-
}, unknown, DataT, PickKeys, DefaultT>;
|
|
47
|
-
export {};
|
|
30
|
+
options?: AsyncDataOptions<Order<P, V>, DataT, PickKeys, DefaultT>;
|
|
31
|
+
}, key?: string): ExtendedAsyncData<Order<P, V>, unknown, DataT, PickKeys, DefaultT>;
|
|
@@ -2,11 +2,6 @@ import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
|
2
2
|
import type { AsyncDataOptions } from 'nuxt/app';
|
|
3
3
|
import type { ExtendedAsyncData, KeysOf } from '../core/useRpc.js';
|
|
4
4
|
import type { MaybeRefOrGetter } from 'vue';
|
|
5
|
-
type ItemsType = Exclude<Order['items'], undefined>;
|
|
6
|
-
type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
7
|
-
product: P;
|
|
8
|
-
variant: V;
|
|
9
|
-
};
|
|
10
5
|
/**
|
|
11
6
|
* Retrieves order data by ID using the `getOrderDataByCbd RPC method.
|
|
12
7
|
*
|
|
@@ -17,7 +12,7 @@ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
|
17
12
|
*
|
|
18
13
|
* @template P The type of the `product` property within the order items. Defaults to an object with any keys.
|
|
19
14
|
* @template V The type of the `variant` property within the order items. Defaults to an object with any keys.
|
|
20
|
-
* @template DataT The type of the transformed data. Defaults to `Order
|
|
15
|
+
* @template DataT The type of the transformed data. Defaults to `Order<P, V>`.
|
|
21
16
|
* @template PickKeys Keys of the `DataT` type that will be present. This defaults to all keys of DataT.
|
|
22
17
|
* @template DefaultT The default return type. Useful for showing loading skeletons. Defaults to `null`.
|
|
23
18
|
*
|
|
@@ -28,18 +23,7 @@ type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
|
28
23
|
*
|
|
29
24
|
* @returns An extended async data object containing the order data.
|
|
30
25
|
*/
|
|
31
|
-
export declare function useOrderConfirmation<P = {
|
|
32
|
-
[k: string]: unknown;
|
|
33
|
-
}, V = {
|
|
34
|
-
[k: string]: unknown;
|
|
35
|
-
}, DataT = Order & {
|
|
36
|
-
items?: NewItemsType<P, V>[];
|
|
37
|
-
}, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options }?: {
|
|
26
|
+
export declare function useOrderConfirmation<P = Record<string, unknown>, V = Record<string, unknown>, DataT = Order<P, V>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, }?: {
|
|
38
27
|
params?: MaybeRefOrGetter<RpcMethodParameters<'getOrderDataByCbd'>>;
|
|
39
|
-
options?: AsyncDataOptions<Order
|
|
40
|
-
|
|
41
|
-
}, DataT, PickKeys, DefaultT>;
|
|
42
|
-
}, key?: string): ExtendedAsyncData<Order & {
|
|
43
|
-
items?: NewItemsType<P, V>[];
|
|
44
|
-
}, unknown, DataT, PickKeys, DefaultT>;
|
|
45
|
-
export {};
|
|
28
|
+
options?: AsyncDataOptions<Order<P, V>, DataT, PickKeys, DefaultT>;
|
|
29
|
+
}, key?: string): ExtendedAsyncData<Order<P, V>, unknown, DataT, PickKeys, DefaultT>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { useRpc } from "../core/useRpc.js";
|
|
2
|
-
export function useOrderConfirmation({
|
|
2
|
+
export function useOrderConfirmation({
|
|
3
|
+
params,
|
|
4
|
+
options
|
|
5
|
+
} = {}, key = "useOrderConfirmation") {
|
|
3
6
|
return useRpc(
|
|
4
7
|
"getOrderDataByCbd",
|
|
5
8
|
key,
|
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.12.1",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"@opentelemetry/api": "^1.9.0",
|
|
80
80
|
"@scayle/h3-session": "0.6.0",
|
|
81
|
-
"@scayle/storefront-core": "8.
|
|
81
|
+
"@scayle/storefront-core": "8.14.1",
|
|
82
82
|
"@scayle/unstorage-compression-driver": "^0.2.4",
|
|
83
83
|
"@vercel/nft": "0.29.2",
|
|
84
84
|
"@vueuse/core": "13.0.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"h3": "1.15.0",
|
|
115
115
|
"nitropack": "2.9.7",
|
|
116
116
|
"node-mocks-http": "1.16.2",
|
|
117
|
-
"nuxi": "3.
|
|
117
|
+
"nuxi": "3.23.0",
|
|
118
118
|
"nuxt": "3.15.4",
|
|
119
119
|
"publint": "0.2.12",
|
|
120
120
|
"typescript": "5.8.2",
|