@scayle/storefront-nuxt 7.81.0 → 7.82.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 +20 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/composables/core/useRpcCall.d.ts +2 -0
- package/dist/runtime/composables/core/useRpcCall.mjs +8 -0
- package/dist/runtime/composables/index.d.ts +1 -0
- package/dist/runtime/composables/index.mjs +1 -0
- package/package.json +28 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 7.82.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add new `useRpcCall` composable to make imperative RPC calls more ergonomic
|
|
8
|
+
|
|
9
|
+
```vue
|
|
10
|
+
<script lang="ts" setup>
|
|
11
|
+
const getConfig = useRpcCall('getShopConfiguration)
|
|
12
|
+
const getProduct = useRpcCall('getProductById')
|
|
13
|
+
const config = await getConfig()
|
|
14
|
+
const product = await getProduct({ id: 1 })
|
|
15
|
+
</script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @scayle/storefront-core@7.59.1
|
|
22
|
+
|
|
3
23
|
## 7.81.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { RpcContext, RpcMethodName, RpcMethodParameters, RpcMethodReturnType } from '@scayle/storefront-core';
|
|
2
|
+
export declare function useRpcCall<N extends RpcMethodName, P extends RpcMethodParameters<N>, TResult extends Exclude<Awaited<RpcMethodReturnType<N>>, Response>, TakesParameters = P extends RpcContext ? undefined : boolean>(method: N): TakesParameters extends undefined ? () => Promise<TResult> : (params: P) => Promise<TResult>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { rpcCall } from "../../rpc/rpcCall.mjs";
|
|
2
|
+
import { useNuxtApp } from "nuxt/app";
|
|
3
|
+
import { useCurrentShop } from "./useCurrentShop.mjs";
|
|
4
|
+
export function useRpcCall(method) {
|
|
5
|
+
const nuxtApp = useNuxtApp();
|
|
6
|
+
const currentShop = useCurrentShop();
|
|
7
|
+
return rpcCall(nuxtApp, method, currentShop.value);
|
|
8
|
+
}
|
|
@@ -4,6 +4,7 @@ export * from './core/useFormatHelpers';
|
|
|
4
4
|
export * from './core/useIDP';
|
|
5
5
|
export * from './core/useLog';
|
|
6
6
|
export * from './core/useRpc';
|
|
7
|
+
export * from './core/useRpcCall';
|
|
7
8
|
export * from './core/useSession';
|
|
8
9
|
export * from './core/useUser';
|
|
9
10
|
export * from './storefront/useBasket';
|
|
@@ -4,6 +4,7 @@ export * from "./core/useFormatHelpers.mjs";
|
|
|
4
4
|
export * from "./core/useIDP.mjs";
|
|
5
5
|
export * from "./core/useLog.mjs";
|
|
6
6
|
export * from "./core/useRpc.mjs";
|
|
7
|
+
export * from "./core/useRpcCall.mjs";
|
|
7
8
|
export * from "./core/useSession.mjs";
|
|
8
9
|
export * from "./core/useUser.mjs";
|
|
9
10
|
export * from "./storefront/useBasket.mjs";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.82.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,46 +57,46 @@
|
|
|
57
57
|
"test:watch": "vitest watch"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@nuxt/kit": "3.12.2",
|
|
61
|
-
"@opentelemetry/api": "1.9.0",
|
|
62
|
-
"@scayle/h3-session": "0.4.0",
|
|
63
|
-
"@scayle/storefront-core": "7.59.
|
|
64
|
-
"@scayle/unstorage-compression-driver": "0.1.3",
|
|
65
|
-
"@vueuse/core": "10.11.0",
|
|
66
|
-
"consola": "3.2.3",
|
|
67
|
-
"core-js": "3.37.1",
|
|
68
|
-
"defu": "6.1.4",
|
|
69
|
-
"hookable": "5.5.3",
|
|
60
|
+
"@nuxt/kit": "^3.12.2",
|
|
61
|
+
"@opentelemetry/api": "^1.9.0",
|
|
62
|
+
"@scayle/h3-session": "^0.4.0",
|
|
63
|
+
"@scayle/storefront-core": "^7.59.1",
|
|
64
|
+
"@scayle/unstorage-compression-driver": "^0.1.3",
|
|
65
|
+
"@vueuse/core": "^10.11.0",
|
|
66
|
+
"consola": "^3.2.3",
|
|
67
|
+
"core-js": "^3.37.1",
|
|
68
|
+
"defu": "^6.1.4",
|
|
69
|
+
"hookable": "^5.5.3",
|
|
70
70
|
"jose": "^5.2.0",
|
|
71
|
-
"knitwork": "1.1.0",
|
|
72
|
-
"nitropack": "2.9.7",
|
|
73
|
-
"ofetch": "1.3.4",
|
|
74
|
-
"radash": "12.1.0",
|
|
75
|
-
"ufo": "1.5.3",
|
|
76
|
-
"uncrypto": "0.1.3",
|
|
77
|
-
"unstorage": "1.10.2",
|
|
78
|
-
"vue-router": "4.4.0",
|
|
79
|
-
"yn": "5.0.0",
|
|
80
|
-
"zod": "3.23.8"
|
|
71
|
+
"knitwork": "^1.1.0",
|
|
72
|
+
"nitropack": "^2.9.7",
|
|
73
|
+
"ofetch": "^1.3.4",
|
|
74
|
+
"radash": "^12.1.0",
|
|
75
|
+
"ufo": "^1.5.3",
|
|
76
|
+
"uncrypto": "^0.1.3",
|
|
77
|
+
"unstorage": "^1.10.2",
|
|
78
|
+
"vue-router": "^4.4.0",
|
|
79
|
+
"yn": "^5.0.0",
|
|
80
|
+
"zod": "^3.23.8"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@nuxt/eslint": "0.3.13",
|
|
84
84
|
"@nuxt/module-builder": "0.5.5",
|
|
85
|
-
"@nuxt/schema": "3.12.
|
|
85
|
+
"@nuxt/schema": "3.12.3",
|
|
86
86
|
"@nuxt/test-utils": "3.13.1",
|
|
87
87
|
"@scayle/eslint-config-storefront": "4.2.0",
|
|
88
88
|
"@scayle/eslint-plugin-vue-composable": "0.2.0",
|
|
89
89
|
"@types/node": "20.14.10",
|
|
90
|
-
"dprint": "0.47.
|
|
90
|
+
"dprint": "0.47.2",
|
|
91
91
|
"eslint": "9.6.0",
|
|
92
92
|
"eslint-formatter-gitlab": "5.1.0",
|
|
93
93
|
"fishery": "2.2.2",
|
|
94
94
|
"h3": "1.12.0",
|
|
95
95
|
"node-mocks-http": "1.15.0",
|
|
96
96
|
"nuxi": "3.12.0",
|
|
97
|
-
"nuxt": "3.12.
|
|
97
|
+
"nuxt": "3.12.3",
|
|
98
98
|
"publint": "0.2.8",
|
|
99
|
-
"vitest": "2.0.
|
|
99
|
+
"vitest": "2.0.2",
|
|
100
100
|
"vue-tsc": "2.0.26"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
"resolutions": {
|
|
109
109
|
"h3": "1.12.0",
|
|
110
110
|
"vue": "3.4.31",
|
|
111
|
-
"@nuxt/kit": "3.12.
|
|
112
|
-
"@nuxt/schema": "3.12.
|
|
111
|
+
"@nuxt/kit": "3.12.3",
|
|
112
|
+
"@nuxt/schema": "3.12.3"
|
|
113
113
|
},
|
|
114
114
|
"volta": {
|
|
115
|
-
"node": "20.15.
|
|
115
|
+
"node": "20.15.1"
|
|
116
116
|
}
|
|
117
117
|
}
|