2026-03-10 19:19:23 +00:00
|
|
|
import { TflSource, type ITflApi } from "@aelis/source-tfl"
|
2026-02-18 00:41:20 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-15 22:57:19 +00:00
|
|
|
async feedSourceForUser(_userId: string): Promise<TflSource> {
|
2026-02-18 00:41:20 +00:00
|
|
|
return new TflSource(this.options)
|
|
|
|
|
}
|
|
|
|
|
}
|