feat!: big feature changes

BREAKING CHANGES:
- Heartbeating removed
- `config.consoleLogLevel` -> `config.logLevel`

NEW FEATURES:
- Training messages
- Sequence number system
- WebSocket close codes used instead of disconnect packets

FIXES:
- Improved error handling
- Some performance improvements
- Made code more clean
- Updated dependencies
This commit is contained in:
PalmDevs
2024-03-28 21:41:59 +07:00
parent 77f1a9cb3e
commit b3b7723b4f
33 changed files with 562 additions and 506 deletions

View File

@@ -2,33 +2,28 @@
* Client operation codes for the gateway
*/
export enum ClientOperation {
/**
* Client's heartbeat (to check if the connection is dead or not)
*/
Heartbeat = 100,
/**
* Client's request to parse text
*/
ParseText = 110,
ParseText = 100,
/**
* Client's request to parse image
*/
ParseImage = 111,
ParseImage = 101,
/**
* Client's request to train a message
*/
TrainMessage = 102,
}
/**
* Server operation codes for the gateway
*/
export enum ServerOperation {
/**
* Server's acknowledgement of a client's heartbeat
*/
HeartbeatAck = 1,
/**
* Server's initial response to a client's connection
*/
Hello = 2,
Hello = 1,
/**
* Server's response to client's request to parse text
@@ -46,6 +41,14 @@ export enum ServerOperation {
* Server's failure response to client's request to parse image
*/
ParseImageFailed = 13,
/**
* Server's response to client's request to train a message
*/
TrainedMessage = 14,
/**
* Server's failure response to client's request to train a message
*/
TrainMessageFailed = 15,
/**
* Server's disconnect message