Files
aris/apps/freya-backend/src/session/feed-source-provider.ts

13 lines
510 B
TypeScript
Raw Normal View History

2026-06-12 17:35:26 +01:00
import type { FeedSource } from "@freya/core"
import type { type } from "arktype"
export type ConfigSchema = ReturnType<typeof type>
export interface FeedSourceProvider {
2026-06-12 17:35:26 +01:00
/** The source ID this provider is responsible for (e.g., "freya.location"). */
readonly sourceId: string
/** Arktype schema for validating user-provided config. Omit if the source has no config. */
readonly configSchema?: ConfigSchema
feedSourceForUser(userId: string, config: unknown, credentials: unknown): Promise<FeedSource>
}