in packages/core/src/applicationcomposer/messageHandlers/emitTelemetryMessageHandler.ts [25:72]
export function emitTelemetryMessageHandler(message: EmitTelemetryMessage) {
try {
const parsedData = message.metadata ? JSON.parse(message.metadata) : {}
switch (message.eventType) {
case 'GENERATE_CLICKED':
sendGenerateClicked(parsedData as AppcomposerGenerateClicked)
return
case 'REGENERATE_CLICKED':
sendRegenerateClicked(parsedData as AppcomposerRegenerateClicked)
return
case 'GENERATE_ACCEPTED':
sendGenerateAccepted(parsedData as AppcomposerGenerateAccepted)
return
case 'GENERATE_REJECTED':
sendGenerateRejected(parsedData as AppcomposerGenerateRejected)
return
case 'INVALID_GENERATION':
sendInvalidGeneration(parsedData as AppcomposerInvalidGeneration)
return
case 'POST_PROCESS':
sendPostProcess(parsedData as AppcomposerPostProcess)
return
case 'CUSTOMER_READY':
sendCustomerReady(parsedData as AppcomposerCustomerReady)
return
case 'FPS':
sendFps(parsedData as AppcomposerFps)
return
case 'ADD_RESOURCE':
sendAddResource(parsedData as AppcomposerAddResource)
return
case 'ADD_CONNECTION':
sendAddConnection(parsedData as AppcomposerAddConnection)
return
case 'OPEN_WFS':
sendOpenWfs(parsedData as AppcomposerOpenWfs)
return
case 'CLOSE_WFS':
sendCloseWfs(parsedData as AppcomposerCloseWfs)
return
case 'TEMPLATE_OPENED':
sendInitializeProject(parsedData as AppcomposerInitializeProject)
return
}
} catch (e) {
getLogger().error('Could not log telemetry for App Composer %O', e)
}
}