mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-20 00:51:20 +00:00
Replace per-source services (LocationService, WeatherService, TflService, FeedEngineService) with a single UserSessionManager that owns all per-user state. Source creation is delegated to thin FeedSourceProvider implementations per source type. Co-authored-by: Ona <no-reply@ona.com>
20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
import { TflSource, type ITflApi } from "@aris/source-tfl"
|
|
|
|
import type { FeedSourceProvider } from "../session/feed-source-provider.ts"
|
|
|
|
export type TflSourceProviderOptions =
|
|
| { apiKey: string; client?: never }
|
|
| { apiKey?: never; client: ITflApi }
|
|
|
|
export class TflSourceProvider implements FeedSourceProvider {
|
|
private readonly options: TflSourceProviderOptions
|
|
|
|
constructor(options: TflSourceProviderOptions) {
|
|
this.options = options
|
|
}
|
|
|
|
feedSourceForUser(_userId: string): TflSource {
|
|
return new TflSource(this.options)
|
|
}
|
|
}
|