import type { EventSpecResponse, FetchEventSpecParams } from "./AvoEventSpecFetchTypes"; import { type ShouldLogFlag } from "../utils"; /** * EventSpecFetcher handles fetching event specifications from the Avo API. * * Endpoint: GET /trackingPlan/eventSpec * Base URL: https://api.avo.app */ export declare class AvoEventSpecFetcher { /** Base URL for the event spec API */ private readonly baseUrl; /** Network timeout in milliseconds */ private readonly timeout; /** In-flight requests to prevent duplicate fetches */ private inFlightRequests; /** * Reads the current logging flag live, so a later enableLogging() / * AvoInspector.shouldLog change is reflected without re-pushing. See AVO-3079. */ private shouldLog; /** Environment name */ private readonly env; constructor(timeout: number | undefined, shouldLog: ShouldLogFlag | undefined, env: string, baseUrl?: string); /** * Generates a unique key for tracking in-flight requests, matching the spec * cache key. The API key tells gateways apart, and gateway coordinates are * part of the key, so fetches for different gateways or checkpoints of the * same event name are never deduplicated into one. */ private generateRequestKey; /** * Fetches an event specification from the API. * * Returns null if: * - The network request fails * - The response has an invalid status code (non-200) * - The response is invalid or malformed * - The request times out * * This method gracefully degrades - failures do not throw errors. * When null is returned, Phase 2 should skip validation for that event. */ fetch(params: FetchEventSpecParams): Promise; /** Internal fetch implementation. */ private fetchInternal; /** Builds the complete URL with query parameters. */ private buildUrl; /** * Makes an HTTP GET request using XMLHttpRequest. * Returns the parsed JSON response or null on failure. */ private makeRequest; /** * Basic shape check for wire format - ensures response has the minimum expected structure. * Uses short field names from wire format. */ private hasExpectedShape; /** Parses the wire format response into internal format with meaningful field names. */ private static parseEventSpecResponse; /** Parses a single event spec entry from wire format. */ private static parseEventSpecEntry; /** Parses property constraints from wire format. */ private static parsePropertyConstraints; }