Feat/um 202 event data new (#1841)

* Add event_data base.

* Add url_path.

* Add eventData back.

* Finish event_data relational.

* resolve comments.
This commit is contained in:
Brian Cao 2023-03-23 14:01:15 -07:00 committed by GitHub
parent c2789d70bc
commit 9979672de5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 719 additions and 130 deletions

View file

@ -1,10 +1,19 @@
import { NextApiRequest } from 'next';
import { ROLES } from './constants';
import { EVENT_DATA_TYPE, EVENT_TYPE, KAFKA_TOPIC, ROLES } from './constants';
type ObjectValues<T> = T[keyof T];
export type Roles = ObjectValues<typeof ROLES>;
export type EventTypes = ObjectValues<typeof EVENT_TYPE>;
export type EventDataTypes = ObjectValues<typeof EVENT_DATA_TYPE>;
export type KafkaTopics = ObjectValues<typeof KAFKA_TOPIC>;
export interface EventData {
[key: string]: number | string | EventData | number[] | string[] | EventData[];
}
export interface Auth {
user?: {
id: string;
@ -66,6 +75,13 @@ export interface WebsiteEventMetric {
y: number;
}
export interface WebsiteEventDataMetric {
x: string;
t: string;
eventName?: string;
urlPath?: string;
}
export interface WebsitePageviews {
pageviews: {
t: string;