2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 19:29:02 +00:00
books/src/telemetry/types.ts

47 lines
842 B
TypeScript
Raw Normal View History

import { DoctypeName } from 'models/types';
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 interface Locale {
country: string;
language: string;
}
export type Count = Partial<{
[key in DoctypeName]: number;
}>;
export interface Telemetry {
deviceId: UniqueId;
instanceId: UniqueId;
openTime: Timestamp;
closeTime: Timestamp;
timeline?: InteractionEvent[];
counts?: Count;
locale: Locale;
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',
}
2022-03-09 11:19:26 +00:00
export enum NounEnum {
Route = 'route',
}
export type Noun = string | NounEnum;