shekohex / jsonrpc-ts Goto Github PK
View Code? Open in Web Editor NEWStrongly πͺ Typed Fast and lightweight JSON RPC 2.0 Client for Nodejs
License: MIT License
Strongly πͺ Typed Fast and lightweight JSON RPC 2.0 Client for Nodejs
License: MIT License
10.12.8
to 10.12.9
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
@types/node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
TODO: Implement JSON-RPC 2.0 Specification
When typing the return value like so:
const rpcClient = new RpcClient<MyService>({ url });
try {
const {data: {result}} = await rpcClient.makeRequest<'myMethod', ArtistResponse>({
method: 'myMethod', params: { filter: true }, id: '1', jsonrpc: '2.0'
});
console.log(result);
} catch (e) {
console.log(e)
}
It would be nice if there wasn't the redundancy of 'myMethod' in the Typing of templateTRequest
and the method
function argument. Is there a point to keeping these separated. I'm not sure how to express this at the moment
Some of your dependencies are outdated. If Dependabot can't fix it i can add a Pull Request and i will try to fix it :)
Hi, I'm newcomer to frontend and interested in a ligth jsonrpc library for TypeScript. I found this implementation:
https://github.com/jow-/luci-ng/blob/master/luci2-ui-core/src/src/app/shared/jsonrpc.interface.ts
https://github.com/jow-/luci-ng/blob/master/luci2-ui-core/src/src/app/shared/jsonrpc.ts
Also I see a lot of similar packages in NPM like this:
https://github.com/nojvek/noice-json-rpc
But it looks like your lib is newest. Can you give a hint why you decided to implement a new one and what was wrong with others?
How do you access the optional data
property of an RpcError?
RpcError
is defined here:
export class RpcError<TError = any> extends Error {
constructor(private readonly err: RpcResponseError<TError>) {
super();
super.message = err.message;
}
public getCode(): RpcErrorCode | number {
return this.err.code;
}
}
I can get the code
and message
, but the data?
property - which is part of the RpcResponseError
- is not exposed. Or am I missing something?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.