Client -> Server Message Example:
{
token: string|null - The session token
type: string - The message type
payload: object - The payload of the message
}
Server -> Client Message Example:
{
type: string - The message type
payload: object - The payload of the message
}
You would have 2 classes of messages, Tokenless and Tokenful. The tokenless operate regardless of the user, the
login - Tokenless Calls to log in the current session. Payload:
username
string Duh?password
string Duh?
logout Calls to log out the current session Payload:
- All data embedded in the outer container
getUsers Get user data for a number of user ids? Payload:
userIds
array An array of user ids to get the information for
sessionLoggedIn A message to tell the current session that it's now logged in. This message could be used to update a session's token periodically if needed as well. Payload:
userId
The id of the usertoken
The session token
sessionLoginFailed The login request failed Payload:
message
The message to display to the user.
dataCollectionUsers A data collection of users Payload (Example):
{
'23': { // The User ID
... User Data Schema Here
},
...
}