add "about" to scripts

you can get a description if you send a request where in params there is a field about with any content
This commit is contained in:
2025-07-30 18:32:38 +03:00
parent 166c8470d4
commit 6d2bf5cdd2
3 changed files with 26 additions and 5 deletions

View File

@@ -1,5 +1,15 @@
-- com/List.lua -- com/List.lua
if In.Params and In.Params.about then
Out.Result = {
description = "Returns a list of available methods",
params = {
layer = "select which layer list to display"
}
}
return
end
local function isValidCommand(name) local function isValidCommand(name)
return name:match("^[%w]+$") ~= nil return name:match("^[%w]+$") ~= nil
end end

View File

@@ -1,3 +1,13 @@
if In.Params and In.Params.about then
Out.Result = {
description = "Echo of the message",
params = {
msg = "just message"
}
}
return
end
local function validate() local function validate()
if not In.Params.msg or In.Params.msg == "" then if not In.Params.msg or In.Params.msg == "" then
Out.Error = { Out.Error = {

View File

@@ -1,7 +1,8 @@
Log.Event("got ping") if In.Params and In.Params.about then
Log.EventWarn("got ping") Out.Result = {
Log.EventError("got ping") description = "Just ping"
}
Log.Error("mm") return
end
Out.Result.answer = "pong" Out.Result.answer = "pong"