-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Added Public Ably Message Parsers #249
feature: Added Public Ably Message Parsers #249
Conversation
a4ca505
to
a174606
Compare
a174606
to
b355c5a
Compare
Considering these aren't specifically for use in the chat SDK, should their use be documented elsewhere? |
b355c5a
to
b8cf9a0
Compare
They should always be documented somewhere in the repo that they're implemented, and possibly also in the central Ably docs. But I think something should be added here. |
365e826
to
2069268
Compare
They will have typedocs, but I wasn't sure whether to include example usage in the README too, following |
2069268
to
6db30d5
Compare
6db30d5
to
962a92a
Compare
962a92a
to
b520d55
Compare
Coverage Report
File Coverage
|
b520d55
to
161c6e2
Compare
161c6e2
to
0ed32a5
Compare
0ed32a5
to
c02bd8e
Compare
c02bd8e
to
03f37db
Compare
03f37db
to
027099e
Compare
027099e
to
7c86864
Compare
7c86864
to
ec6636d
Compare
ec6636d
to
7a71a01
Compare
7a71a01
to
60243df
Compare
These functions allow the user to convert encoded messages, such as those received on an integration, and inbound messages, such as those received on a channel subscription, into chat types. - Added two functions that take an encoded object, such as those sent via integration rules, and try to convert them into chat types. - Added `chatMessageFromEncoded` function that will try and convert the encoded object into a chat message. - Added `reactionFromEncoded` function that will try and convert the encoded object into a reaction. - Added `getEntityTypeFromEncoded` function that will also take an encoded object, and attempt to resolve the chat entity type, currently either a chat message or reaction. This can then be used to inform the user which of the two fromEncoded function you need to use. - Added `reactionFromAblyMessage` function that will take an ably inboundMessage and try to convert it to a reaction - Added `chatMessageFromAblyMessage` function that will take an ably inboundMessage and try to convert it to a chat message. - Added `getEntityTypeFromAblyMessage` function that will take an inboundMessage, and attempt to resolve the chat entity type, currently either a chat message or reaction. This can then be used to inform the user which of the two fromAblyMessage functions you need to use. - Added testing for message and reaction parsing since it wasn't covered comprehensively. - Added some example usage to the README.md
60243df
to
c707b65
Compare
Context
Description
Added two functions that take an encoded ably message, such as those sent via integration rules, and try to convert them into chat types.
Added getEntityTypeFromEncoded function that will also take an encoded message, and attempt to resolve the chat entity type, currently either a chat message or reaction. This can then be used to inform the user which of the two fromEncoded function you need to use.
Added two functions that take an ably inbound message, and try to convert them into chat types.
Added getEntityTypeFromAblyMessage function that will take inboundMessage, and attempt to resolve the chat entity type, currently either a chat message or reaction. This can then be used to inform the user which of the two fromAblyMessage functions you need to use.
Moved message and reaction parsing to internal folders for reuse outside their previous classes. Added testing for message and reaction parsing since it wasn't covered comprehensively.
Checklist