Skip to content

Commit 2af4514

Browse files
authored
Merge pull request #3 from silicon-heaven/update-deps
Update deps
2 parents c665928 + 18510c7 commit 2af4514

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-shv",
3-
"version": "4.0.1",
3+
"version": "5.0.0",
44
"description": "Vue support for libshv-js",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -32,8 +32,8 @@
3232
},
3333
"peerDependencies": {
3434
"vue": "^3.5.22",
35-
"libshv-js-zod": "^2.0.1",
36-
"libshv-js": "^5.0.1"
35+
"libshv-js-zod": "^3.0.0",
36+
"libshv-js": "^6.0.0"
3737
},
3838
"devDependencies": {
3939
"@typescript-eslint/parser": "^8.46.1",

src/vue-shv.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {computed, ComputedRef, onWatcherCleanup, Ref, ref, watchEffect} from 'vue';
2-
import {type WsClient, type WsClientOptionsLogin} from 'libshv-js/ws-client';
2+
import {CallRpcMethodOptions, type WsClient, type WsClientOptionsLogin} from 'libshv-js/ws-client';
33
import {useLocalStorage, useSessionStorage} from '@vueuse/core';
44
import PKCE from 'js-pkce';
55
import * as z from 'libshv-js-zod/zod';
@@ -200,13 +200,13 @@ export function useShv(options: VueShvOptions) {
200200
shvSessionStorage.value.shvLoginPassword = password;
201201
};
202202

203-
const rpcCall = async (shvPath: StringGetter, method: string, params?: RpcValue) => {
203+
const rpcCall = async (shvPath: StringGetter, method: string, params?: RpcValue, options?: CallRpcMethodOptions) => {
204204
const shv = await getConnection();
205-
return shv.callRpcMethod(await resolveString(shvPath), method, params);
205+
return shv.callRpcMethod(await resolveString(shvPath), method, params, options);
206206
};
207207

208-
const makeRpcCall = <ResultType>(shvPath: StringGetter, method: string, validator: z.ZodType<ResultType>) => async () => {
209-
const resultOrError = await rpcCall(await resolveString(shvPath), method);
208+
const makeRpcCall = <ResultType>(shvPath: StringGetter, method: string, validator: z.ZodType<ResultType>, options?: CallRpcMethodOptions) => async () => {
209+
const resultOrError = await rpcCall(await resolveString(shvPath), method, undefined, options);
210210
if (resultOrError instanceof Error) {
211211
return resultOrError;
212212
}
@@ -219,8 +219,9 @@ export function useShv(options: VueShvOptions) {
219219
return parsed.data;
220220
};
221221

222-
const makeRpcCallParam = <ResultType, ParamType extends RpcValue>(shvPath: StringGetter, method: string, _paramType: z.ZodType<ParamType>, validator: z.ZodType<ResultType>) => async (param: ParamType) => {
223-
const resultOrError = await rpcCall(await resolveString(shvPath), method, param);
222+
// eslint-disable-next-line max-params -- five is fine, this function does not get called a lot and I don't want to change everything to a config object
223+
const makeRpcCallParam = <ResultType, ParamType extends RpcValue>(shvPath: StringGetter, method: string, _paramType: z.ZodType<ParamType>, validator: z.ZodType<ResultType>, options?: CallRpcMethodOptions) => async (param: ParamType) => {
224+
const resultOrError = await rpcCall(await resolveString(shvPath), method, param, options);
224225
if (resultOrError instanceof Error) {
225226
return resultOrError;
226227
}

0 commit comments

Comments
 (0)