/** * Runtime gateway URL resolution — shared across all product app shells. * * All Burdenoff products share the same gateways (global + workspace). * This module resolves the correct gateway URLs based on the current hostname. * * @module @burdenoff/fe-libs/shared/config/gatewayUrls */ export interface RuntimeGatewayUrls { workspaceBaseUrl: string; globalBaseUrl: string; publicStoreBaseUrl: string; } /** * All known production hostnames across all products. * Exported for reuse by authBridgeUrls.ts and other config modules. */ export declare const ALL_PRODUCT_DOMAINS: string[]; export declare const PROD_HOSTS: Set; /** * All known alpha/staging hostnames across all products. */ export declare const ALPHA_HOSTS: Set; export declare function getCurrentHostname(): string; /** * Which backend estate a bundle is built to talk to. * * `'local'` means the developer stack behind the `gw-*.local.burdenoff.com` * nginx proxy — reachable only from a machine with the dev `/etc/hosts` * entries, never from a phone. */ export type DeployTarget = 'prod' | 'alpha' | 'local'; /** * Resolve the deploy target for a shell whose origin carries no information — * a Capacitor WebView, which is always `https://localhost` (or `capacitor://`) * regardless of which product or environment the binary was built for. * * Precedence: * 1. `VITE_GATEWAY_TARGET` — the explicit override, already honoured for * localhost dev servers. * 2. `VITE_DEPLOY_ENV` — the build-time environment marker the shells * already set for analytics. * 3. `'prod'`. * * Defaulting to prod is the safe answer here, and it is the OPPOSITE of the * fail-loud default for an unknown *web* hostname (BOFF-2507). A web app * served from a domain we do not recognise might be anything, so pointing it * at production would be reckless. A Capacitor binary is something we built * and signed ourselves; the only reason it is on a device at all is to talk to * a real backend, and `LOCAL_DEFAULTS` there is not a safe fallback but a * guaranteed `TypeError: Failed to fetch` on the first request. */ export declare function resolveNativeDeployTarget(): DeployTarget; /** * Resolve runtime gateway URLs from the current hostname, with an optional * env-driven override for localhost dev servers. * * Priority: * 1. Known production domains → PROD_GATEWAYS (hostname always wins for real deploys) * 2. Known alpha/staging domains → same-origin alpha Worker proxy * 3. Localhost-like host: `VITE_GATEWAY_TARGET` env var, case-insensitive * - `'prod'` → PROD_GATEWAYS (emits a one-time console warning — mutations write to real data) * - `'alpha'` → remote alpha gateways * - `'local'` or anything else → LOCAL_DEFAULTS * 4. Everything else (unknown deployed domain, or localhost with no env): * LOCAL_DEFAULTS (fails loud against a missing local stack rather than * silently writing to prod — see BOFF-2507). * * Set the override in `/.env.local` (gitignored by Vite) to test * a localhost dev server against a remote backend without editing source. */ export declare function resolveGatewayUrls(): RuntimeGatewayUrls; //# sourceMappingURL=gatewayUrls.d.ts.map