/** * Shared utilities used by BOTH widget API surfaces: * - lib/widget-api-client.ts (the standalone RegnaClient object) * - provider/api-client.ts (the RegnaApiClient class with auth-failure routing) * * Lives in lib/ rather than provider/ so widget-api-client.ts can keep * its existing imports unchanged. provider/api-client.ts imports from * here too to avoid the appearance of a circular import (the runtime * graph would already be DAG-safe, but consolidating the helpers * keeps maintainability uncomplicated and makes future changes * single-source-of-truth). */ /** Snake_case to camelCase recursive - used to normalize API payloads * at the edge of the widget data layer. */ export declare function toCamel(obj: unknown): unknown; /** UTM tags appended to every outgoing widget API call so backend * access logs can attribute traffic to embedded widgets vs. direct * API consumers. */ export declare const WIDGET_UTM: { readonly utm_source: "widget"; readonly utm_medium: "embed"; }; /** Append the WIDGET_UTM tags to a URL string and return the result. */ export declare function withWidgetUtm(url: string): string; /** Append the WIDGET_UTM tags to a URL object in place and return it. */ export declare function appendWidgetUtm(url: URL): URL; /** Public-mode path rewrite: when public mode is on the widget calls * hit /v1/public/companies/{id}/... instead of /v1/se/companies/{id}/... * Mirror endpoint exists for SE only today; US/NO pass through and * return 404 from the public mirror just as they would from the * authed surface. * * Issue #291 narrow exception: the US similar endpoint has its own * jurisdiction-namespaced public mirror at * ``/public/us/companies/{cik}/similar`` (added by PR #282). The * generic ``/public/companies/{id}/similar`` mirror does an org_number * lookup that 404s on a 10-digit CIK, so US public-mode similar calls * must route to the US-namespaced path. The query string (e.g. * ``?global=true``) is preserved verbatim - the rewriter only touches * the path component. */ export declare function rewriteForPublicMode(path: string, publicMode: boolean): string; //# sourceMappingURL=api-shared.d.ts.map