import { EventData } from '../track/oaiq.js'; import { TrackEvent, UserProvidedData } from '../track/types.js'; import '../track/gtag.js'; type ActionSource = 'web' | 'mobile_app' | 'offline' | 'physical_store' | 'phone_call' | 'email' | 'other'; /** * User/identity fields. Email and external id must be sent as lowercase 64-char SHA-256 hex * strings; geographic, IP, and user-agent fields are sent as raw values. */ interface OpenAIUser { email_sha256?: string; external_id_sha256?: string; /** Two-letter ISO 3166-1 country code (e.g. "US"). */ country?: string; city?: string; zip_code?: string; ip_address?: string; user_agent?: string; } interface OpenAIEvent { /** Unique event id; combined with `type` for deduplication against pixel events. */ id: string; /** Standard event name or `custom`. */ type: string; /** Required when `type` is `custom`. */ custom_event_name?: string; /** Event timestamp in ms; must be within 7 days and no more than 10 minutes in the future. */ timestamp_ms: number; /** Required for `action_source: "web"`. */ source_url?: string; action_source?: ActionSource; /** OpenAI-provided privacy-preserving identifier. */ oppref?: string; /** When true, opts the event out of personalization. */ opt_out?: boolean; user?: OpenAIUser; data: EventData; } interface CreateOpenAIEventsDTO { /** When true, validates the events without persisting them. */ validate_only?: boolean; events: OpenAIEvent[]; } declare function getServerEvent(event: TrackEvent, data: UserProvidedData): OpenAIEvent; declare function sendEvents(apiKey: string, pixelId: string, events: TrackEvent[], data?: UserProvidedData, validateOnly?: boolean): Promise; export { type CreateOpenAIEventsDTO, type OpenAIEvent, type OpenAIUser, getServerEvent, sendEvents };