* feat(tracker): update message schema with BatchMetadata; separate message-related responsibilities; add message size * chore(docker): removing edge busybox, as the main repo updated * feat(backend): updated message protocol templates * feat(backend): added support of message size * feat(backend): implemented iterator for new message protocol (with message size) Co-authored-by: Alex Kaminskii <alex@openreplay.com>
20 lines
627 B
Text
20 lines
627 B
Text
// Auto-generated, do not edit
|
|
|
|
import * as Messages from '../common/messages.gen.js'
|
|
import Message from '../common/messages.gen.js'
|
|
import PrimitiveEncoder from './PrimitiveEncoder.js'
|
|
|
|
|
|
export default class MessageEncoder extends PrimitiveEncoder {
|
|
encode(msg: Message): boolean {
|
|
switch(msg[0]) {
|
|
<% $messages.select { |msg| msg.tracker }.each do |msg| %>
|
|
case Messages.Type.<%= msg.name %>:
|
|
return <% if msg.attributes.size == 0 %> true <% else %> <%= msg.attributes.map.with_index { |attr, index| "this.#{attr.type}(msg[#{index+1}])" }.join " && " %> <% end %>
|
|
break
|
|
<% end %>
|
|
}
|
|
}
|
|
|
|
}
|
|
|