From 5d9fb71753f09513a01cfacbd9a4685c55f3ceca Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 19 Aug 2024 00:35:23 +0900 Subject: [PATCH] Replace GRPC proto file and delete the related file --- app/assets/protos/WelsonAppLoader.proto | 14 ---- app/assets/protos/WelsonJS.GrpcService.proto | 15 +++++ scriptcontrol.js | 71 -------------------- 3 files changed, 15 insertions(+), 85 deletions(-) delete mode 100644 app/assets/protos/WelsonAppLoader.proto create mode 100644 app/assets/protos/WelsonJS.GrpcService.proto delete mode 100644 scriptcontrol.js diff --git a/app/assets/protos/WelsonAppLoader.proto b/app/assets/protos/WelsonAppLoader.proto deleted file mode 100644 index 2274d6c..0000000 --- a/app/assets/protos/WelsonAppLoader.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -service WelsonAppLoader { - rpc Run (AppRequest) returns (AppResponse) {} -} - -message AppRequest { - string appName = 1; -} - -// The response message containing the greetings -message AppResponse { - string responseText = 1; -} diff --git a/app/assets/protos/WelsonJS.GrpcService.proto b/app/assets/protos/WelsonJS.GrpcService.proto new file mode 100644 index 0000000..b3b542f --- /dev/null +++ b/app/assets/protos/WelsonJS.GrpcService.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; + +option csharp_namespace = "WelsonJS.GrpcService"; + +service MessageController { + rpc SendMessageStream (MessageRequest) returns (stream MessageReply); +} + +message MessageRequest { + string clientId = 1; +} + +message MessageReply { + string message = 1; +} \ No newline at end of file diff --git a/scriptcontrol.js b/scriptcontrol.js deleted file mode 100644 index b83c28c..0000000 --- a/scriptcontrol.js +++ /dev/null @@ -1,71 +0,0 @@ -// scriptcontrol.js -// The Simplified entrypoint for win32com (based on MSScriptControl.ScriptControl) - -var workingDirectory = ""; - -if (typeof CreateObject === "undefined") { - var CreateObject = function(progId, serverName, callback) { - var progIds = (progId instanceof Array ? progId : [progId]); - - for (var i = 0; i < progIds.length; i++) { - try { - var obj = CreateObject.make(progIds[i], serverName); - if (typeof callback === "function") { - callback(obj, progIds[i]); - } - return obj; - } catch (e) { - console.error(e.message); - }; - } - }; - CreateObject.make = function(p, s) { - if (typeof WScript !== "undefined") { - return WScript.CreateObject(p, s); - } else if (typeof ActiveXObject !== "undefined") { - return new ActiveXObject(p); - } - }; -} - -function readFile(FN, charset) { - if(typeof(charset) === "undefined") { - var FSO = CreateObject("Scripting.FileSystemObject"); - var T = null; - try { - var TS = FSO.OpenTextFile(FN, 1); - if (TS.AtEndOfStream) return ""; - T = TS.ReadAll(); - TS.Close(); - TS = null; - } catch (e) { - console.log("ERROR! " + e.number + ", " + e.description + ", FN=" + FN); - } - FSO = null; - return T; - } else { - var fsT = CreateObject("ADODB.Stream"); - fsT.CharSet = charset; - fsT.Open(); - fsT.LoadFromFile(FN); - T = fsT.ReadText(); - fsT = null; - return T; - } -} - -function setWorkingDirectory(directory) { - workingDirectory = directory; -} - -function run(targetName) { - var w = CreateObject("WScript.Shell") - , stdOutPath = "tmp\\stdout.txt" - , stdErrPath = "tmp\\stderr.txt" - ; - if (workingDirectory != "") { - w.CurrentDirectory = workingDirectory; - } - w.Run("%comspec% /c (cscript //NoLogo app.js " + targetName + ") 1> " + stdOutPath + " 2> " + stdErrPath, 0, true); - return readFile(stdOutPath, "utf-8"); -}