2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 17:34:04 +00:00
books/fyo/telemetry/types.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-03-09 11:19:26 +00:00
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>;
2022-03-18 09:21:12 +00:00
export type Platform = 'Windows' | 'Mac' | 'Linux';
export interface Telemetry {
deviceId: UniqueId;
instanceId: UniqueId;
openTime: Timestamp;
2022-03-18 09:21:12 +00:00
platform?: Platform;
closeTime: Timestamp;
timeline?: InteractionEvent[];
counts?: Count;
2022-03-09 11:20:48 +00:00
errors: Record<string, number>;
country: string;
language: string;
2022-03-09 11:19:26 +00:00
version: AppVersion;
}
export enum Verb {
2022-03-09 11:19:26 +00:00
Created = 'created',
Deleted = 'deleted',
Navigated = 'navigated',
2022-03-09 11:19:26 +00:00
Imported = 'imported',
Exported = 'exported',
Stopped = 'stopped',
Started = 'stopped',
}
2022-03-09 11:19:26 +00:00
export enum NounEnum {
Route = 'route',
Telemetry = 'telemetry',
2022-03-09 11:19:26 +00:00
}
export type Noun = string | NounEnum;
export enum TelemetrySetting {
allow = 'allow',
dontLogUsage = 'dontLogUsage',
dontLogAnything = 'dontLogAnything',
}