/** * Schema Drift Canary (#39 Part 2) * * Utilities for detecting API response shape drift against committed golden fixtures. * * Usage pattern: * 1. Fetch a raw provider response (integration test or cron Worker). * 2. Load the golden fixture for that provider. * 3. Call runCanaryCheck(provider, golden, liveResponse) to get a CanaryReport. * 4. Report / alert on drift.status === 'drift'. * * Scheduling and transport are left to the consumer. This module contains no I/O. */ /** Flat map of dot-notation path → JSON type name. */ export type ShapeMap = Record; export interface CanaryDiff { /** Paths present in the live response but absent from the golden fixture. */ added: string[]; /** Paths present in the golden fixture but absent from the live response. */ removed: string[]; /** Paths present in both, but with differing JSON types. */ changed: string[]; } export interface CanaryReport { provider: string; status: 'ok' | 'drift'; diff: CanaryDiff; } /** * Walk an arbitrary value and return a flat map of dot-notation paths → JSON type names. * Arrays are represented by their element type at index 0 (path suffix `[0]`). * Recursion stops at depth 6 to keep fixtures stable against deep nesting. */ export declare function extractShape(obj: unknown, prefix?: string, depth?: number): ShapeMap; /** * Compare a live shape map against a golden fixture. * Returns the set of added, removed, and type-changed paths. */ export declare function compareShapes(golden: ShapeMap, live: ShapeMap): CanaryDiff; /** * Run a single canary check: extract the live shape, compare against golden, * and return a CanaryReport. */ export declare function runCanaryCheck(provider: string, golden: ShapeMap, liveResponse: unknown): CanaryReport; //# sourceMappingURL=schema-canary.d.ts.map