Add jsVersion & sessionCreated event to Telemetry (#720)

This commit is contained in:
Matti Nannt
2023-08-21 11:30:00 +02:00
committed by GitHub
parent 754bdfbca7
commit 4de85eb365
4 changed files with 17 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ import { trackAction } from "./actions";
import { Config } from "./config";
import { NetworkError, Result, err, ok } from "./errors";
import { Logger } from "./logger";
import packageJson from "../../package.json";
const config = Config.getInstance();
const logger = Logger.getInstance();
@@ -19,6 +20,7 @@ const syncWithBackend = async (): Promise<Result<TJsState, NetworkError>> => {
environmentId: config.get().environmentId,
personId: config.get().state?.person.id,
sessionId: config.get().state?.session.id,
jsVersion: packageJson.version,
}),
});
if (!response.ok) {

View File

@@ -34,6 +34,7 @@
/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"resolveJsonModule": true /* Allow importing .json files */,
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */

View File

@@ -19,6 +19,7 @@ export const ZJsSyncInput = z.object({
environmentId: z.string().cuid2(),
personId: z.string().cuid2().optional(),
sessionId: z.string().cuid2().optional(),
jsVersion: z.string().optional(),
});
export type TJsSyncInput = z.infer<typeof ZJsSyncInput>;