mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-25 11:21:17 +00:00
Add endpoint for users to update their source config and enabled state. Config is deep-merged with existing values via lodash.merge and validated against the provider's schema before persisting. Co-authored-by: Ona <no-reply@ona.com>
13 lines
488 B
TypeScript
13 lines
488 B
TypeScript
import type { FeedSource } from "@aelis/core"
|
|
import type { type } from "arktype"
|
|
|
|
export type ConfigSchema = ReturnType<typeof type>
|
|
|
|
export interface FeedSourceProvider {
|
|
/** The source ID this provider is responsible for (e.g., "aelis.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): Promise<FeedSource>
|
|
}
|