Ready to request profiles

This commit is contained in:
Luis Fernando Molina committed 2021-09-09 11:45:07 +02:00
1 parent a9cf324199
commit 303c8a9920
9 files changed
+86 -76

No files matched your search

+6
View File
@@ -1492,6 +1492,12 @@
"propertyName": "webAppInterface",
"functionName": "newSocialTradingModulesWebAppInterface",
"fileName": "WebAppInterface.js"
},
{
"name": "Social Graph",
"propertyName": "socialGraph",
"functionName": "newSocialTradingModulesSocialGraph",
"fileName": "SocialGraph.js"
}
],
"utilities": []
@@ -0,0 +1,25 @@
exports.newSocialTradingModulesSocialGraph = function newSocialTradingModulesSocialGraph() {
/*
This module mantains in memory the personal social graph for
the user profile of the user of the Desktop App. A personal social
graph is very similar to the one mantained at a Netwrok Node,
the mainn difference is that it only includes information relevant
to this particular user, and not for al the users in the system
as in the Network Node.
*/
let thisObject = {
messageReceived: messageReceived,
initialize: initialize,
finalize: finalize
}
return thisObject
function finalize() {
}
function initialize() {
}
}
@@ -1,7 +1,10 @@
exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModulesWebAppInterface() {
/*
This module handles the incomming messages from the Web App.
At it's current iteration, it will jusr forward those messages
to the Network Node it is connected to.
*/
let thisObject = {
sendToWebApp: undefined,
messageReceived: messageReceived,
initialize: initialize,
finalize: finalize
@@ -17,11 +20,8 @@ exports.newSocialTradingModulesWebAppInterface = function newSocialTradingModule
}
function messageReceived(messageHeader) {
let response = {
result: 'Ok',
message: 'Hello !'
}
return
async function messageReceived(messageHeader) {
let response = await DK.running.webSocketsClient.sendMessage(messageHeader)
return response
}
}
@@ -1,6 +1,10 @@
exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSocketsInterface() {
/*
This module handles the websockets communication between the
Desktop App's Client and the Destop App's Web App.
*/
let thisObject = {
sendToWebApp: sendToWebApp,
initialize: initialize,
finalize: finalize
}
@@ -27,7 +31,6 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
function setUpWebSocketServer() {
try {
socketServer.on('connection', onConnectionOpened)
webAppInterface.sendToWebApp = sendToWebApp
function onConnectionOpened(socket)
@@ -73,12 +76,12 @@ exports.newDesktopModulesWebSocketsInterface = function newDesktopModulesWebSock
webApp = undefined
}
function sendToWebApp(message) {
webApp.socket.send(JSON.stringify(message))
}
} catch (err) {
console.log('[ERROR] Web Sockets Interface -> setUpWebSocketServer -> err.stack = ' + err.stack)
}
function sendToWebApp(message) {
webApp.socket.send(JSON.stringify(message))
}
}
}
@@ -35,6 +35,11 @@ exports.newDesktopModulesHttpInterface = function newDesktopModulesHttpInterface
let endpointOrFile = requestPath[1]
switch (endpointOrFile) {
case 'Environment':
{
SA.projects.foundations.utilities.httpResponses.respondWithContent(JSON.stringify(global.env), httpResponse)
}
break
case 'ProjectsSchema':
{
let path = global.env.PATH_TO_PROJECTS + '/' + 'ProjectsSchema.json'