2022-03-09 10:13:17 +00:00
|
|
|
import { DoctypeName } from 'models/types';
|
|
|
|
|
2022-03-09 11:19:26 +00:00
|
|
|
export type AppVersion = string;
|
2022-03-09 10:13:17 +00:00
|
|
|
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;
|
2022-03-09 11:20:48 +00:00
|
|
|
errors: Record<string, number>;
|
2022-03-09 10:13:17 +00:00
|
|
|
locale: Locale;
|
2022-03-09 11:19:26 +00:00
|
|
|
version: AppVersion;
|
2022-03-09 10:13:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export enum Verb {
|
2022-03-09 11:19:26 +00:00
|
|
|
Created = 'created',
|
2022-03-09 10:13:17 +00:00
|
|
|
Deleted = 'deleted',
|
|
|
|
Navigated = 'navigated',
|
2022-03-09 11:19:26 +00:00
|
|
|
Imported = 'imported',
|
|
|
|
Exported = 'exported',
|
2022-03-09 10:13:17 +00:00
|
|
|
}
|
|
|
|
|
2022-03-09 11:19:26 +00:00
|
|
|
export enum NounEnum {
|
|
|
|
Route = 'route',
|
|
|
|
}
|
|
|
|
|
|
|
|
export type Noun = string | NounEnum;
|