mirror of
https://github.com/kennethnym/aris.git
synced 2026-04-10 11:51:18 +01: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:
@@ -8,7 +8,7 @@ export interface WeatherSourceProviderOptions {
|
||||
client?: WeatherSourceOptions["client"]
|
||||
}
|
||||
|
||||
const weatherConfig = type({
|
||||
export const weatherConfig = type({
|
||||
"units?": "'metric' | 'imperial'",
|
||||
"hourlyLimit?": "number",
|
||||
"dailyLimit?": "number",
|
||||
@@ -16,6 +16,7 @@ const weatherConfig = type({
|
||||
|
||||
export class WeatherSourceProvider implements FeedSourceProvider {
|
||||
readonly sourceId = "aelis.weather"
|
||||
readonly configSchema = weatherConfig
|
||||
private readonly credentials: WeatherSourceOptions["credentials"]
|
||||
private readonly client: WeatherSourceOptions["client"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user