/** * The SDK's own copy of @fast-simon/widget-console (services/frontends/widget-console/src/main.ts), * below this header unchanged. That package is restricted on npm, so it cannot be a dependency of * fast-simon-sdk, a public package: as one it made `npm install fast-simon-sdk` fail with E404 for * anyone without Fast Simon's npm token. * * Copying costs nothing at runtime. Every product bundle already inlines its own copy of that * package, and the copies meet only through the window registry, so the contract is SINGLETON_KEY, * SCHEMA and the Registry shape: keep those identical to widget-console's. When two copies with * different SCHEMA values meet, whichever registers second prints its own single line instead of * joining the entry, so drift degrades the banner rather than breaking it. Re-copy on any change to * widget-console's: .github/scripts/tests/test_widget_console_sdk_copy.sh fails a PR on which this * file does not end with that one verbatim. */ /** * Shared console banner for Fast Simon storefront products. * * Every product (Autocomplete, Search Page, Collection Page, Recommendations, * SDK, Shopper Agent) registers itself here instead of printing its own line. * One combined console entry is printed for the whole site. * * Why the registry lives on `window` rather than in this module: these products * ship as separately-built bundles served from separate CDN URLs and loaded * independently, sometimes carrying different versions of THIS package. The npm * package shares source, not an instance — each bundle inlines its own copy. So * the rendezvous has to be a window singleton that whichever bundle loads first * creates and owns. */ export type ProductName = 'Autocomplete' | 'Search Page' | 'Collection Page' | 'Recommendations' | 'SDK' | 'Shopper Agent'; export type InstallKind = 'V-Next' | 'SSR' | 'SDK' | 'No-Code' | 'Snippet' | 'Widget'; export interface ProductRegistration { product: ProductName; install: InstallKind; /** Injected at build time from the package's own version — see __FS_VERSION__. */ version: string; site?: string; uuid?: string; storeId?: string | number; } /** * Register one product into the shared console entry. * * Registering the same product twice overwrites the earlier row — SSR and the * client `serving` app never load on the same page, so there is no case where * two installs of one product legitimately coexist. */ export declare function registerProduct(registration: ProductRegistration): void;