@scayle/storefront-nuxt 7.85.6 → 7.85.8
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 +17 -0
- package/README.md +5 -15
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/composables/core/useRpc.d.ts +3 -3
- package/dist/runtime/composables/storefront/useOrder.d.ts +15 -14
- package/dist/runtime/composables/storefront/useOrder.mjs +4 -20
- package/dist/runtime/composables/storefront/useOrderConfirmation.d.ts +15 -14
- package/dist/runtime/composables/storefront/useOrderConfirmation.mjs +1 -19
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.85.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Correct the types of `useOrder` and `useOrderConfirmation`
|
|
8
|
+
**Dependencies**
|
|
9
|
+
|
|
10
|
+
- Updated dependency to @scayle/storefront-core@7.65.4
|
|
11
|
+
|
|
12
|
+
## 7.85.7
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
**Dependencies**
|
|
17
|
+
|
|
18
|
+
- Updated dependency to @scayle/storefront-core@7.65.3
|
|
19
|
+
|
|
3
20
|
## 7.85.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -36,15 +36,16 @@ npm install --save-dev @scayle/storefront-nuxt
|
|
|
36
36
|
|
|
37
37
|
## Getting Started
|
|
38
38
|
|
|
39
|
-
Visit the [Quickstart Guide](https://scayle.dev/en/
|
|
39
|
+
Visit the [Quickstart Guide](https://scayle.dev/en/storefront-guide/developer-guide/getting-started/setup-your-storefront) to get started with Storefront Nuxt.
|
|
40
40
|
|
|
41
41
|
Visit the [Docs](https://scayle.dev) to learn more about our system requirements.
|
|
42
42
|
|
|
43
43
|
## What is SCAYLE?
|
|
44
44
|
|
|
45
|
-
[SCAYLE](https://scayle.com) is a full-featured e-commerce software solution that comes with flexible APIs.
|
|
45
|
+
[SCAYLE](https://scayle.com) is a full-featured e-commerce software solution that comes with flexible APIs.
|
|
46
|
+
Within SCAYLE, you can manage all aspects of your shop, such as products, stocks, customers, and transactions.
|
|
46
47
|
|
|
47
|
-
Learn more about [
|
|
48
|
+
Learn more about [SCAYLE’s architecture](https://scayle.dev/en/developer-guide) and commerce modules in the docs.
|
|
48
49
|
|
|
49
50
|
## Other channels
|
|
50
51
|
|
|
@@ -53,15 +54,4 @@ Learn more about [Scayle’s architecture](https://scayle.dev/en/dev/getting-sta
|
|
|
53
54
|
|
|
54
55
|
## License
|
|
55
56
|
|
|
56
|
-
Licensed under the [MIT](https://opensource.org/license/mit/)
|
|
57
|
-
|
|
58
|
-
<!-- Badges -->
|
|
59
|
-
|
|
60
|
-
[npm-version-src]: https://img.shields.io/npm/v/@scayle/storefront-nuxt/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
61
|
-
[npm-version-href]: https://npmjs.com/package/@scayle/storefront-nuxt
|
|
62
|
-
[npm-downloads-src]: https://img.shields.io/npm/dm/@scayle/storefront-nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
63
|
-
[npm-downloads-href]: https://npmjs.com/package/@scayle/storefront-nuxt
|
|
64
|
-
[license-src]: https://img.shields.io/npm/l/@scayle/storefront-nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
65
|
-
[license-href]: https://npmjs.com/package/@scayle/storefront-nuxt
|
|
66
|
-
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
67
|
-
[nuxt-href]: https://nuxt.com
|
|
57
|
+
Licensed under the [MIT License](https://opensource.org/license/mit/)
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -13,11 +13,11 @@ export type NormalizedRpcResponse<N extends RpcMethodName> = Exclude<Awaited<Rpc
|
|
|
13
13
|
/**
|
|
14
14
|
* Extend AsyncDataOptions with autoFetch (deprecated) and lazy (unused)
|
|
15
15
|
*/
|
|
16
|
-
export type UseRpcOptions<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null
|
|
16
|
+
export type UseRpcOptions<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null, ResponseT = NormalizedRpcResponse<N>> = RpcOptions & AsyncDataOptions<ResponseT, DataT, PickKeys, DefaultT>;
|
|
17
17
|
/**
|
|
18
18
|
* The return type of a composable based on useRpc
|
|
19
19
|
*/
|
|
20
|
-
export type UseRpcReturn<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null
|
|
20
|
+
export type UseRpcReturn<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null, ResponseT = NormalizedRpcResponse<N>> = ExtendedAsyncData<ResponseT, unknown, DataT, PickKeys, DefaultT>;
|
|
21
21
|
export type Status = 'idle' | 'pending' | 'success' | 'error';
|
|
22
22
|
type AsyncData<ResT, ErrorT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null> = ReturnType<typeof useAsyncData<ResT, ErrorT, DataT, PickKeys, DefaultT>>;
|
|
23
23
|
type AwaitedAsyncData<ResT, ErrorT = unknown, DataT = ResT, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null> = Awaited<AsyncData<ResT, ErrorT, DataT, PickKeys, DefaultT>>;
|
|
@@ -50,5 +50,5 @@ export type ExtendedAsyncData<ResT, ErrorT = unknown, DataT = ResT, PickKeys ext
|
|
|
50
50
|
* But anything passed here will take precedence.
|
|
51
51
|
* @see {@link https://nuxt.com/docs/api/composables/use-async-data#params}
|
|
52
52
|
*/
|
|
53
|
-
export declare function useRpc<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null
|
|
53
|
+
export declare function useRpc<N extends RpcMethodName, DataT = NormalizedRpcResponse<N>, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null, ResponseT = NormalizedRpcResponse<N>>(method: N, key: string, params?: MaybeRefOrGetter<RpcMethodParameters<N> extends RpcContext ? undefined : RpcMethodParameters<N>>, options?: UseRpcOptions<N, DataT, PickKeys, DefaultT, ResponseT>): ExtendedAsyncData<ResponseT, unknown, DataT, PickKeys, DefaultT>;
|
|
54
54
|
export {};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
|
-
import
|
|
3
|
-
import type
|
|
4
|
-
type
|
|
5
|
-
params: MaybeRefOrGetter<RpcMethodParameters<'getOrderById'>>;
|
|
6
|
-
options: RpcOptions;
|
|
7
|
-
/** @deprecated use the second argument of the composable to define the key */
|
|
8
|
-
key: string;
|
|
9
|
-
}>;
|
|
2
|
+
import type { AsyncDataOptions } from 'nuxt/app';
|
|
3
|
+
import { type RpcOptions, type KeysOf, type ExtendedAsyncData } from '../core/useRpc';
|
|
4
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
10
5
|
type ItemsType = Exclude<Order['items'], undefined>;
|
|
11
6
|
type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
12
7
|
product: P;
|
|
13
8
|
variant: V;
|
|
14
9
|
};
|
|
15
|
-
type UserOrderBaseReturn<P, V> = Pick<Awaited<UseRpcReturn<'getOrderById'>>, 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
|
|
16
|
-
data: Ref<Order & {
|
|
17
|
-
items?: NewItemsType<P, V>[];
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
10
|
export declare function useOrder<P = {
|
|
21
11
|
[k: string]: unknown;
|
|
22
12
|
}, V = {
|
|
23
13
|
[k: string]: unknown;
|
|
24
|
-
}
|
|
14
|
+
}, DataT = Order & {
|
|
15
|
+
items?: NewItemsType<P, V>[];
|
|
16
|
+
}, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, key: _key }?: {
|
|
17
|
+
params?: MaybeRefOrGetter<RpcMethodParameters<'getOrderById'>>;
|
|
18
|
+
options?: RpcOptions & AsyncDataOptions<Order & {
|
|
19
|
+
items?: NewItemsType<P, V>[];
|
|
20
|
+
}, DataT, PickKeys, DefaultT>;
|
|
21
|
+
/** @deprecated use the second argument of the composable to define the key */
|
|
22
|
+
key?: string;
|
|
23
|
+
}, key?: string): ExtendedAsyncData<Order & {
|
|
24
|
+
items?: NewItemsType<P, V>[];
|
|
25
|
+
}, unknown, DataT, PickKeys, DefaultT>;
|
|
25
26
|
export {};
|
|
@@ -1,27 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
useRpc
|
|
3
|
+
} from "../core/useRpc.mjs";
|
|
3
4
|
export function useOrder({ params, options, key: _key } = {}, key) {
|
|
4
|
-
|
|
5
|
+
return useRpc(
|
|
5
6
|
"getOrderById",
|
|
6
7
|
_key ?? key ?? "useOrder",
|
|
7
8
|
params,
|
|
8
9
|
options
|
|
9
10
|
);
|
|
10
|
-
const {
|
|
11
|
-
data,
|
|
12
|
-
fetch,
|
|
13
|
-
fetching,
|
|
14
|
-
error,
|
|
15
|
-
refresh,
|
|
16
|
-
status
|
|
17
|
-
} = promise;
|
|
18
|
-
const _data = data;
|
|
19
|
-
return extendPromise(promise.then(() => ({})), {
|
|
20
|
-
data: _data,
|
|
21
|
-
fetch,
|
|
22
|
-
fetching,
|
|
23
|
-
error,
|
|
24
|
-
refresh,
|
|
25
|
-
status
|
|
26
|
-
});
|
|
27
11
|
}
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import type { RpcMethodParameters, Order } from '@scayle/storefront-core';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
type
|
|
5
|
-
params: MaybeRefOrGetter<RpcMethodParameters<'getOrderDataByCbd'>>;
|
|
6
|
-
options: RpcOptions;
|
|
7
|
-
/** @deprecated use the second argument of the composable to define the key */
|
|
8
|
-
key: string;
|
|
9
|
-
}>;
|
|
2
|
+
import type { AsyncDataOptions } from 'nuxt/app';
|
|
3
|
+
import type { RpcOptions, ExtendedAsyncData, KeysOf } from '../core/useRpc';
|
|
4
|
+
import type { MaybeRefOrGetter } from 'vue';
|
|
10
5
|
type ItemsType = Exclude<Order['items'], undefined>;
|
|
11
6
|
type NewItemsType<P, V> = Exclude<ItemsType[number], 'product' | 'variant'> & {
|
|
12
7
|
product: P;
|
|
13
8
|
variant: V;
|
|
14
9
|
};
|
|
15
|
-
type UseOrderConfirmationBaseReturn<P, V> = Pick<Awaited<UseRpcReturn<'getOrderDataByCbd'>>, 'error' | 'status' | 'fetch' | 'fetching' | 'refresh'> & {
|
|
16
|
-
data: Ref<Order & {
|
|
17
|
-
items?: NewItemsType<P, V>[];
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
20
10
|
export declare function useOrderConfirmation<P = {
|
|
21
11
|
[k: string]: unknown;
|
|
22
12
|
}, V = {
|
|
23
13
|
[k: string]: unknown;
|
|
24
|
-
}
|
|
14
|
+
}, DataT = Order & {
|
|
15
|
+
items?: NewItemsType<P, V>[];
|
|
16
|
+
}, PickKeys extends KeysOf<DataT> = KeysOf<DataT>, DefaultT = null>({ params, options, key: _key }?: {
|
|
17
|
+
params?: MaybeRefOrGetter<RpcMethodParameters<'getOrderDataByCbd'>>;
|
|
18
|
+
options?: RpcOptions & AsyncDataOptions<Order & {
|
|
19
|
+
items?: NewItemsType<P, V>[];
|
|
20
|
+
}, DataT, PickKeys, DefaultT>;
|
|
21
|
+
/** @deprecated use the second argument of the composable to define the key */
|
|
22
|
+
key?: string;
|
|
23
|
+
}, key?: string): ExtendedAsyncData<Order & {
|
|
24
|
+
items?: NewItemsType<P, V>[];
|
|
25
|
+
}, unknown, DataT, PickKeys, DefaultT>;
|
|
25
26
|
export {};
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
import { useRpc } from "../core/useRpc.mjs";
|
|
2
|
-
import { extendPromise } from "../../utils/promise.mjs";
|
|
3
2
|
export function useOrderConfirmation({ params, options, key: _key } = {}, key) {
|
|
4
|
-
|
|
3
|
+
return useRpc(
|
|
5
4
|
"getOrderDataByCbd",
|
|
6
5
|
_key ?? key ?? "useOrderConfirmation",
|
|
7
6
|
params,
|
|
8
7
|
options
|
|
9
8
|
);
|
|
10
|
-
const {
|
|
11
|
-
data,
|
|
12
|
-
fetch,
|
|
13
|
-
fetching,
|
|
14
|
-
error,
|
|
15
|
-
refresh,
|
|
16
|
-
status
|
|
17
|
-
} = promise;
|
|
18
|
-
const _data = data;
|
|
19
|
-
return extendPromise(promise.then(() => ({})), {
|
|
20
|
-
fetch,
|
|
21
|
-
fetching,
|
|
22
|
-
error,
|
|
23
|
-
refresh,
|
|
24
|
-
status,
|
|
25
|
-
data: _data
|
|
26
|
-
});
|
|
27
9
|
}
|
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.8",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"access": "public",
|
|
10
10
|
"registry": "https://registry.npmjs.org/"
|
|
11
11
|
},
|
|
12
|
+
"website": "https://scayle.dev/en/storefront-guide/developer-guide/getting-started/about-storefront",
|
|
12
13
|
"sideEffects": false,
|
|
13
14
|
"exports": {
|
|
14
15
|
"./rpc": {
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"@nuxt/kit": "^3.12.2",
|
|
61
62
|
"@opentelemetry/api": "^1.9.0",
|
|
62
63
|
"@scayle/h3-session": "^0.4.0",
|
|
63
|
-
"@scayle/storefront-core": "7.65.
|
|
64
|
+
"@scayle/storefront-core": "7.65.4",
|
|
64
65
|
"@scayle/unstorage-compression-driver": "^0.1.3",
|
|
65
66
|
"@vueuse/core": "11.1.0",
|
|
66
67
|
"consola": "^3.2.3",
|
|
@@ -84,9 +85,9 @@
|
|
|
84
85
|
"@nuxt/test-utils": "3.14.2",
|
|
85
86
|
"@scayle/eslint-config-storefront": "4.3.0",
|
|
86
87
|
"@scayle/eslint-plugin-vue-composable": "0.2.0",
|
|
87
|
-
"@types/node": "20.16.
|
|
88
|
+
"@types/node": "20.16.6",
|
|
88
89
|
"dprint": "0.47.2",
|
|
89
|
-
"eslint": "9.
|
|
90
|
+
"eslint": "9.11.1",
|
|
90
91
|
"eslint-formatter-gitlab": "5.1.0",
|
|
91
92
|
"fishery": "2.2.2",
|
|
92
93
|
"h3": "1.12.0",
|