Custom RPC data types definitions.
Members
(static, constant) codeToFormat
- Default Value:
{ "badArgument": "Bad argument at position %d, value %j", "internalError": "%s", "invalidName": "String %s contains invalid characters", "invalidSocket": "Socket %s is not connected", "noCommand": "No such command %s", "listLimitExceeded": "Exceeded %s size limit", "noList": "No such list %s", "noLogin": "No login provided", "noRoom": "No such room %s", "noSocket": "Command %s requires a valid socket", "noUser": "No such user %s", "noUserOnline": "No such user online %s", "notAllowed": "Action is not allowed", "notJoined": "Not joined to room %s", "roomExists": "Room %s already exists", "timeout": "Server operation timeout", "userExists": "User %s already exists", "userOnline": "User %s is online", "wrongArgumentsCount": "Expected %s arguments, got %s" }
Type Definitions
AuthData
Properties:
Name | Type | Description |
---|---|---|
id |
string | Socket id. |
User auth data. May have additional properties.
Type:
- Object
ChatServiceError
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
name |
string | Error name. |
|
code |
string |
<optional> |
Error code. |
args |
Array |
<optional> |
Error format arguments. |
Chat service error representation. Used when chat-service.config.options
useRawErrorObjects
is set.
Type:
- Object
HistoryInfo
Properties:
Name | Type | Description |
---|---|---|
historyMaxGetMessages |
number | Room single get limit. |
historyMaxSize |
number | Room history limit. |
historySize |
number | Room current history size. |
lastMessageId |
number | Room last message id. |
Room history information.
Type:
- Object
Message
Properties:
Name | Type | Description |
---|---|---|
textMessage |
string | Text message. |
Message. Other fields (that do not collide with rpc.datatypes.ProcessedMessage
additional fields) instead of
textMessage
can be used if an appropriate chat-service.hooks.HooksInterface#directMessagesChecker
or chat-service.hooks.HooksInterface#roomMessagesChecker
hook is set.
Type:
- Object
NotificationsInfo
Properties:
Name | Type | Description |
---|---|---|
enableUserlistUpdates |
boolean | If room userlist updates are enabled. |
enableAccessListsUpdates |
boolean | If room access lists updates are enabled. |
Room notifications information.
Type:
- Object
ProcessedMessage
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
textMessage |
string | Text message. |
|
timestamp |
number | Timestamp. |
|
author |
string | Message sender. |
|
id |
number |
<optional> |
Message id, for room messages only. |
Processed Message. Other fields (that do not collide with a server
assigned data) instead of textMessage
can be used if an
appropriate chat-service.hooks.HooksInterface#directMessagesChecker
or chat-service.hooks.HooksInterface#roomMessagesChecker
hook is
set. Includes server assigned data.
Type:
- Object
SocketsInfo
User sockets info. Keys are socket ids, and values are arrays of joined rooms.
Type:
- Object.<string, Array.<string>>
UserSeenInfo
Properties:
Name | Type | Description |
---|---|---|
timestamp |
number | Last state changed. |
joined |
boolean | User's current joined state. |
Room user seen state information.
Type:
- Object