2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00
books/fyo/telemetry/types.ts
18alantom de7e5ba807 refactor: rename 'frappe' to 'fyo' outside src
- cause now most of it is different from what it was
2022-05-23 16:18:22 +05:30

51 lines
1.0 KiB
TypeScript

export type AppVersion = string;
export type UniqueId = string;
export type Timestamp = number;
export interface InteractionEvent {
time: Timestamp;
verb: Verb;
noun: Noun;
more?: Record<string, unknown>;
}
export type Count = Record<string, number>;
export type Platform = 'Windows' | 'Mac' | 'Linux';
export interface Telemetry {
deviceId: UniqueId;
instanceId: UniqueId;
openTime: Timestamp;
platform?: Platform;
closeTime: Timestamp;
timeline?: InteractionEvent[];
counts?: Count;
errors: Record<string, number>;
country: string;
language: string;
version: AppVersion;
}
export enum Verb {
Created = 'created',
Deleted = 'deleted',
Navigated = 'navigated',
Imported = 'imported',
Exported = 'exported',
Stopped = 'stopped',
Started = 'stopped',
}
export enum NounEnum {
Route = 'route',
Telemetry = 'telemetry',
}
export type Noun = string | NounEnum;
export enum TelemetrySetting {
allow = 'allow',
dontLogUsage = 'dontLogUsage',
dontLogAnything = 'dontLogAnything',
}