From e15ce1f0a0f8dc0ef083e3ac1eb0e162bcffc295 Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Thu, 30 Nov 2023 00:16:53 +0100 Subject: [PATCH] Fix more --- package.json | 4 ++-- src/targets/typescript.ts | 2 +- templates/ts_service_server.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index e05f69b..a543fe9 100644 --- a/package.json +++ b/package.json @@ -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", @@ -48,4 +48,4 @@ "dependencies": { "fs-extra": "^10.0.0" } -} +} \ No newline at end of file diff --git a/src/targets/typescript.ts b/src/targets/typescript.ts index bf256f2..014b480 100644 --- a/src/targets/typescript.ts +++ b/src/targets/typescript.ts @@ -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") + diff --git a/templates/ts_service_server.ts b/templates/ts_service_server.ts index c8c3ec9..0a4e011 100644 --- a/templates/ts_service_server.ts +++ b/templates/ts_service_server.ts @@ -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 { public name: string = null as any; public functions = new Set(); - constructor() {} + constructor() { } } type ISendMessageCB = (data: any, catchedErr?: Error) => void; @@ -37,7 +37,7 @@ class Session { 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 { } 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,