Go to file
2022-12-28 10:19:45 +01:00
.vscode Add alias flag for allowing bytes 2022-04-12 20:56:46 +00:00
.yarn
examples Finish implementation of new Rust Tokio Target 2022-12-17 17:11:28 +01:00
src Add allow_non_snake on fields in rust 2022-12-28 10:19:45 +01:00
templates Add allow_non_snake on fields in rust 2022-12-28 10:19:45 +01:00
.editorconfig Prepare work on Rust2.0 with async/tokio support 2022-12-11 23:37:08 +01:00
.gitignore Add pubspec.yaml 2022-07-21 09:09:10 +02:00
.yarnrc.yml Start implementing ZIG 2022-07-16 21:25:19 +00:00
meta.json Add alias flag for allowing bytes 2022-04-12 20:56:46 +00:00
package.json Add allow_non_snake on fields in rust 2022-12-28 10:19:45 +01:00
README.md Adding some Readme stuff 2022-01-03 21:08:25 +00:00
tsconfig.json
yarn.lock Adding C# Support. Badly tested currently, but kindof working 2022-01-05 21:16:17 +00:00

JSON-RPC 2.0 Code-Gen

Type/Service definition language and code generator for json-rpc 2.0. Currently generating code for NodeJS, Deno and the Web. Other targets are possible, but not implemented yet.

Name Description
ts-node Typescript for NodeJS
ts-esm Typescript in ESM format for Deno

Usage

Create a definition file like test.jrpc:

enum TestEnum {
  VAL1,
  VAL2,
  VAL10 = 10,
  VAL11,
  VAL12
}

type Test {
  testen: TestEnum;
  someString: string;
  someNumber: number;
  array: string[];
  map: {number, TestEnum};
}

service TestService {
  @Description("This Function adds two number")
  @Param("v1", "The first Number")
  @Param("v2", "The second Number")
  @Returns("The added values of the two numbers")
  AddNumbers(v1: number,  v2: number): number;


  notification SendTest(test: Test);
}

Then run the generator like this jrpc compile test.jrpc -o=ts-node:output/.

This will generate the Client and Server code in the specified folder.

//TODO: Make Documentation better