feat: certificates, landing pages, ai tutor, website update, compliance
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import * as z from 'zod';
|
||||
|
||||
export const ZDashAnalyticsRange = z.object({
|
||||
orgId: z.string().uuid(),
|
||||
days: z.coerce.number().int().min(1).max(365).default(30)
|
||||
});
|
||||
|
||||
export const ZDashCourseFunnel = z.object({
|
||||
orgId: z.string().uuid(),
|
||||
days: z.coerce.number().int().min(1).max(365).default(30),
|
||||
courseId: z.string().uuid().optional()
|
||||
});
|
||||
|
||||
export const ZDashComplianceOverview = z.object({
|
||||
orgId: z.string().uuid()
|
||||
});
|
||||
|
||||
export type TDashAnalyticsRange = z.infer<typeof ZDashAnalyticsRange>;
|
||||
export type TDashCourseFunnel = z.infer<typeof ZDashCourseFunnel>;
|
||||
export type TDashComplianceOverview = z.infer<typeof ZDashComplianceOverview>;
|
||||
@@ -1,2 +1,4 @@
|
||||
export * from './stats';
|
||||
export * from './login-activity';
|
||||
export * from './track';
|
||||
export * from './analytics';
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
import * as z from 'zod';
|
||||
|
||||
const CLIENT_EVENT_TYPES = [
|
||||
'landing_view',
|
||||
'course_page_view',
|
||||
'signup_view',
|
||||
'signin_view',
|
||||
'pricing_view',
|
||||
'cta_click'
|
||||
] as const;
|
||||
|
||||
export const ZTrackEvent = z.object({
|
||||
eventType: z.enum(CLIENT_EVENT_TYPES),
|
||||
occurredAt: z.string().optional(),
|
||||
orgId: z.string().uuid().optional(),
|
||||
courseId: z.string().uuid().optional(),
|
||||
path: z.string().max(2048).optional(),
|
||||
referrerHost: z.string().max(255).optional(),
|
||||
utmSource: z.string().max(128).optional(),
|
||||
utmMedium: z.string().max(128).optional(),
|
||||
utmCampaign: z.string().max(128).optional(),
|
||||
locale: z.string().max(8).optional(),
|
||||
props: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()])).optional()
|
||||
});
|
||||
|
||||
export const ZIngestBatch = z.object({
|
||||
sessionId: z.string().min(8).max(128),
|
||||
events: z.array(ZTrackEvent).min(1).max(50)
|
||||
});
|
||||
|
||||
export const ZDeidentifyUser = z.object({
|
||||
userId: z.string().uuid()
|
||||
});
|
||||
|
||||
export type TTrackEvent = z.infer<typeof ZTrackEvent>;
|
||||
export type TIngestBatch = z.infer<typeof ZIngestBatch>;
|
||||
export type TDeidentifyUser = z.infer<typeof ZDeidentifyUser>;
|
||||
Reference in New Issue
Block a user