chore: replace plugin for user_agent in heartbeat payload

This commit is contained in:
Sebastian Velez
2023-01-19 10:13:06 -05:00
parent 75e6372f2b
commit 99ceccd25c

View File

@@ -213,13 +213,18 @@ class WakaTimeCore {
* @private * @private
*/ */
preparePayload(heartbeat: SendHeartbeat, type: string): Record<string, unknown> { preparePayload(heartbeat: SendHeartbeat, type: string): Record<string, unknown> {
return { const payload: Record<string, unknown> = {
entity: heartbeat.url, entity: heartbeat.url,
plugin: 'browser-wakatime/' + config.version,
project: heartbeat.project ?? '<<LAST_PROJECT>>',
time: moment().format('X'), time: moment().format('X'),
type: type, type: type,
user_agent: 'browser-wakatime/' + config.version,
}; };
if (heartbeat.project) {
payload.project = heartbeat.project;
}
return payload;
} }
/** /**