Skip to content

Commit

Permalink
materialization: Add message action and additional fields to feature …
Browse files Browse the repository at this point in the history
…documentation

- Added @action@ enum field in the message structure, which specifies the type of the message action. It includes a series of predefined actions (CREATE, UPDATE, DELETE, etc.).
- Added additional fields `serial`, `refSerial`, `refType`, `updatedAt`, `deletedAt`, and `operation` to the Message data type.
- Update the Message class to reflect the new members.
- Added section on REST and Realtime publish that now requires the message action field to be set on publish.
  • Loading branch information
splindsay-92 committed Oct 31, 2024
1 parent ae3261a commit edaf89c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions textile/features.textile
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,16 @@ h4. Message
** @(TM2e)@ @encoding@ string
** @(TM2i)@ @extras@ JSON-encodable object, used to contain any arbitrary key value pairs which may also contain other primitive JSON types, JSON-encodable objects or JSON-encodable arrays. The @extras@ field is provided to contain message metadata and/or ancillary payloads in support of specific functionality, e.g. push. Each of these supported extensions is documented separately; for 1.1 the only supported extension is @push@, via the @extras.push@ member; 1.2 adds the @delta@ extension whose keys and values are described by the attributes of the type @DeltaExtras@, and the @headers@ extension, which contains arbitrary @string->string@ key-value pairs, settable at publish time, and @ref@ whose keys and values are described by the attributes of the type @ReferenceExtras@. Unless otherwise specified, the client library should not attempt to do any filtering or validation of the @extras@ field itself, but should treat it opaquely, encoding it and passing it to realtime unaltered.
** @(TM2f)@ @timestamp@ time in milliseconds since epoch. If a message received from Ably does not contain a @timestamp@, it should be set to the @timestamp@ of the encapsulating @ProtocolMessage@
** @(TM2j)@ @action@ enum
** @(TM2K)@ @serial@ string - an opaque string that uniquely identifies the message.
** @(TM2L)@ @refSerial@ string - an opaque string that uniquely identifies some referenced message.
** @(TM2M)@ @refType@ string - an opaque string that identifies the type of this reference.
** @(TM2N)@ @updatedAt@ time in milliseconds since epoch. This field is always populated on messages received with an @action@ of @MESSAGE_UPDATE@.
** @(TM2O)@ @deletedAt@ time in milliseconds since epoch. This field is always populated on messages received with an @action@ of @MESSAGE_DELETE@.
** @(TM2P)@ @operation@ optional object that may contain the following `optional` attributes;
*** @(TM2P1)@ @clientId@ string
*** @(TM2P2)@ @description@ string
*** @(TM2P3)@ @metadata@ object - used to contain any arbitrary key value pairs of type string.
* @(TM4)@ @Message@ has constructors @constructor(name: String?, data: Data?)@ and @constructor(name: String?, data: Data?, clientId: String?)@.
* @(TM3)@ @fromEncoded@ and @fromEncodedArray@ are alternative constructors that take an (already deserialized) @Message@-like object (or array of such objects), and optionally a @channelOptions@, and return a @Message@ (or array of such @Messages@) that's decoded and decrypted as specified in @RSL6@, using the cipher in the @channelOptions@ if the message is encrypted, with any residual transforms (ones that the library cannot decode or decrypt) left in the @encoding@ property per @RSL6b@. This is intended for users receiving messages other than from a REST or Realtime channel (for example, from a queue), to avoid them having to parse the @encoding@ string themselves.

Expand Down Expand Up @@ -2130,6 +2140,17 @@ enum PresenceAction: // TP2
LEAVE // TP2
UPDATE // TP2

enum MessageAction: // TM5
MESSAGE_UNSET // TM5
MESSAGE_CREATE // TM5
MESSAGE_UPDATE // TM5
MESSAGE_DELETE // TM5
ANNOTATION_CREATE // TM5
ANNOTATION_DELETE // TM5
META_OCCUPANCY // TM5



class ConnectionDetails: // CD*, internal
clientId: String? // RSA12a, CD2a
connectionKey: String // RTN15e, CD2b
Expand All @@ -2154,6 +2175,13 @@ class Message: // TM*
id: String // TM2a
name: String? // TM2g
timestamp: Time // TM2f
action: MessageAction // TM2j
serial: string // TM2K
refSerial: string? // TM2L
refType: string? // TM2M
updatedAt: Time? // TM2N
deletedAt: Time? // TM2O
operation: JsonObject? // TM2P

class PresenceMessage // TP*
+fromEncoded(JsonObject, ChannelOptions?) -> PresenceMessage // TP4
Expand Down

0 comments on commit edaf89c

Please sign in to comment.