MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / updateRepo

Function updateRepo

projects/openade-module/src/yjsMutation.ts:461–479  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

459 },
460
461 async updateRepo(request) {
462 const updatedAt = request.updatedAt ?? now()
463 const reposDoc = await loadDoc(storage, "code:repos")
464
465 try {
466 const repoMap = findRepoMap(reposDoc, request.repoId)
467 if (!repoMap) throw new Error(`Repository ${request.repoId} not found`)
468
469 reposDoc.transact(() => {
470 if (request.name !== undefined) repoMap.set("name", request.name)
471 if (request.path !== undefined) repoMap.set("path", request.path)
472 if (request.archived !== undefined) repoMap.set("archived", request.archived)
473 repoMap.set("updatedAt", updatedAt)
474 })
475 await saveDoc(storage, "code:repos", reposDoc)
476 } finally {
477 reposDoc.destroy()
478 }
479 },
480
481 async deleteRepo(request) {
482 const reposDoc = await loadDoc(storage, "code:repos")

Callers

nothing calls this directly

Calls 6

findRepoMapFunction · 0.85
destroyMethod · 0.80
nowFunction · 0.70
loadDocFunction · 0.70
saveDocFunction · 0.70
setMethod · 0.65

Tested by

no test coverage detected