rust2.0 #1
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hibas123/jrpcgen",
|
||||
"version": "1.2.14",
|
||||
"version": "1.2.16",
|
||||
"main": "lib/index.js",
|
||||
"license": "MIT",
|
||||
"packageManager": "yarn@3.1.1",
|
||||
|
@ -304,7 +304,7 @@ export class TypescriptTarget extends CompileTarget {
|
||||
this.writeFormattedFile(
|
||||
"service_server.ts",
|
||||
this.generateImport(
|
||||
"{ RequestObject, ResponseObject, ErrorCodes, Logging }",
|
||||
"{ type RequestObject, type ResponseObject, ErrorCodes, Logging }",
|
||||
"./service_base"
|
||||
) +
|
||||
this.generateImport(" { VerificationError }", "./ts_base") +
|
||||
|
@ -1,14 +1,14 @@
|
||||
//@template-ignore
|
||||
import { VerificationError } from "./ts_base";
|
||||
//@template-ignore
|
||||
import { RequestObject, ResponseObject, ErrorCodes, Logging } from "./ts_service_base";
|
||||
import { type RequestObject, type ResponseObject, ErrorCodes, Logging } from "./ts_service_base";
|
||||
|
||||
|
||||
export class Service<T> {
|
||||
public name: string = null as any;
|
||||
public functions = new Set<string>();
|
||||
|
||||
constructor() {}
|
||||
constructor() { }
|
||||
}
|
||||
|
||||
type ISendMessageCB = (data: any, catchedErr?: Error) => void;
|
||||
@ -37,7 +37,7 @@ class Session<T> {
|
||||
this.ctx = ctx || {};
|
||||
}
|
||||
|
||||
send(data: any, catchedErr?:Error) {
|
||||
send(data: any, catchedErr?: Error) {
|
||||
Logging.log("SERVER: Sending Message", data)
|
||||
this._send(data, catchedErr);
|
||||
}
|
||||
@ -95,7 +95,7 @@ class Session<T> {
|
||||
}
|
||||
|
||||
let result = await (service as any)["_" + fncName](data.params, this.ctx);
|
||||
if(data.id) { //Request
|
||||
if (data.id) { //Request
|
||||
this.send({
|
||||
jsonrpc: "2.0",
|
||||
id: data.id,
|
||||
|
Loading…
Reference in New Issue
Block a user