mirror of
https://github.com/kennethnym/aris.git
synced 2026-03-26 03:41:18 +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>
27 lines
636 B
TypeScript
27 lines
636 B
TypeScript
/**
|
|
* Thrown when an operation targets a user source that doesn't exist.
|
|
*/
|
|
export class SourceNotFoundError extends Error {
|
|
readonly sourceId: string
|
|
readonly userId: string
|
|
|
|
constructor(sourceId: string, userId: string) {
|
|
super(`Source "${sourceId}" not found for user "${userId}"`)
|
|
this.name = "SourceNotFoundError"
|
|
this.sourceId = sourceId
|
|
this.userId = userId
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Thrown when a source config update fails schema validation.
|
|
*/
|
|
export class InvalidSourceConfigError extends Error {
|
|
readonly sourceId: string
|
|
|
|
constructor(sourceId: string, summary: string) {
|
|
super(summary)
|
|
this.sourceId = sourceId
|
|
}
|
|
}
|