mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-27 12:21:17 +00:00
feat(backend): add PATCH /api/sources/:sourceId (#86)
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>
This commit is contained in:
@@ -7,12 +7,13 @@ export type TflSourceProviderOptions =
|
||||
| { apiKey: string; client?: never }
|
||||
| { apiKey?: never; client: ITflApi }
|
||||
|
||||
const tflConfig = type({
|
||||
export const tflConfig = type({
|
||||
"lines?": "string[]",
|
||||
})
|
||||
|
||||
export class TflSourceProvider implements FeedSourceProvider {
|
||||
readonly sourceId = "aelis.tfl"
|
||||
readonly configSchema = tflConfig
|
||||
private readonly apiKey: string | undefined
|
||||
private readonly client: ITflApi | undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user