refactor(mobs):update comments, remove deprecated since one release back
This commit is contained in:
parent
7dec39300f
commit
d310ca7bfe
15 changed files with 1724 additions and 1797 deletions
|
|
@ -11,4 +11,4 @@ func IsIOSType(id int) bool {
|
|||
|
||||
func IsDOMType(id int) bool {
|
||||
return 0 == id || 4 == id || 5 == id || 6 == id || 7 == id || 8 == id || 9 == id || 10 == id || 11 == id || 12 == id || 13 == id || 14 == id || 15 == id || 16 == id || 18 == id || 19 == id || 20 == id || 37 == id || 38 == id || 49 == id || 54 == id || 55 == id || 57 == id || 58 == id || 59 == id || 60 == id || 61 == id || 67 == id || 69 == id || 70 == id || 71 == id || 72 == id || 73 == id || 74 == id || 75 == id || 76 == id || 77 == id || 90 == id || 93 == id || 96 == id || 100 == id || 102 == id || 103 == id || 105 == id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func NewEnderMessageIterator(messageHandler MessageHandler, messageFilter []int,
|
|||
iter.preFilter = map[int]struct{}{
|
||||
MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {},
|
||||
MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {},
|
||||
MsgSessionEndDeprecated: {}}
|
||||
}
|
||||
return iter
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ func (i *enderMessageIteratorImpl) Iterate(batchData []byte, batchInfo *BatchInf
|
|||
// Update last timestamp message
|
||||
lastMessage = msg
|
||||
}
|
||||
|
||||
|
||||
if lastMessage != nil {
|
||||
i.handler(lastMessage)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func NewSinkMessageIterator(messageHandler MessageHandler, messageFilter []int,
|
|||
iter.preFilter = map[int]struct{}{
|
||||
MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {},
|
||||
MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {},
|
||||
MsgSessionEndDeprecated: {}}
|
||||
}
|
||||
return iter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ func NewMessageIterator(messageHandler MessageHandler, messageFilter []int, auto
|
|||
iter.preFilter = map[int]struct{}{
|
||||
MsgBatchMetadata: {}, MsgBatchMeta: {}, MsgTimestamp: {},
|
||||
MsgSessionStart: {}, MsgSessionEnd: {}, MsgSetPageLocation: {},
|
||||
MsgSessionEndDeprecated: {}}
|
||||
}
|
||||
return iter
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,11 +9,6 @@ func transformDeprecated(msg Message) Message {
|
|||
Payload: m.Payload,
|
||||
Metadata: "{}",
|
||||
}
|
||||
case *SessionEndDeprecated:
|
||||
return &SessionEnd{
|
||||
Timestamp: m.Timestamp,
|
||||
EncryptionKey: "",
|
||||
}
|
||||
case *Fetch:
|
||||
return &NetworkRequest{
|
||||
Type: "fetch",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -681,14 +681,6 @@ class AdoptedSSRemoveOwner(Message):
|
|||
self.id = id
|
||||
|
||||
|
||||
class Zustand(Message):
|
||||
__id__ = 79
|
||||
|
||||
def __init__(self, mutation, state):
|
||||
self.mutation = mutation
|
||||
self.state = state
|
||||
|
||||
|
||||
class JSException(Message):
|
||||
__id__ = 78
|
||||
|
||||
|
|
@ -699,6 +691,14 @@ class JSException(Message):
|
|||
self.metadata = metadata
|
||||
|
||||
|
||||
class Zustand(Message):
|
||||
__id__ = 79
|
||||
|
||||
def __init__(self, mutation, state):
|
||||
self.mutation = mutation
|
||||
self.state = state
|
||||
|
||||
|
||||
class BatchMeta(Message):
|
||||
__id__ = 80
|
||||
|
||||
|
|
|
|||
|
|
@ -611,12 +611,6 @@ class MessageCodec(Codec):
|
|||
id=self.read_uint(reader)
|
||||
)
|
||||
|
||||
if message_id == 79:
|
||||
return Zustand(
|
||||
mutation=self.read_string(reader),
|
||||
state=self.read_string(reader)
|
||||
)
|
||||
|
||||
if message_id == 78:
|
||||
return JSException(
|
||||
name=self.read_string(reader),
|
||||
|
|
@ -625,6 +619,12 @@ class MessageCodec(Codec):
|
|||
metadata=self.read_string(reader)
|
||||
)
|
||||
|
||||
if message_id == 79:
|
||||
return Zustand(
|
||||
mutation=self.read_string(reader),
|
||||
state=self.read_string(reader)
|
||||
)
|
||||
|
||||
if message_id == 80:
|
||||
return BatchMeta(
|
||||
page_no=self.read_uint(reader),
|
||||
|
|
|
|||
|
|
@ -151,13 +151,6 @@ type TrPageRenderTiming = [
|
|||
timeToInteractive: number,
|
||||
]
|
||||
|
||||
type TrJSExceptionDeprecated = [
|
||||
type: 25,
|
||||
name: string,
|
||||
message: string,
|
||||
payload: string,
|
||||
]
|
||||
|
||||
type TrCustomEvent = [
|
||||
type: 27,
|
||||
name: string,
|
||||
|
|
@ -394,12 +387,6 @@ type TrAdoptedSSRemoveOwner = [
|
|||
id: number,
|
||||
]
|
||||
|
||||
type TrZustand = [
|
||||
type: 79,
|
||||
mutation: string,
|
||||
state: string,
|
||||
]
|
||||
|
||||
type TrJSException = [
|
||||
type: 78,
|
||||
name: string,
|
||||
|
|
@ -408,6 +395,12 @@ type TrJSException = [
|
|||
metadata: string,
|
||||
]
|
||||
|
||||
type TrZustand = [
|
||||
type: 79,
|
||||
mutation: string,
|
||||
state: string,
|
||||
]
|
||||
|
||||
type TrBatchMetadata = [
|
||||
type: 81,
|
||||
version: number,
|
||||
|
|
@ -424,7 +417,7 @@ type TrPartitionedMessage = [
|
|||
]
|
||||
|
||||
|
||||
export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrJSExceptionDeprecated | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrResourceTiming | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrZustand | TrJSException | TrBatchMetadata | TrPartitionedMessage
|
||||
export type TrackerMessage = TrTimestamp | TrSetPageLocation | TrSetViewportSize | TrSetViewportScroll | TrCreateDocument | TrCreateElementNode | TrCreateTextNode | TrMoveNode | TrRemoveNode | TrSetNodeAttribute | TrRemoveNodeAttribute | TrSetNodeData | TrSetNodeScroll | TrSetInputTarget | TrSetInputValue | TrSetInputChecked | TrMouseMove | TrNetworkRequest | TrConsoleLog | TrPageLoadTiming | TrPageRenderTiming | TrCustomEvent | TrUserID | TrUserAnonymousID | TrMetadata | TrCSSInsertRule | TrCSSDeleteRule | TrFetch | TrProfiler | TrOTable | TrStateAction | TrRedux | TrVuex | TrMobX | TrNgRx | TrGraphQL | TrPerformanceTrack | TrResourceTiming | TrConnectionInformation | TrSetPageVisibility | TrLoadFontFace | TrSetNodeFocus | TrLongTask | TrSetNodeAttributeURLBased | TrSetCSSDataURLBased | TrTechnicalInfo | TrCustomIssue | TrCSSInsertRuleURLBased | TrMouseClick | TrCreateIFrameDocument | TrAdoptedSSReplaceURLBased | TrAdoptedSSInsertRuleURLBased | TrAdoptedSSDeleteRule | TrAdoptedSSAddOwner | TrAdoptedSSRemoveOwner | TrJSException | TrZustand | TrBatchMetadata | TrPartitionedMessage
|
||||
|
||||
export default function translate(tMsg: TrackerMessage): RawMessage | null {
|
||||
switch(tMsg[0]) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@ message 1, 'SessionStart', :tracker => false, :replayer => false do
|
|||
end
|
||||
## message 2, 'CreateDocument', do
|
||||
# end
|
||||
|
||||
# DEPRECATED; backend only (TODO: remove in the next release)
|
||||
message 3, 'SessionEndDeprecated', :tracker => false, :replayer => false do
|
||||
uint 'Timestamp'
|
||||
end
|
||||
|
|
@ -132,8 +134,8 @@ message 24, 'PageRenderTiming', :replayer => false do
|
|||
uint 'VisuallyComplete'
|
||||
uint 'TimeToInteractive'
|
||||
end
|
||||
# deprecated since 4.1.6 / 1.8.2 in favor of #78
|
||||
message 25, 'JSExceptionDeprecated', :replayer => false do
|
||||
# DEPRECATED since 4.1.6 / 1.8.2 in favor of #78
|
||||
message 25, 'JSExceptionDeprecated', :replayer => false, :tracker => false do
|
||||
string 'Name'
|
||||
string 'Message'
|
||||
string 'Payload'
|
||||
|
|
@ -192,15 +194,7 @@ message 33, 'ClickEvent', :tracker => false, :replayer => false do
|
|||
string 'Label'
|
||||
string 'Selector'
|
||||
end
|
||||
# removed (backend-only)
|
||||
# message 34, 'ErrorEvent', :tracker => false, :replayer => false do
|
||||
# uint 'MessageID'
|
||||
# uint 'Timestamp'
|
||||
# string 'Source'
|
||||
# string 'Name'
|
||||
# string 'Message'
|
||||
# string 'Payload'
|
||||
# end
|
||||
## 34
|
||||
message 35, 'ResourceEvent', :tracker => false, :replayer => false do
|
||||
uint 'MessageID'
|
||||
uint 'Timestamp'
|
||||
|
|
@ -215,27 +209,21 @@ message 35, 'ResourceEvent', :tracker => false, :replayer => false do
|
|||
string 'Method'
|
||||
uint 'Status'
|
||||
end
|
||||
# removed (backend-only)
|
||||
# message 36, 'CustomEvent', :tracker => false, :replayer => false do
|
||||
# uint 'MessageID'
|
||||
# uint 'Timestamp'
|
||||
# string 'Name'
|
||||
# string 'Payload'
|
||||
# end
|
||||
#36
|
||||
|
||||
# deprecated since 4.0.2 in favor of AdoptedSSInsertRule + AdoptedSSAddOwner
|
||||
# DEPRECATED since 4.0.2 in favor of AdoptedSSInsertRule + AdoptedSSAddOwner
|
||||
message 37, 'CSSInsertRule' do
|
||||
uint 'ID'
|
||||
string 'Rule'
|
||||
uint 'Index'
|
||||
end
|
||||
# deprecated since 4.0.2
|
||||
# DEPRECATED since 4.0.2
|
||||
message 38, 'CSSDeleteRule' do
|
||||
uint 'ID'
|
||||
uint 'Index'
|
||||
end
|
||||
|
||||
# deprecated since 4.1.10 in favor of NetworkRequest
|
||||
# DEPRECATED since 4.1.10 in favor of NetworkRequest
|
||||
message 39, 'Fetch', :replayer => :devtools do
|
||||
string 'Method'
|
||||
string 'URL'
|
||||
|
|
@ -258,12 +246,7 @@ end
|
|||
message 42, 'StateAction', :replayer => false do
|
||||
string 'Type'
|
||||
end
|
||||
# removed (backend-only)
|
||||
# message 43, 'StateActionEvent', :tracker => false, :replayer => false do
|
||||
# uint 'MessageID'
|
||||
# uint 'Timestamp'
|
||||
# string 'Type'
|
||||
# end
|
||||
## 43
|
||||
message 44, 'Redux', :replayer => :devtools do
|
||||
string 'Action'
|
||||
string 'State'
|
||||
|
|
@ -294,26 +277,8 @@ message 49, 'PerformanceTrack' do #, :replayer => :devtools --> requires player
|
|||
uint 'TotalJSHeapSize'
|
||||
uint 'UsedJSHeapSize'
|
||||
end
|
||||
# removed (backend-only)
|
||||
# message 50, 'GraphQLEvent', :tracker => false, :replayer => false do
|
||||
# uint 'MessageID'
|
||||
# uint 'Timestamp'
|
||||
# string 'OperationKind'
|
||||
# string 'OperationName'
|
||||
# string 'Variables'
|
||||
# string 'Response'
|
||||
# end
|
||||
# removed (backend-only)
|
||||
# message 51, 'FetchEvent', :tracker => false, :replayer => false do
|
||||
# uint 'MessageID'
|
||||
# uint 'Timestamp'
|
||||
# string 'Method'
|
||||
# string 'URL'
|
||||
# string 'Request'
|
||||
# string 'Response'
|
||||
# uint 'Status'
|
||||
# uint 'Duration'
|
||||
# end
|
||||
## 50,51
|
||||
# Doesn't work properly. TODO: Make proper detections in tracker
|
||||
message 52, 'DOMDrop', :tracker => false, :replayer => false do
|
||||
uint 'Timestamp'
|
||||
end
|
||||
|
|
@ -363,7 +328,7 @@ message 58, 'SetNodeFocus' do
|
|||
int 'ID'
|
||||
end
|
||||
|
||||
#Deprecated (since 3.0.?)
|
||||
#DEPRECATED (since 3.0.?)
|
||||
message 59, 'LongTask' do
|
||||
uint 'Timestamp'
|
||||
uint 'Duration'
|
||||
|
|
@ -385,6 +350,7 @@ message 61, 'SetCSSDataURLBased' do
|
|||
string 'Data'
|
||||
string 'BaseURL'
|
||||
end
|
||||
# DEPRECATED; backend only (TODO: remove in the next release)
|
||||
message 62, 'IssueEventDeprecated', :replayer => false, :tracker => false do
|
||||
uint 'MessageID'
|
||||
uint 'Timestamp'
|
||||
|
|
@ -459,22 +425,23 @@ message 77, 'AdoptedSSRemoveOwner' do
|
|||
uint 'SheetID'
|
||||
uint 'ID'
|
||||
end
|
||||
message 79, 'Zustand', :replayer => :devtools do
|
||||
string 'Mutation'
|
||||
string 'State'
|
||||
end
|
||||
message 78, 'JSException', :replayer => false do
|
||||
string 'Name'
|
||||
string 'Message'
|
||||
string 'Payload'
|
||||
string 'Metadata'
|
||||
end
|
||||
message 79, 'Zustand', :replayer => :devtools do
|
||||
string 'Mutation'
|
||||
string 'State'
|
||||
end
|
||||
|
||||
|
||||
# 80 -- 90 reserved
|
||||
|
||||
# Special one for Batch Metadata. Message id could define the version
|
||||
|
||||
# Deprecated since tracker 3.6.0 in favor of BatchMetadata
|
||||
# DEPRECATED since tracker 3.6.0 in favor of BatchMetadata
|
||||
message 80, 'BatchMeta', :replayer => false, :tracker => false do
|
||||
uint 'PageNo'
|
||||
uint 'FirstIndex'
|
||||
|
|
@ -496,6 +463,8 @@ message 82, 'PartitionedMessage', :replayer => false do
|
|||
uint 'PartTotal'
|
||||
end
|
||||
|
||||
|
||||
## Backend-only
|
||||
message 125, 'IssueEvent', :replayer => false, :tracker => false do
|
||||
uint 'MessageID'
|
||||
uint 'Timestamp'
|
||||
|
|
@ -505,12 +474,10 @@ message 125, 'IssueEvent', :replayer => false, :tracker => false do
|
|||
string 'Payload'
|
||||
string 'URL'
|
||||
end
|
||||
|
||||
message 126, 'SessionEnd', :tracker => false, :replayer => false do
|
||||
uint 'Timestamp'
|
||||
string 'EncryptionKey'
|
||||
end
|
||||
|
||||
message 127, 'SessionSearch', :tracker => false, :replayer => false do
|
||||
uint 'Timestamp'
|
||||
uint 'Partition'
|
||||
|
|
|
|||
|
|
@ -9,11 +9,11 @@ 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| %>
|
||||
<% $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 %>
|
||||
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 %>
|
||||
<% end %>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ export declare const enum Type {
|
|||
ConsoleLog = 22,
|
||||
PageLoadTiming = 23,
|
||||
PageRenderTiming = 24,
|
||||
JSExceptionDeprecated = 25,
|
||||
CustomEvent = 27,
|
||||
UserID = 28,
|
||||
UserAnonymousID = 29,
|
||||
|
|
@ -58,8 +57,8 @@ export declare const enum Type {
|
|||
AdoptedSSDeleteRule = 75,
|
||||
AdoptedSSAddOwner = 76,
|
||||
AdoptedSSRemoveOwner = 77,
|
||||
Zustand = 79,
|
||||
JSException = 78,
|
||||
Zustand = 79,
|
||||
BatchMetadata = 81,
|
||||
PartitionedMessage = 82,
|
||||
}
|
||||
|
|
@ -211,13 +210,6 @@ export type PageRenderTiming = [
|
|||
/*timeToInteractive:*/ number,
|
||||
]
|
||||
|
||||
export type JSExceptionDeprecated = [
|
||||
/*type:*/ Type.JSExceptionDeprecated,
|
||||
/*name:*/ string,
|
||||
/*message:*/ string,
|
||||
/*payload:*/ string,
|
||||
]
|
||||
|
||||
export type CustomEvent = [
|
||||
/*type:*/ Type.CustomEvent,
|
||||
/*name:*/ string,
|
||||
|
|
@ -454,12 +446,6 @@ export type AdoptedSSRemoveOwner = [
|
|||
/*id:*/ number,
|
||||
]
|
||||
|
||||
export type Zustand = [
|
||||
/*type:*/ Type.Zustand,
|
||||
/*mutation:*/ string,
|
||||
/*state:*/ string,
|
||||
]
|
||||
|
||||
export type JSException = [
|
||||
/*type:*/ Type.JSException,
|
||||
/*name:*/ string,
|
||||
|
|
@ -468,6 +454,12 @@ export type JSException = [
|
|||
/*metadata:*/ string,
|
||||
]
|
||||
|
||||
export type Zustand = [
|
||||
/*type:*/ Type.Zustand,
|
||||
/*mutation:*/ string,
|
||||
/*state:*/ string,
|
||||
]
|
||||
|
||||
export type BatchMetadata = [
|
||||
/*type:*/ Type.BatchMetadata,
|
||||
/*version:*/ number,
|
||||
|
|
@ -484,5 +476,5 @@ export type PartitionedMessage = [
|
|||
]
|
||||
|
||||
|
||||
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | JSExceptionDeprecated | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | ResourceTiming | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | Zustand | JSException | BatchMetadata | PartitionedMessage
|
||||
type Message = Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | NetworkRequest | ConsoleLog | PageLoadTiming | PageRenderTiming | CustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | ResourceTiming | ConnectionInformation | SetPageVisibility | LoadFontFace | SetNodeFocus | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument | AdoptedSSReplaceURLBased | AdoptedSSInsertRuleURLBased | AdoptedSSDeleteRule | AdoptedSSAddOwner | AdoptedSSRemoveOwner | JSException | Zustand | BatchMetadata | PartitionedMessage
|
||||
export default Message
|
||||
|
|
|
|||
|
|
@ -276,19 +276,6 @@ export function PageRenderTiming(
|
|||
]
|
||||
}
|
||||
|
||||
export function JSExceptionDeprecated(
|
||||
name: string,
|
||||
message: string,
|
||||
payload: string,
|
||||
): Messages.JSExceptionDeprecated {
|
||||
return [
|
||||
Messages.Type.JSExceptionDeprecated,
|
||||
name,
|
||||
message,
|
||||
payload,
|
||||
]
|
||||
}
|
||||
|
||||
export function CustomEvent(
|
||||
name: string,
|
||||
payload: string,
|
||||
|
|
@ -727,17 +714,6 @@ export function AdoptedSSRemoveOwner(
|
|||
]
|
||||
}
|
||||
|
||||
export function Zustand(
|
||||
mutation: string,
|
||||
state: string,
|
||||
): Messages.Zustand {
|
||||
return [
|
||||
Messages.Type.Zustand,
|
||||
mutation,
|
||||
state,
|
||||
]
|
||||
}
|
||||
|
||||
export function JSException(
|
||||
name: string,
|
||||
message: string,
|
||||
|
|
@ -753,6 +729,17 @@ export function JSException(
|
|||
]
|
||||
}
|
||||
|
||||
export function Zustand(
|
||||
mutation: string,
|
||||
state: string,
|
||||
): Messages.Zustand {
|
||||
return [
|
||||
Messages.Type.Zustand,
|
||||
mutation,
|
||||
state,
|
||||
]
|
||||
}
|
||||
|
||||
export function BatchMetadata(
|
||||
version: number,
|
||||
pageNo: number,
|
||||
|
|
|
|||
|
|
@ -9,247 +9,243 @@ import PrimitiveEncoder from './PrimitiveEncoder.js'
|
|||
export default class MessageEncoder extends PrimitiveEncoder {
|
||||
encode(msg: Message): boolean {
|
||||
switch(msg[0]) {
|
||||
|
||||
|
||||
case Messages.Type.Timestamp:
|
||||
return this.uint(msg[1])
|
||||
return this.uint(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetPageLocation:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetViewportSize:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetViewportScroll:
|
||||
return this.int(msg[1]) && this.int(msg[2])
|
||||
return this.int(msg[1]) && this.int(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CreateDocument:
|
||||
return true
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CreateElementNode:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.string(msg[4]) && this.boolean(msg[5])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.string(msg[4]) && this.boolean(msg[5])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CreateTextNode:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.MoveNode:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.RemoveNode:
|
||||
return this.uint(msg[1])
|
||||
return this.uint(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetNodeAttribute:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.RemoveNodeAttribute:
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetNodeData:
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetNodeScroll:
|
||||
return this.uint(msg[1]) && this.int(msg[2]) && this.int(msg[3])
|
||||
return this.uint(msg[1]) && this.int(msg[2]) && this.int(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetInputTarget:
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetInputValue:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.int(msg[3])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.int(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetInputChecked:
|
||||
return this.uint(msg[1]) && this.boolean(msg[2])
|
||||
return this.uint(msg[1]) && this.boolean(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.MouseMove:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.NetworkRequest:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.string(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) && this.uint(msg[8])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.string(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) && this.uint(msg[8])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.ConsoleLog:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.PageLoadTiming:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) && this.uint(msg[8]) && this.uint(msg[9])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.uint(msg[7]) && this.uint(msg[8]) && this.uint(msg[9])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.PageRenderTiming:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
case Messages.Type.JSExceptionDeprecated:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CustomEvent:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.UserID:
|
||||
return this.string(msg[1])
|
||||
return this.string(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.UserAnonymousID:
|
||||
return this.string(msg[1])
|
||||
return this.string(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.Metadata:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CSSInsertRule:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CSSDeleteRule:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.Fetch:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.uint(msg[7])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.uint(msg[7])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.Profiler:
|
||||
return this.string(msg[1]) && this.uint(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
return this.string(msg[1]) && this.uint(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.OTable:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.StateAction:
|
||||
return this.string(msg[1])
|
||||
return this.string(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.Redux:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.Vuex:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.MobX:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.NgRx:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.uint(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.GraphQL:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.PerformanceTrack:
|
||||
return this.int(msg[1]) && this.int(msg[2]) && this.uint(msg[3]) && this.uint(msg[4])
|
||||
return this.int(msg[1]) && this.int(msg[2]) && this.uint(msg[3]) && this.uint(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.ResourceTiming:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.string(msg[7]) && this.string(msg[8])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.uint(msg[5]) && this.uint(msg[6]) && this.string(msg[7]) && this.string(msg[8])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.ConnectionInformation:
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
return this.uint(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetPageVisibility:
|
||||
return this.boolean(msg[1])
|
||||
return this.boolean(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.LoadFontFace:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetNodeFocus:
|
||||
return this.int(msg[1])
|
||||
return this.int(msg[1])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.LongTask:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.string(msg[5]) && this.string(msg[6]) && this.string(msg[7])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.uint(msg[4]) && this.string(msg[5]) && this.string(msg[6]) && this.string(msg[7])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetNodeAttributeURLBased:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.SetCSSDataURLBased:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.TechnicalInfo:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CustomIssue:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CSSInsertRuleURLBased:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3]) && this.string(msg[4])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.MouseClick:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.CreateIFrameDocument:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.AdoptedSSReplaceURLBased:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.string(msg[3])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.AdoptedSSInsertRuleURLBased:
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3]) && this.string(msg[4])
|
||||
return this.uint(msg[1]) && this.string(msg[2]) && this.uint(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.AdoptedSSDeleteRule:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.AdoptedSSAddOwner:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.AdoptedSSRemoveOwner:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
case Messages.Type.Zustand:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.JSException:
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) && this.string(msg[4])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.Zustand:
|
||||
return this.string(msg[1]) && this.string(msg[2])
|
||||
break
|
||||
|
||||
case Messages.Type.BatchMetadata:
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.int(msg[4]) && this.string(msg[5])
|
||||
return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) && this.int(msg[4]) && this.string(msg[5])
|
||||
break
|
||||
|
||||
|
||||
case Messages.Type.PartitionedMessage:
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
return this.uint(msg[1]) && this.uint(msg[2])
|
||||
break
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue