export type Omit = Pick>; export type PartialBy = Omit & Partial>; export type MixanJson = Record; // Deprecated export interface EventPayload { name: string; time: string; profileId: string | null; properties: MixanJson; } // Deprecated export interface ProfilePayload { first_name?: string; last_name?: string; email?: string; avatar?: string; id?: string; properties?: MixanJson; } export type BatchPayload = | { type: 'increment'; payload: BatchProfileIncrementPayload; } | { type: 'decrement'; payload: BatchProfileDecrementPayload; } | { type: 'event'; payload: BatchEventPayload; } | { type: 'create_profile'; payload: BatchCreateProfilePayload; } | { type: 'update_profile'; payload: BatchUpdateProfilePayload; } | { type: 'update_session'; payload: BatchUpdateSessionPayload; } | { type: 'set_profile_property'; payload: BatchSetProfilePropertyPayload; }; export interface BatchSetProfilePropertyPayload { profileId: string; name: string; value: any; update: boolean; } export interface CreateProfileResponse { id: string; } export interface BatchCreateProfilePayload { profileId: string; properties?: MixanJson; } export interface BatchUpdateSessionPayload { profileId: string; properties?: MixanJson; } export interface BatchEventPayload { name: string; time: string; profileId: string; properties: MixanJson; } export interface BatchUpdateProfilePayload { first_name?: string; last_name?: string; email?: string; avatar?: string; id?: string; properties?: MixanJson; profileId: string; } export interface ProfileIncrementPayload { name: string; value: number; profileId: string; } export interface ProfileDecrementPayload { name: string; value: number; profileId: string; } export interface BatchProfileIncrementPayload { name: string; value: number; profileId: string; } export interface BatchProfileDecrementPayload { name: string; value: number; profileId: string; } export interface MixanIssue { field: string; message: string; value: any; } export interface MixanErrorResponse { status: 'error'; code: number; message: string; issues?: MixanIssue[] | undefined; stack?: string | undefined; } export interface MixanResponse { result: T; status: 'ok'; } // NEW export interface PostEventPayload { name: string; timestamp: string; profileId?: string; properties?: Record & { title?: string | undefined; referrer?: string | undefined; path?: string | undefined; }; } export interface UpdateProfilePayload { profileId?: string; id?: string; first_name?: string; last_name?: string; email?: string; avatar?: string; properties?: MixanJson; } export interface IncrementProfilePayload { profileId?: string; property: string; value: number; } export interface DecrementProfilePayload { profileId?: string; property: string; value: number; }