diff --git a/src/payload/models/filter_payload.ts b/src/payload/models/filter_payload.ts index b2fbc17..299e5b2 100644 --- a/src/payload/models/filter_payload.ts +++ b/src/payload/models/filter_payload.ts @@ -1,14 +1,14 @@ 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; + properties?: { [key: string]: any }; context: { ip: string; headers: IncomingHttpHeaders | { [key: string]: string | boolean }; @@ -19,4 +19,16 @@ export interface FilterPayload { phone?: string; username?: string; }; -} + product?: any; + session?: { + id: string; + created_at?: string; + }; + created_at?: string; + authentication_method?: { + type: string; + variant?: string; + email?: string; + phone?: string; + }; +} & ({ event: string } | { type: string; status?: string }); diff --git a/src/payload/models/log_payload.ts b/src/payload/models/log_payload.ts index 95889b5..95e33f4 100644 --- a/src/payload/models/log_payload.ts +++ b/src/payload/models/log_payload.ts @@ -1,20 +1,32 @@ 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; + }; +} & ({ event: string } | { type: string; status?: string }); diff --git a/src/payload/models/risk_payload.ts b/src/payload/models/risk_payload.ts index 0f512b1..503601a 100644 --- a/src/payload/models/risk_payload.ts +++ b/src/payload/models/risk_payload.ts @@ -1,19 +1,31 @@ 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; + }; +} & ({ event: string } | { type: string; status?: string });