MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / update

Method update

packages/sync/src/data-source-manager.ts:119–132  ·  view source on GitHub ↗
(id: string, updates: DataSourceUpdatable)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 3

loadAllMethod · 0.95
saveAllMethod · 0.95
normalizeBaseUrlFunction · 0.70

Tested by

no test coverage detected