2021-10-26 21:23:08 -07:00
|
|
|
import { EntityType, RecommendationRenderType, ScenarioType } from '../../types.generated';
|
2021-05-11 15:41:42 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Valid event types.
|
|
|
|
*/
|
|
|
|
export enum EventType {
|
|
|
|
PageViewEvent,
|
|
|
|
LogInEvent,
|
|
|
|
LogOutEvent,
|
|
|
|
SearchEvent,
|
|
|
|
SearchResultsViewEvent,
|
|
|
|
SearchResultClickEvent,
|
2022-01-27 22:02:41 -08:00
|
|
|
EntitySearchResultClickEvent,
|
2021-05-11 15:41:42 -07:00
|
|
|
BrowseResultClickEvent,
|
|
|
|
EntityViewEvent,
|
|
|
|
EntitySectionViewEvent,
|
|
|
|
EntityActionEvent,
|
2022-08-03 17:02:37 -07:00
|
|
|
BatchEntityActionEvent,
|
2021-10-26 21:23:08 -07:00
|
|
|
RecommendationImpressionEvent,
|
|
|
|
RecommendationClickEvent,
|
2022-03-04 16:10:25 -08:00
|
|
|
SearchAcrossLineageEvent,
|
|
|
|
SearchAcrossLineageResultsViewEvent,
|
2022-03-07 14:30:00 -08:00
|
|
|
DownloadAsCsvEvent,
|
2022-06-08 21:13:22 -04:00
|
|
|
SignUpEvent,
|
|
|
|
ResetCredentialsEvent,
|
2021-05-11 15:41:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Base Interface for all React analytics events.
|
|
|
|
*/
|
|
|
|
interface BaseEvent {
|
|
|
|
actorUrn?: string;
|
|
|
|
timestamp?: number;
|
|
|
|
date?: string;
|
|
|
|
userAgent?: string;
|
|
|
|
browserId?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Viewed a page on the UI.
|
|
|
|
*/
|
|
|
|
export interface PageViewEvent extends BaseEvent {
|
|
|
|
type: EventType.PageViewEvent;
|
|
|
|
}
|
|
|
|
|
2022-06-08 21:13:22 -04:00
|
|
|
/**
|
|
|
|
* Logged on successful new user sign up.
|
|
|
|
*/
|
|
|
|
export interface SignUpEvent extends BaseEvent {
|
|
|
|
type: EventType.SignUpEvent;
|
|
|
|
title: string;
|
|
|
|
}
|
|
|
|
|
2021-05-11 15:41:42 -07:00
|
|
|
/**
|
|
|
|
* Logged on user successful login.
|
|
|
|
*/
|
|
|
|
export interface LogInEvent extends BaseEvent {
|
|
|
|
type: EventType.LogInEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged on user successful logout.
|
|
|
|
*/
|
|
|
|
export interface LogOutEvent extends BaseEvent {
|
|
|
|
type: EventType.LogOutEvent;
|
|
|
|
}
|
|
|
|
|
2022-06-08 21:13:22 -04:00
|
|
|
/**
|
|
|
|
* Logged on user resetting their credentials
|
|
|
|
*/
|
|
|
|
export interface ResetCredentialsEvent extends BaseEvent {
|
|
|
|
type: EventType.ResetCredentialsEvent;
|
|
|
|
}
|
|
|
|
|
2021-05-11 15:41:42 -07:00
|
|
|
/**
|
|
|
|
* Logged on user successful search query.
|
|
|
|
*/
|
|
|
|
export interface SearchEvent extends BaseEvent {
|
|
|
|
type: EventType.SearchEvent;
|
|
|
|
query: string;
|
|
|
|
entityTypeFilter?: EntityType;
|
|
|
|
pageNumber: number;
|
|
|
|
originPath: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged on user search result click.
|
|
|
|
*/
|
|
|
|
export interface SearchResultsViewEvent extends BaseEvent {
|
|
|
|
type: EventType.SearchResultsViewEvent;
|
|
|
|
query: string;
|
|
|
|
entityTypeFilter?: EntityType;
|
|
|
|
page?: number;
|
|
|
|
total: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged on user search result click.
|
|
|
|
*/
|
|
|
|
export interface SearchResultClickEvent extends BaseEvent {
|
|
|
|
type: EventType.SearchResultClickEvent;
|
|
|
|
query: string;
|
|
|
|
entityUrn: string;
|
|
|
|
entityType: EntityType;
|
|
|
|
entityTypeFilter?: EntityType;
|
|
|
|
index: number;
|
|
|
|
total: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged on user browse result click.
|
|
|
|
*/
|
|
|
|
export interface BrowseResultClickEvent extends BaseEvent {
|
|
|
|
type: EventType.BrowseResultClickEvent;
|
|
|
|
browsePath: string;
|
|
|
|
entityType: EntityType;
|
|
|
|
resultType: 'Entity' | 'Group';
|
|
|
|
entityUrn?: string;
|
|
|
|
groupName?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged when user views an entity profile.
|
|
|
|
*/
|
|
|
|
export interface EntityViewEvent extends BaseEvent {
|
|
|
|
type: EventType.EntityViewEvent;
|
|
|
|
entityType: EntityType;
|
|
|
|
entityUrn: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged when user views a particular section of an entity profile.
|
|
|
|
*/
|
|
|
|
export interface EntitySectionViewEvent extends BaseEvent {
|
|
|
|
type: EventType.EntitySectionViewEvent;
|
|
|
|
entityType: EntityType;
|
|
|
|
entityUrn: string;
|
|
|
|
section: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Logged when a user takes some action on an entity
|
|
|
|
*/
|
|
|
|
export const EntityActionType = {
|
|
|
|
UpdateTags: 'UpdateTags',
|
2022-02-07 22:52:59 +05:30
|
|
|
UpdateTerms: 'UpdateTerms',
|
|
|
|
UpdateLinks: 'UpdateLinks',
|
2021-05-11 15:41:42 -07:00
|
|
|
UpdateOwnership: 'UpdateOwnership',
|
|
|
|
UpdateDocumentation: 'UpdateDocumentation',
|
|
|
|
UpdateDescription: 'UpdateDescription',
|
2021-06-17 06:48:27 +08:00
|
|
|
UpdateProperties: 'UpdateProperties',
|
2021-05-11 15:41:42 -07:00
|
|
|
UpdateSchemaDescription: 'UpdateSchemaDescription',
|
|
|
|
UpdateSchemaTags: 'UpdateSchemaTags',
|
2022-02-07 22:52:59 +05:30
|
|
|
UpdateSchemaTerms: 'UpdateSchemaTerms',
|
2021-05-11 15:41:42 -07:00
|
|
|
ClickExternalUrl: 'ClickExternalUrl',
|
|
|
|
};
|
|
|
|
export interface EntityActionEvent extends BaseEvent {
|
|
|
|
type: EventType.EntityActionEvent;
|
|
|
|
actionType: string;
|
2022-08-03 17:02:37 -07:00
|
|
|
entityType?: EntityType;
|
2021-05-11 15:41:42 -07:00
|
|
|
entityUrn: string;
|
|
|
|
}
|
|
|
|
|
2022-08-03 17:02:37 -07:00
|
|
|
export interface BatchEntityActionEvent extends BaseEvent {
|
|
|
|
type: EventType.BatchEntityActionEvent;
|
|
|
|
actionType: string;
|
|
|
|
entityUrns: string[];
|
|
|
|
}
|
|
|
|
|
2021-10-26 21:23:08 -07:00
|
|
|
export interface RecommendationImpressionEvent extends BaseEvent {
|
|
|
|
type: EventType.RecommendationImpressionEvent;
|
|
|
|
renderId: string; // TODO : Determine whether we need a render id to join with click event.
|
|
|
|
moduleId: string;
|
|
|
|
renderType: RecommendationRenderType;
|
|
|
|
scenarioType: ScenarioType;
|
|
|
|
// TODO: Determine whether we need to collect context parameters.
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RecommendationClickEvent extends BaseEvent {
|
|
|
|
type: EventType.RecommendationClickEvent;
|
|
|
|
renderId: string; // TODO : Determine whether we need a render id to join with click event.
|
|
|
|
moduleId: string;
|
|
|
|
renderType: RecommendationRenderType;
|
|
|
|
scenarioType: ScenarioType;
|
|
|
|
index?: number;
|
|
|
|
}
|
|
|
|
|
2022-03-04 16:10:25 -08:00
|
|
|
export interface SearchAcrossLineageEvent extends BaseEvent {
|
|
|
|
type: EventType.SearchAcrossLineageEvent;
|
|
|
|
query: string;
|
|
|
|
entityTypeFilter?: EntityType;
|
|
|
|
pageNumber: number;
|
|
|
|
originPath: string;
|
|
|
|
}
|
|
|
|
export interface SearchAcrossLineageResultsViewEvent extends BaseEvent {
|
|
|
|
type: EventType.SearchAcrossLineageResultsViewEvent;
|
|
|
|
query: string;
|
|
|
|
entityTypeFilter?: EntityType;
|
|
|
|
page?: number;
|
|
|
|
total: number;
|
|
|
|
}
|
|
|
|
|
2022-03-07 14:30:00 -08:00
|
|
|
export interface DownloadAsCsvEvent extends BaseEvent {
|
|
|
|
type: EventType.DownloadAsCsvEvent;
|
|
|
|
query: string;
|
|
|
|
// optional parameter if its coming from inside an entity page
|
|
|
|
entityUrn?: string;
|
|
|
|
path: string;
|
|
|
|
}
|
|
|
|
|
2021-05-11 15:41:42 -07:00
|
|
|
/**
|
|
|
|
* Event consisting of a union of specific event types.
|
|
|
|
*/
|
|
|
|
export type Event =
|
|
|
|
| PageViewEvent
|
2022-06-08 21:13:22 -04:00
|
|
|
| SignUpEvent
|
2021-05-11 15:41:42 -07:00
|
|
|
| LogInEvent
|
|
|
|
| LogOutEvent
|
2022-06-08 21:13:22 -04:00
|
|
|
| ResetCredentialsEvent
|
2021-05-11 15:41:42 -07:00
|
|
|
| SearchEvent
|
|
|
|
| SearchResultsViewEvent
|
|
|
|
| SearchResultClickEvent
|
|
|
|
| BrowseResultClickEvent
|
|
|
|
| EntityViewEvent
|
|
|
|
| EntitySectionViewEvent
|
2021-10-26 21:23:08 -07:00
|
|
|
| EntityActionEvent
|
|
|
|
| RecommendationImpressionEvent
|
2022-03-04 16:10:25 -08:00
|
|
|
| SearchAcrossLineageEvent
|
|
|
|
| SearchAcrossLineageResultsViewEvent
|
2022-03-07 14:30:00 -08:00
|
|
|
| DownloadAsCsvEvent
|
2022-08-03 17:02:37 -07:00
|
|
|
| RecommendationClickEvent
|
|
|
|
| BatchEntityActionEvent;
|