(id: string, updates: DataSourceUpdatable)
| 117 | } |
| 118 | |
| 119 | update(id: string, updates: DataSourceUpdatable): DataSource | null { |
| 120 | const sources = this.loadAll() |
| 121 | const idx = sources.findIndex((s) => s.id === id) |
| 122 | if (idx === -1) return null |
| 123 | const ds = sources[idx] |
| 124 | if (updates.name !== undefined) ds.name = updates.name |
| 125 | if (updates.baseUrl !== undefined) ds.baseUrl = normalizeBaseUrl(updates.baseUrl) |
| 126 | if (updates.token !== undefined) ds.token = updates.token |
| 127 | if (updates.intervalMinutes !== undefined) ds.intervalMinutes = updates.intervalMinutes |
| 128 | if (updates.pullLimit !== undefined) ds.pullLimit = updates.pullLimit |
| 129 | if (updates.enabled !== undefined) ds.enabled = updates.enabled |
| 130 | this.saveAll(sources) |
| 131 | return ds |
| 132 | } |
| 133 | |
| 134 | delete(id: string): boolean { |
| 135 | const sources = this.loadAll() |
nothing calls this directly
no test coverage detected