import type { Command } from '@prisma/sdk' ; import * as checkpoint from 'checkpoint-client' ; import { getCLIPathHash , getProjectHash } from '@prisma/sdk' ; /**
 * $ prisma telemetry
 */ export class Telemetry implements Command { public static new ( ) { return new Telemetry ( ) ; } public async parse ( ) { const info = await checkpoint . getInfo ( ) ; const projectPathHash = await getProjectHash ( ) ; const cliPathHash = getCLIPathHash ( ) ; const cacheItems = info . cacheItems . map ( ( it ) => { return { product : it . output . product , version : it . version , package : it . output . package , release_tag : it . output . release_tag , cli_path : it . cli_path , cli_path_hash : it . output . cli_path_hash , last_reminder : it . last_reminder , cached_at : it . cached_at , } ; } ) ; return JSON . stringify ( { signature : info . signature , cachePath : info . cachePath , current : { projectPathHash , cliPathHash , } , cacheItems , } , undefined , 2 ) ; } }