ioBroker / ioBroker.simple-api

HTTP-API Interface to read and write objets and states
MIT License
40 stars 19 forks source link

Add functionality to SimpleApi #134

Closed avdlex closed 2 years ago

avdlex commented 2 years ago

Please add the following functionality: Returning the result of the function (global functions in the Javascript adapter) And the output of the getEnums() function is required

Apollon77 commented 2 years ago

First of all it would be good to have one issue per topic.

Additionally here are questions:

Returning the result of the function (global functions in the Javascript adapter)

So you would like to have a way to execute a function that runs insode the JavaScript Adapter and return the result here? Sorry, but this will never work that way because both topics have nothing to do with each other - and "functions in JavaScript adapter" are completely encapsulated there. There is no way to do what you want.

I could imagine that a "send message" call on Simple-API can be triggered and the response of the message is then returned as response. Since some versions scripts in the the JavaScript adapter can subscribe to messages. That could work.

And the output of the getEnums() function is required Thats means what? You also mean the "getEnums method from the JavaScript adapter"? In fact the raw data are already contained in Objects enum.*

So returning this would be a convenience function, right?

avdlex commented 2 years ago

@GermanBluefox says:

This is a very big security hole. Why don't you create a script in Javascript that responds to a variable, for example javascript.0.execute Function where you write code (2 + 2) and execute it. You write the result in javascript.0.result and take it there. This is also a hole, but you made this hole yourself 😁

@Apollon77 , You gave me the direction. Thank you. I solved my problem.