/** * Hand-curated public exports. * * WHY THIS FILE EXISTS * -------------------- * `src/index.ts` is generated by ctix, and ctix decides what to export purely * from file layout: it skips a source file if — and only if — its own * directory's index.ts re-exports it. Curation is therefore binary per * directory, and `excludeFiles` is non-functional in ctix 2.8.2 (verified * against the config key, the CLI flag, and every glob form). * * Because `src/sn/amb/index.ts` covers that whole folder, ctix omits it — which * is why `AMBClient` never reached the barrel, leaving `ScriptTracer` (whose * constructor requires one) unconstructible by any consumer. * * This file holds the exports ctix cannot express. * `scripts/finalize-barrel.mjs` appends it to the generated barrel on every * build. Add public API here — never to `src/index.ts`, which is regenerated. * * WHAT IS EXPORTED AND WHY * ------------------------ * `ScriptTracer` was already exported, but its constructor is * `(ambClient: AMBClient, instance, options?)` and `AMBClient` was not * exported — so no consumer could construct it through the public API, and * `MessageClientBuilder.createClient()` was unreachable as a factory too. * README.md documents `import { AMBClient, MessageClientBuilder } from * '@sonisoft/now-sdk-ext-core'`, which did not work. * * The surface below is the minimum needed to build an AMB client and hand it * to `ScriptTracer`. The CometD transport internals (`ServerConnection`, * `MessageClient`, `SubscriptionCommandSender`, `XMLHttpRequest`, the * extensions, `FunctionQueue`, `EventManager`, `Properties`, …) stay private: * they are ~2,900 lines of protocol plumbing, and publishing them would make * every future refactor a semver-major event. `XMLHttpRequest` in particular * must not be exported — it would shadow the DOM global for anyone doing * `import * as core from '@sonisoft/now-sdk-ext-core'`. */ export { AuthenticatedWebSocket } from './sn/amb/AuthenticatedWebSocket.js'; export { AMBClient } from './sn/amb/AMBClient.js'; export { MessageClientBuilder } from './sn/amb/MessageClientBuilder.js'; export type { SubscriptionCollection, Context } from './sn/amb/MessageClientBuilder.js'; export { Channel } from './sn/amb/Channel.js'; export { ChannelListener } from './sn/amb/ChannelListener.js'; /** * Not in the generated barrel, on purpose. ctix exports whatever a directory's * index.ts re-exports, and a credentials/index.ts would make importing this * library enough to monkeypatch the SDK's credential storage. Installing the * shim has to stay an explicit call. */ export { initCredentialStore } from './credentials/ensureShim.js'; export type { InitCredentialStoreResult } from './credentials/ensureShim.js';