diff --git a/src/payload/models/filter_payload.ts b/src/payload/models/filter_payload.ts index b2fbc17..17eff01 100644 --- a/src/payload/models/filter_payload.ts +++ b/src/payload/models/filter_payload.ts @@ -1,22 +1,35 @@ import type { IncomingHttpHeaders } from 'http2'; -export interface FilterPayload { +export type FilterPayload = { request_token: string; - event: string; - status?: string; + // deprecated user?: { id?: string; email?: string; + phone?: string; }; - properties?: object; + matching_user_id?: string; + params?: { + email?: string; + phone?: string; + username?: string; + }; + properties?: { [key: string]: any }; context: { ip: string; headers: IncomingHttpHeaders | { [key: string]: string | boolean }; }; - matching_user_id?: string; - params?: { + product?: any; + session?: { + id: string; + created_at?: string; + }; + created_at?: string; + authentication_method?: { + type: string; + variant?: string; email?: string; phone?: string; - username?: string; }; -} + status?: string; +} & ({ event: string } | { type: string }); diff --git a/src/payload/models/log_payload.ts b/src/payload/models/log_payload.ts index 95889b5..1349e93 100644 --- a/src/payload/models/log_payload.ts +++ b/src/payload/models/log_payload.ts @@ -1,20 +1,33 @@ import type { IncomingHttpHeaders } from 'http2'; -export interface LogPayload { +export type LogPayload = { request_token?: string; - event: string; - status?: string; + // deprecated user?: { id?: string; + phone?: string; email?: string; registered_at?: string; - traits?: object; + traits?: { [key: string]: any }; name?: string; + address?: { [key: string]: any }; }; created_at?: string; - properties?: object; + properties?: { [key: string]: any }; context?: { ip?: string; headers: IncomingHttpHeaders | { [key: string]: string | boolean }; }; -} + product?: any; + session?: { + id: string; + created_at?: string; + }; + authentication_method?: { + type: string; + variant?: string; + email?: string; + phone?: string; + }; + status?: string; +} & ({ event: string } | { type: string }); diff --git a/src/payload/models/risk_payload.ts b/src/payload/models/risk_payload.ts index 0f512b1..b38ecaf 100644 --- a/src/payload/models/risk_payload.ts +++ b/src/payload/models/risk_payload.ts @@ -1,19 +1,32 @@ import type { IncomingHttpHeaders } from 'http2'; -export interface RiskPayload { +export type RiskPayload = { request_token: string; - event: string; - status: string; user: { id: string; + phone?: string; email?: string; registered_at?: string; - traits?: object; + traits?: { [key: string]: any }; name?: string; + address?: { [key: string]: any }; }; properties?: object; context: { ip: string; headers: IncomingHttpHeaders | { [key: string]: string | boolean }; }; -} + created_at?: string; + product?: any; + session?: { + id: string; + created_at?: string; + }; + authentication_method?: { + type: string; + variant?: string; + email?: string; + phone?: string; + }; + status?: string; +} & ({ event: string } | { type: string });