A client-side web calls adapter must be implemented as an asynchronous (AMD) JavaScript module accessible located in /[adapter_name]_webcalls_adapter.js (this file can to be put into the main webAppOS web-root directory).
The adapter must implement at least one (or both) of the following functions:
webmemcall | a function for making a call according to the webmemcall calling conventions; it must accept two arguments - the adapter-specific code location (e.g., a function name) and the JavaScript object (from tda.model) corresponding to some repository object passed as an argument |
jsoncall | a function for making a call according to the jsoncall calling conventions; it must accept two arguments - the adapter-specific code location (e.g., a function name) and the call argument, which can be a string or a parsed JSON argument; |
define(function(){
return {
webmemcall: async function(codeLocation, obj) {
// codeLocation is an adapter-specific location (e.g., a function name);
// obj is a repository object as JavaScript object from tda.model
...
},
jsoncall: async function(codeLocation, arg) {
// codeLocation is an adapter-specific location (e.g., a function name);
// arg is a string or a JSON argument parsed into a JavaScript object
...
}
};
});