From f5290540cdd781ae220abd039d1106aa64627866 Mon Sep 17 00:00:00 2001 From: Alex Kaminskii Date: Wed, 3 Aug 2022 12:58:14 +0200 Subject: [PATCH] style(tracker): no .gen.ts files prettifying --- tracker/tracker/.prettierignore | 1 + tracker/tracker/src/common/messages.gen.ts | 284 ++++++---- tracker/tracker/src/main/app/messages.gen.ts | 488 ++++++++++++++---- .../src/webworker/MessageEncoder.gen.ts | 464 ++++++++--------- 4 files changed, 792 insertions(+), 445 deletions(-) create mode 100644 tracker/tracker/.prettierignore diff --git a/tracker/tracker/.prettierignore b/tracker/tracker/.prettierignore new file mode 100644 index 000000000..89421c20a --- /dev/null +++ b/tracker/tracker/.prettierignore @@ -0,0 +1 @@ +*.gen.ts diff --git a/tracker/tracker/src/common/messages.gen.ts b/tracker/tracker/src/common/messages.gen.ts index 14e868325..6d5bd83a4 100644 --- a/tracker/tracker/src/common/messages.gen.ts +++ b/tracker/tracker/src/common/messages.gen.ts @@ -53,6 +53,7 @@ export enum Type { CreateIFrameDocument = 70, } + export type BatchMetadata = [ type: Type.BatchMetadata, version: number, @@ -60,24 +61,42 @@ export type BatchMetadata = [ firstIndex: number, timestamp: number, location: string, -]; +] -export type PartitionedMessage = [type: Type.PartitionedMessage, partNo: number, partTotal: number]; +export type PartitionedMessage = [ + type: Type.PartitionedMessage, + partNo: number, + partTotal: number, +] -export type Timestamp = [type: Type.Timestamp, timestamp: number]; +export type Timestamp = [ + type: Type.Timestamp, + timestamp: number, +] export type SetPageLocation = [ type: Type.SetPageLocation, url: string, referrer: string, navigationStart: number, -]; +] -export type SetViewportSize = [type: Type.SetViewportSize, width: number, height: number]; +export type SetViewportSize = [ + type: Type.SetViewportSize, + width: number, + height: number, +] -export type SetViewportScroll = [type: Type.SetViewportScroll, x: number, y: number]; +export type SetViewportScroll = [ + type: Type.SetViewportScroll, + x: number, + y: number, +] -export type CreateDocument = [type: Type.CreateDocument]; +export type CreateDocument = [ + type: Type.CreateDocument, + +] export type CreateElementNode = [ type: Type.CreateElementNode, @@ -86,41 +105,83 @@ export type CreateElementNode = [ index: number, tag: string, svg: boolean, -]; +] export type CreateTextNode = [ type: Type.CreateTextNode, id: number, parentID: number, index: number, -]; +] -export type MoveNode = [type: Type.MoveNode, id: number, parentID: number, index: number]; +export type MoveNode = [ + type: Type.MoveNode, + id: number, + parentID: number, + index: number, +] -export type RemoveNode = [type: Type.RemoveNode, id: number]; +export type RemoveNode = [ + type: Type.RemoveNode, + id: number, +] export type SetNodeAttribute = [ type: Type.SetNodeAttribute, id: number, name: string, value: string, -]; +] -export type RemoveNodeAttribute = [type: Type.RemoveNodeAttribute, id: number, name: string]; +export type RemoveNodeAttribute = [ + type: Type.RemoveNodeAttribute, + id: number, + name: string, +] -export type SetNodeData = [type: Type.SetNodeData, id: number, data: string]; +export type SetNodeData = [ + type: Type.SetNodeData, + id: number, + data: string, +] -export type SetNodeScroll = [type: Type.SetNodeScroll, id: number, x: number, y: number]; +export type SetNodeScroll = [ + type: Type.SetNodeScroll, + id: number, + x: number, + y: number, +] -export type SetInputTarget = [type: Type.SetInputTarget, id: number, label: string]; +export type SetInputTarget = [ + type: Type.SetInputTarget, + id: number, + label: string, +] -export type SetInputValue = [type: Type.SetInputValue, id: number, value: string, mask: number]; +export type SetInputValue = [ + type: Type.SetInputValue, + id: number, + value: string, + mask: number, +] -export type SetInputChecked = [type: Type.SetInputChecked, id: number, checked: boolean]; +export type SetInputChecked = [ + type: Type.SetInputChecked, + id: number, + checked: boolean, +] -export type MouseMove = [type: Type.MouseMove, x: number, y: number]; +export type MouseMove = [ + type: Type.MouseMove, + x: number, + y: number, +] -export type ConsoleLog = [type: Type.ConsoleLog, level: string, value: string]; +export type ConsoleLog = [ + type: Type.ConsoleLog, + level: string, + value: string, +] export type PageLoadTiming = [ type: Type.PageLoadTiming, @@ -133,28 +194,56 @@ export type PageLoadTiming = [ loadEventEnd: number, firstPaint: number, firstContentfulPaint: number, -]; +] export type PageRenderTiming = [ type: Type.PageRenderTiming, speedIndex: number, visuallyComplete: number, timeToInteractive: number, -]; +] -export type JSException = [type: Type.JSException, name: string, message: string, payload: string]; +export type JSException = [ + type: Type.JSException, + name: string, + message: string, + payload: string, +] -export type RawCustomEvent = [type: Type.RawCustomEvent, name: string, payload: string]; +export type RawCustomEvent = [ + type: Type.RawCustomEvent, + name: string, + payload: string, +] -export type UserID = [type: Type.UserID, id: string]; +export type UserID = [ + type: Type.UserID, + id: string, +] -export type UserAnonymousID = [type: Type.UserAnonymousID, id: string]; +export type UserAnonymousID = [ + type: Type.UserAnonymousID, + id: string, +] -export type Metadata = [type: Type.Metadata, key: string, value: string]; +export type Metadata = [ + type: Type.Metadata, + key: string, + value: string, +] -export type CSSInsertRule = [type: Type.CSSInsertRule, id: number, rule: string, index: number]; +export type CSSInsertRule = [ + type: Type.CSSInsertRule, + id: number, + rule: string, + index: number, +] -export type CSSDeleteRule = [type: Type.CSSDeleteRule, id: number, index: number]; +export type CSSDeleteRule = [ + type: Type.CSSDeleteRule, + id: number, + index: number, +] export type Fetch = [ type: Type.Fetch, @@ -165,7 +254,7 @@ export type Fetch = [ status: number, timestamp: number, duration: number, -]; +] export type Profiler = [ type: Type.Profiler, @@ -173,19 +262,44 @@ export type Profiler = [ duration: number, args: string, result: string, -]; +] -export type OTable = [type: Type.OTable, key: string, value: string]; +export type OTable = [ + type: Type.OTable, + key: string, + value: string, +] -export type StateAction = [type: Type.StateAction, type: string]; +export type StateAction = [ + type: Type.StateAction, + type: string, +] -export type Redux = [type: Type.Redux, action: string, state: string, duration: number]; +export type Redux = [ + type: Type.Redux, + action: string, + state: string, + duration: number, +] -export type Vuex = [type: Type.Vuex, mutation: string, state: string]; +export type Vuex = [ + type: Type.Vuex, + mutation: string, + state: string, +] -export type MobX = [type: Type.MobX, type: string, payload: string]; +export type MobX = [ + type: Type.MobX, + type: string, + payload: string, +] -export type NgRx = [type: Type.NgRx, action: string, state: string, duration: number]; +export type NgRx = [ + type: Type.NgRx, + action: string, + state: string, + duration: number, +] export type GraphQL = [ type: Type.GraphQL, @@ -193,7 +307,7 @@ export type GraphQL = [ operationName: string, variables: string, response: string, -]; +] export type PerformanceTrack = [ type: Type.PerformanceTrack, @@ -201,7 +315,7 @@ export type PerformanceTrack = [ ticks: number, totalJSHeapSize: number, usedJSHeapSize: number, -]; +] export type ResourceTiming = [ type: Type.ResourceTiming, @@ -213,15 +327,18 @@ export type ResourceTiming = [ decodedBodySize: number, url: string, initiator: string, -]; +] export type ConnectionInformation = [ type: Type.ConnectionInformation, downlink: number, type: string, -]; +] -export type SetPageVisibility = [type: Type.SetPageVisibility, hidden: boolean]; +export type SetPageVisibility = [ + type: Type.SetPageVisibility, + hidden: boolean, +] export type LongTask = [ type: Type.LongTask, @@ -232,7 +349,7 @@ export type LongTask = [ containerSrc: string, containerId: string, containerName: string, -]; +] export type SetNodeAttributeURLBased = [ type: Type.SetNodeAttributeURLBased, @@ -240,18 +357,26 @@ export type SetNodeAttributeURLBased = [ name: string, value: string, baseURL: string, -]; +] export type SetCSSDataURLBased = [ type: Type.SetCSSDataURLBased, id: number, data: string, baseURL: string, -]; +] -export type TechnicalInfo = [type: Type.TechnicalInfo, type: string, value: string]; +export type TechnicalInfo = [ + type: Type.TechnicalInfo, + type: string, + value: string, +] -export type CustomIssue = [type: Type.CustomIssue, name: string, payload: string]; +export type CustomIssue = [ + type: Type.CustomIssue, + name: string, + payload: string, +] export type CSSInsertRuleURLBased = [ type: Type.CSSInsertRuleURLBased, @@ -259,7 +384,7 @@ export type CSSInsertRuleURLBased = [ rule: string, index: number, baseURL: string, -]; +] export type MouseClick = [ type: Type.MouseClick, @@ -267,59 +392,14 @@ export type MouseClick = [ hesitationTime: number, label: string, selector: string, -]; +] -export type CreateIFrameDocument = [type: Type.CreateIFrameDocument, frameID: number, id: number]; +export type CreateIFrameDocument = [ + type: Type.CreateIFrameDocument, + frameID: number, + id: number, +] -type Message = - | BatchMetadata - | PartitionedMessage - | Timestamp - | SetPageLocation - | SetViewportSize - | SetViewportScroll - | CreateDocument - | CreateElementNode - | CreateTextNode - | MoveNode - | RemoveNode - | SetNodeAttribute - | RemoveNodeAttribute - | SetNodeData - | SetNodeScroll - | SetInputTarget - | SetInputValue - | SetInputChecked - | MouseMove - | ConsoleLog - | PageLoadTiming - | PageRenderTiming - | JSException - | RawCustomEvent - | UserID - | UserAnonymousID - | Metadata - | CSSInsertRule - | CSSDeleteRule - | Fetch - | Profiler - | OTable - | StateAction - | Redux - | Vuex - | MobX - | NgRx - | GraphQL - | PerformanceTrack - | ResourceTiming - | ConnectionInformation - | SetPageVisibility - | LongTask - | SetNodeAttributeURLBased - | SetCSSDataURLBased - | TechnicalInfo - | CustomIssue - | CSSInsertRuleURLBased - | MouseClick - | CreateIFrameDocument; -export default Message; + +type Message = BatchMetadata | PartitionedMessage | Timestamp | SetPageLocation | SetViewportSize | SetViewportScroll | CreateDocument | CreateElementNode | CreateTextNode | MoveNode | RemoveNode | SetNodeAttribute | RemoveNodeAttribute | SetNodeData | SetNodeScroll | SetInputTarget | SetInputValue | SetInputChecked | MouseMove | ConsoleLog | PageLoadTiming | PageRenderTiming | JSException | RawCustomEvent | UserID | UserAnonymousID | Metadata | CSSInsertRule | CSSDeleteRule | Fetch | Profiler | OTable | StateAction | Redux | Vuex | MobX | NgRx | GraphQL | PerformanceTrack | ResourceTiming | ConnectionInformation | SetPageVisibility | LongTask | SetNodeAttributeURLBased | SetCSSDataURLBased | TechnicalInfo | CustomIssue | CSSInsertRuleURLBased | MouseClick | CreateIFrameDocument +export default Message diff --git a/tracker/tracker/src/main/app/messages.gen.ts b/tracker/tracker/src/main/app/messages.gen.ts index e4ff47744..8d5e95880 100644 --- a/tracker/tracker/src/main/app/messages.gen.ts +++ b/tracker/tracker/src/main/app/messages.gen.ts @@ -1,7 +1,8 @@ // Auto-generated, do not edit -import * as Messages from '../../common/messages.gen.js'; -export { default } from '../../common/messages.gen.js'; +import * as Messages from '../../common/messages.gen.js' +export { default } from '../../common/messages.gen.js' + export function BatchMetadata( version: number, @@ -10,15 +11,34 @@ export function BatchMetadata( timestamp: number, location: string, ): Messages.BatchMetadata { - return [Messages.Type.BatchMetadata, version, pageNo, firstIndex, timestamp, location]; + return [ + Messages.Type.BatchMetadata, + version, + pageNo, + firstIndex, + timestamp, + location, + ] } -export function PartitionedMessage(partNo: number, partTotal: number): Messages.PartitionedMessage { - return [Messages.Type.PartitionedMessage, partNo, partTotal]; +export function PartitionedMessage( + partNo: number, + partTotal: number, +): Messages.PartitionedMessage { + return [ + Messages.Type.PartitionedMessage, + partNo, + partTotal, + ] } -export function Timestamp(timestamp: number): Messages.Timestamp { - return [Messages.Type.Timestamp, timestamp]; +export function Timestamp( + timestamp: number, +): Messages.Timestamp { + return [ + Messages.Type.Timestamp, + timestamp, + ] } export function SetPageLocation( @@ -26,19 +46,43 @@ export function SetPageLocation( referrer: string, navigationStart: number, ): Messages.SetPageLocation { - return [Messages.Type.SetPageLocation, url, referrer, navigationStart]; + return [ + Messages.Type.SetPageLocation, + url, + referrer, + navigationStart, + ] } -export function SetViewportSize(width: number, height: number): Messages.SetViewportSize { - return [Messages.Type.SetViewportSize, width, height]; +export function SetViewportSize( + width: number, + height: number, +): Messages.SetViewportSize { + return [ + Messages.Type.SetViewportSize, + width, + height, + ] } -export function SetViewportScroll(x: number, y: number): Messages.SetViewportScroll { - return [Messages.Type.SetViewportScroll, x, y]; +export function SetViewportScroll( + x: number, + y: number, +): Messages.SetViewportScroll { + return [ + Messages.Type.SetViewportScroll, + x, + y, + ] } -export function CreateDocument(): Messages.CreateDocument { - return [Messages.Type.CreateDocument]; +export function CreateDocument( + +): Messages.CreateDocument { + return [ + Messages.Type.CreateDocument, + + ] } export function CreateElementNode( @@ -48,7 +92,14 @@ export function CreateElementNode( tag: string, svg: boolean, ): Messages.CreateElementNode { - return [Messages.Type.CreateElementNode, id, parentID, index, tag, svg]; + return [ + Messages.Type.CreateElementNode, + id, + parentID, + index, + tag, + svg, + ] } export function CreateTextNode( @@ -56,15 +107,34 @@ export function CreateTextNode( parentID: number, index: number, ): Messages.CreateTextNode { - return [Messages.Type.CreateTextNode, id, parentID, index]; + return [ + Messages.Type.CreateTextNode, + id, + parentID, + index, + ] } -export function MoveNode(id: number, parentID: number, index: number): Messages.MoveNode { - return [Messages.Type.MoveNode, id, parentID, index]; +export function MoveNode( + id: number, + parentID: number, + index: number, +): Messages.MoveNode { + return [ + Messages.Type.MoveNode, + id, + parentID, + index, + ] } -export function RemoveNode(id: number): Messages.RemoveNode { - return [Messages.Type.RemoveNode, id]; +export function RemoveNode( + id: number, +): Messages.RemoveNode { + return [ + Messages.Type.RemoveNode, + id, + ] } export function SetNodeAttribute( @@ -72,39 +142,104 @@ export function SetNodeAttribute( name: string, value: string, ): Messages.SetNodeAttribute { - return [Messages.Type.SetNodeAttribute, id, name, value]; + return [ + Messages.Type.SetNodeAttribute, + id, + name, + value, + ] } -export function RemoveNodeAttribute(id: number, name: string): Messages.RemoveNodeAttribute { - return [Messages.Type.RemoveNodeAttribute, id, name]; +export function RemoveNodeAttribute( + id: number, + name: string, +): Messages.RemoveNodeAttribute { + return [ + Messages.Type.RemoveNodeAttribute, + id, + name, + ] } -export function SetNodeData(id: number, data: string): Messages.SetNodeData { - return [Messages.Type.SetNodeData, id, data]; +export function SetNodeData( + id: number, + data: string, +): Messages.SetNodeData { + return [ + Messages.Type.SetNodeData, + id, + data, + ] } -export function SetNodeScroll(id: number, x: number, y: number): Messages.SetNodeScroll { - return [Messages.Type.SetNodeScroll, id, x, y]; +export function SetNodeScroll( + id: number, + x: number, + y: number, +): Messages.SetNodeScroll { + return [ + Messages.Type.SetNodeScroll, + id, + x, + y, + ] } -export function SetInputTarget(id: number, label: string): Messages.SetInputTarget { - return [Messages.Type.SetInputTarget, id, label]; +export function SetInputTarget( + id: number, + label: string, +): Messages.SetInputTarget { + return [ + Messages.Type.SetInputTarget, + id, + label, + ] } -export function SetInputValue(id: number, value: string, mask: number): Messages.SetInputValue { - return [Messages.Type.SetInputValue, id, value, mask]; +export function SetInputValue( + id: number, + value: string, + mask: number, +): Messages.SetInputValue { + return [ + Messages.Type.SetInputValue, + id, + value, + mask, + ] } -export function SetInputChecked(id: number, checked: boolean): Messages.SetInputChecked { - return [Messages.Type.SetInputChecked, id, checked]; +export function SetInputChecked( + id: number, + checked: boolean, +): Messages.SetInputChecked { + return [ + Messages.Type.SetInputChecked, + id, + checked, + ] } -export function MouseMove(x: number, y: number): Messages.MouseMove { - return [Messages.Type.MouseMove, x, y]; +export function MouseMove( + x: number, + y: number, +): Messages.MouseMove { + return [ + Messages.Type.MouseMove, + x, + y, + ] } -export function ConsoleLog(level: string, value: string): Messages.ConsoleLog { - return [Messages.Type.ConsoleLog, level, value]; +export function ConsoleLog( + level: string, + value: string, +): Messages.ConsoleLog { + return [ + Messages.Type.ConsoleLog, + level, + value, + ] } export function PageLoadTiming( @@ -118,7 +253,7 @@ export function PageLoadTiming( firstPaint: number, firstContentfulPaint: number, ): Messages.PageLoadTiming { - return [ + return [ Messages.Type.PageLoadTiming, requestStart, responseStart, @@ -129,7 +264,7 @@ export function PageLoadTiming( loadEventEnd, firstPaint, firstContentfulPaint, - ]; + ] } export function PageRenderTiming( @@ -137,35 +272,89 @@ export function PageRenderTiming( visuallyComplete: number, timeToInteractive: number, ): Messages.PageRenderTiming { - return [Messages.Type.PageRenderTiming, speedIndex, visuallyComplete, timeToInteractive]; + return [ + Messages.Type.PageRenderTiming, + speedIndex, + visuallyComplete, + timeToInteractive, + ] } -export function JSException(name: string, message: string, payload: string): Messages.JSException { - return [Messages.Type.JSException, name, message, payload]; +export function JSException( + name: string, + message: string, + payload: string, +): Messages.JSException { + return [ + Messages.Type.JSException, + name, + message, + payload, + ] } -export function RawCustomEvent(name: string, payload: string): Messages.RawCustomEvent { - return [Messages.Type.RawCustomEvent, name, payload]; +export function RawCustomEvent( + name: string, + payload: string, +): Messages.RawCustomEvent { + return [ + Messages.Type.RawCustomEvent, + name, + payload, + ] } -export function UserID(id: string): Messages.UserID { - return [Messages.Type.UserID, id]; +export function UserID( + id: string, +): Messages.UserID { + return [ + Messages.Type.UserID, + id, + ] } -export function UserAnonymousID(id: string): Messages.UserAnonymousID { - return [Messages.Type.UserAnonymousID, id]; +export function UserAnonymousID( + id: string, +): Messages.UserAnonymousID { + return [ + Messages.Type.UserAnonymousID, + id, + ] } -export function Metadata(key: string, value: string): Messages.Metadata { - return [Messages.Type.Metadata, key, value]; +export function Metadata( + key: string, + value: string, +): Messages.Metadata { + return [ + Messages.Type.Metadata, + key, + value, + ] } -export function CSSInsertRule(id: number, rule: string, index: number): Messages.CSSInsertRule { - return [Messages.Type.CSSInsertRule, id, rule, index]; +export function CSSInsertRule( + id: number, + rule: string, + index: number, +): Messages.CSSInsertRule { + return [ + Messages.Type.CSSInsertRule, + id, + rule, + index, + ] } -export function CSSDeleteRule(id: number, index: number): Messages.CSSDeleteRule { - return [Messages.Type.CSSDeleteRule, id, index]; +export function CSSDeleteRule( + id: number, + index: number, +): Messages.CSSDeleteRule { + return [ + Messages.Type.CSSDeleteRule, + id, + index, + ] } export function Fetch( @@ -177,7 +366,16 @@ export function Fetch( timestamp: number, duration: number, ): Messages.Fetch { - return [Messages.Type.Fetch, method, url, request, response, status, timestamp, duration]; + return [ + Messages.Type.Fetch, + method, + url, + request, + response, + status, + timestamp, + duration, + ] } export function Profiler( @@ -186,31 +384,81 @@ export function Profiler( args: string, result: string, ): Messages.Profiler { - return [Messages.Type.Profiler, name, duration, args, result]; + return [ + Messages.Type.Profiler, + name, + duration, + args, + result, + ] } -export function OTable(key: string, value: string): Messages.OTable { - return [Messages.Type.OTable, key, value]; +export function OTable( + key: string, + value: string, +): Messages.OTable { + return [ + Messages.Type.OTable, + key, + value, + ] } -export function StateAction(type: string): Messages.StateAction { - return [Messages.Type.StateAction, type]; +export function StateAction( + type: string, +): Messages.StateAction { + return [ + Messages.Type.StateAction, + type, + ] } -export function Redux(action: string, state: string, duration: number): Messages.Redux { - return [Messages.Type.Redux, action, state, duration]; +export function Redux( + action: string, + state: string, + duration: number, +): Messages.Redux { + return [ + Messages.Type.Redux, + action, + state, + duration, + ] } -export function Vuex(mutation: string, state: string): Messages.Vuex { - return [Messages.Type.Vuex, mutation, state]; +export function Vuex( + mutation: string, + state: string, +): Messages.Vuex { + return [ + Messages.Type.Vuex, + mutation, + state, + ] } -export function MobX(type: string, payload: string): Messages.MobX { - return [Messages.Type.MobX, type, payload]; +export function MobX( + type: string, + payload: string, +): Messages.MobX { + return [ + Messages.Type.MobX, + type, + payload, + ] } -export function NgRx(action: string, state: string, duration: number): Messages.NgRx { - return [Messages.Type.NgRx, action, state, duration]; +export function NgRx( + action: string, + state: string, + duration: number, +): Messages.NgRx { + return [ + Messages.Type.NgRx, + action, + state, + duration, + ] } export function GraphQL( @@ -219,7 +467,13 @@ export function GraphQL( variables: string, response: string, ): Messages.GraphQL { - return [Messages.Type.GraphQL, operationKind, operationName, variables, response]; + return [ + Messages.Type.GraphQL, + operationKind, + operationName, + variables, + response, + ] } export function PerformanceTrack( @@ -228,7 +482,13 @@ export function PerformanceTrack( totalJSHeapSize: number, usedJSHeapSize: number, ): Messages.PerformanceTrack { - return [Messages.Type.PerformanceTrack, frames, ticks, totalJSHeapSize, usedJSHeapSize]; + return [ + Messages.Type.PerformanceTrack, + frames, + ticks, + totalJSHeapSize, + usedJSHeapSize, + ] } export function ResourceTiming( @@ -241,7 +501,7 @@ export function ResourceTiming( url: string, initiator: string, ): Messages.ResourceTiming { - return [ + return [ Messages.Type.ResourceTiming, timestamp, duration, @@ -251,18 +511,27 @@ export function ResourceTiming( decodedBodySize, url, initiator, - ]; + ] } export function ConnectionInformation( downlink: number, type: string, ): Messages.ConnectionInformation { - return [Messages.Type.ConnectionInformation, downlink, type]; + return [ + Messages.Type.ConnectionInformation, + downlink, + type, + ] } -export function SetPageVisibility(hidden: boolean): Messages.SetPageVisibility { - return [Messages.Type.SetPageVisibility, hidden]; +export function SetPageVisibility( + hidden: boolean, +): Messages.SetPageVisibility { + return [ + Messages.Type.SetPageVisibility, + hidden, + ] } export function LongTask( @@ -274,7 +543,7 @@ export function LongTask( containerId: string, containerName: string, ): Messages.LongTask { - return [ + return [ Messages.Type.LongTask, timestamp, duration, @@ -283,7 +552,7 @@ export function LongTask( containerSrc, containerId, containerName, - ]; + ] } export function SetNodeAttributeURLBased( @@ -292,7 +561,13 @@ export function SetNodeAttributeURLBased( value: string, baseURL: string, ): Messages.SetNodeAttributeURLBased { - return [Messages.Type.SetNodeAttributeURLBased, id, name, value, baseURL]; + return [ + Messages.Type.SetNodeAttributeURLBased, + id, + name, + value, + baseURL, + ] } export function SetCSSDataURLBased( @@ -300,15 +575,34 @@ export function SetCSSDataURLBased( data: string, baseURL: string, ): Messages.SetCSSDataURLBased { - return [Messages.Type.SetCSSDataURLBased, id, data, baseURL]; + return [ + Messages.Type.SetCSSDataURLBased, + id, + data, + baseURL, + ] } -export function TechnicalInfo(type: string, value: string): Messages.TechnicalInfo { - return [Messages.Type.TechnicalInfo, type, value]; +export function TechnicalInfo( + type: string, + value: string, +): Messages.TechnicalInfo { + return [ + Messages.Type.TechnicalInfo, + type, + value, + ] } -export function CustomIssue(name: string, payload: string): Messages.CustomIssue { - return [Messages.Type.CustomIssue, name, payload]; +export function CustomIssue( + name: string, + payload: string, +): Messages.CustomIssue { + return [ + Messages.Type.CustomIssue, + name, + payload, + ] } export function CSSInsertRuleURLBased( @@ -317,7 +611,13 @@ export function CSSInsertRuleURLBased( index: number, baseURL: string, ): Messages.CSSInsertRuleURLBased { - return [Messages.Type.CSSInsertRuleURLBased, id, rule, index, baseURL]; + return [ + Messages.Type.CSSInsertRuleURLBased, + id, + rule, + index, + baseURL, + ] } export function MouseClick( @@ -326,9 +626,23 @@ export function MouseClick( label: string, selector: string, ): Messages.MouseClick { - return [Messages.Type.MouseClick, id, hesitationTime, label, selector]; + return [ + Messages.Type.MouseClick, + id, + hesitationTime, + label, + selector, + ] } -export function CreateIFrameDocument(frameID: number, id: number): Messages.CreateIFrameDocument { - return [Messages.Type.CreateIFrameDocument, frameID, id]; +export function CreateIFrameDocument( + frameID: number, + id: number, +): Messages.CreateIFrameDocument { + return [ + Messages.Type.CreateIFrameDocument, + frameID, + id, + ] } + diff --git a/tracker/tracker/src/webworker/MessageEncoder.gen.ts b/tracker/tracker/src/webworker/MessageEncoder.gen.ts index 90e752b58..cd98daab8 100644 --- a/tracker/tracker/src/webworker/MessageEncoder.gen.ts +++ b/tracker/tracker/src/webworker/MessageEncoder.gen.ts @@ -1,264 +1,216 @@ // 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'; +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]) { - 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]) - ); - break; - - case Messages.Type.PartitionedMessage: - return this.uint(msg[1]) && this.uint(msg[2]); - break; - - case Messages.Type.Timestamp: - return this.uint(msg[1]); - break; - - case Messages.Type.SetPageLocation: - 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]); - break; - - case Messages.Type.SetViewportScroll: - 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]) - ); - break; - - case Messages.Type.CreateTextNode: - 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]); - break; - - case Messages.Type.RemoveNode: - return this.uint(msg[1]); - break; - - case Messages.Type.SetNodeAttribute: - 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]); - break; - - case Messages.Type.SetNodeData: - 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]); - break; - - case Messages.Type.SetInputTarget: - 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]); - break; - - case Messages.Type.SetInputChecked: - return this.uint(msg[1]) && this.boolean(msg[2]); - break; - - case Messages.Type.MouseMove: - return this.uint(msg[1]) && this.uint(msg[2]); - break; - - case Messages.Type.ConsoleLog: - 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]) - ); - break; - - case Messages.Type.PageRenderTiming: - return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]); - break; - - case Messages.Type.JSException: - return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]); - break; - - case Messages.Type.RawCustomEvent: - return this.string(msg[1]) && this.string(msg[2]); - break; - - case Messages.Type.UserID: - return this.string(msg[1]); - break; - - case Messages.Type.UserAnonymousID: - return this.string(msg[1]); - break; - - case Messages.Type.Metadata: - 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]); - break; - - case Messages.Type.CSSDeleteRule: - 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]) - ); - break; - - case Messages.Type.Profiler: - 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]); - break; - - case Messages.Type.StateAction: - return this.string(msg[1]); - break; - - case Messages.Type.Redux: - 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]); - break; - - case Messages.Type.MobX: - 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]); - break; - - case Messages.Type.GraphQL: - 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]); - 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]) - ); - break; - - case Messages.Type.ConnectionInformation: - return this.uint(msg[1]) && this.string(msg[2]); - break; - - case Messages.Type.SetPageVisibility: - return this.boolean(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]) - ); - break; - - case Messages.Type.SetNodeAttributeURLBased: - 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]); - break; - - case Messages.Type.TechnicalInfo: - return this.string(msg[1]) && this.string(msg[2]); - break; - - case Messages.Type.CustomIssue: - 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]); - break; - - case Messages.Type.MouseClick: - 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]); - break; + switch(msg[0]) { + + 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]) + break + + case Messages.Type.PartitionedMessage: + return this.uint(msg[1]) && this.uint(msg[2]) + break + + case Messages.Type.Timestamp: + return this.uint(msg[1]) + break + + case Messages.Type.SetPageLocation: + 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]) + break + + case Messages.Type.SetViewportScroll: + 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]) + break + + case Messages.Type.CreateTextNode: + 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]) + break + + case Messages.Type.RemoveNode: + return this.uint(msg[1]) + break + + case Messages.Type.SetNodeAttribute: + 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]) + break + + case Messages.Type.SetNodeData: + 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]) + break + + case Messages.Type.SetInputTarget: + 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]) + break + + case Messages.Type.SetInputChecked: + return this.uint(msg[1]) && this.boolean(msg[2]) + break + + case Messages.Type.MouseMove: + return this.uint(msg[1]) && this.uint(msg[2]) + break + + case Messages.Type.ConsoleLog: + 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]) + break + + case Messages.Type.PageRenderTiming: + return this.uint(msg[1]) && this.uint(msg[2]) && this.uint(msg[3]) + break + + case Messages.Type.JSException: + return this.string(msg[1]) && this.string(msg[2]) && this.string(msg[3]) + break + + case Messages.Type.RawCustomEvent: + return this.string(msg[1]) && this.string(msg[2]) + break + + case Messages.Type.UserID: + return this.string(msg[1]) + break + + case Messages.Type.UserAnonymousID: + return this.string(msg[1]) + break + + case Messages.Type.Metadata: + 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]) + break + + case Messages.Type.CSSDeleteRule: + 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]) + break + + case Messages.Type.Profiler: + 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]) + break + + case Messages.Type.StateAction: + return this.string(msg[1]) + break + + case Messages.Type.Redux: + 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]) + break + + case Messages.Type.MobX: + 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]) + break + + case Messages.Type.GraphQL: + 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]) + 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]) + break + + case Messages.Type.ConnectionInformation: + return this.uint(msg[1]) && this.string(msg[2]) + break + + case Messages.Type.SetPageVisibility: + return this.boolean(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]) + break + + case Messages.Type.SetNodeAttributeURLBased: + 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]) + break + + case Messages.Type.TechnicalInfo: + return this.string(msg[1]) && this.string(msg[2]) + break + + case Messages.Type.CustomIssue: + 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]) + break + + case Messages.Type.MouseClick: + 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]) + break + } } + } +