diff --git a/packages/core-shared/src/di/bind-context.ts b/packages/core-shared/src/di/bind-context.ts index 9614bd2..91b074d 100644 --- a/packages/core-shared/src/di/bind-context.ts +++ b/packages/core-shared/src/di/bind-context.ts @@ -7,6 +7,7 @@ import type { RealtimeRegistryProtocol, MetricsProtocol, AuditLogProtocol, + AnalyticsProtocol, } from "./bind-protocols"; /** Always-present fields. Feature binders rely on these unconditionally. */ @@ -33,6 +34,7 @@ export type BindContext< RealtimeReg extends RealtimeRegistryProtocol = RealtimeRegistryProtocol, Metrics extends MetricsProtocol = MetricsProtocol, Audit extends AuditLogProtocol = AuditLogProtocol, + Analytics extends AnalyticsProtocol = AnalyticsProtocol, > = BindContextBase & { bus?: Bus; queue?: IJobQueue; @@ -40,6 +42,7 @@ export type BindContext< realtimeRegistry?: RealtimeReg; metrics?: Metrics; auditLog?: Audit; + analytics?: Analytics; }; /** Production binders also receive the resolved Payload config. */ @@ -49,6 +52,7 @@ export type BindProductionContext< RealtimeReg extends RealtimeRegistryProtocol = RealtimeRegistryProtocol, Metrics extends MetricsProtocol = MetricsProtocol, Audit extends AuditLogProtocol = AuditLogProtocol, -> = BindContext & { + Analytics extends AnalyticsProtocol = AnalyticsProtocol, +> = BindContext & { config: SanitizedConfig; }; diff --git a/packages/core-shared/src/di/bind-protocols.test.ts b/packages/core-shared/src/di/bind-protocols.test.ts index 90a5783..5601cc3 100644 --- a/packages/core-shared/src/di/bind-protocols.test.ts +++ b/packages/core-shared/src/di/bind-protocols.test.ts @@ -3,6 +3,7 @@ import type { EventBusProtocol, RealtimeBroadcasterProtocol, RealtimeRegistryProtocol, + AnalyticsProtocol, } from "./bind-protocols"; // Protocol-shape tests. These verify each protocol type EXPORTS the @@ -36,3 +37,10 @@ describe("RealtimeRegistryProtocol", () => { expectTypeOf().toBeFunction(); }); }); + +describe("AnalyticsProtocol", () => { + it("requires track(event, attributes?)", () => { + type A = AnalyticsProtocol; + expectTypeOf().toBeFunction(); + }); +});