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

Function createRepo

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

Source from the content-addressed store, hash-verified

431
432 return {
433 async createRepo(request) {
434 const repoId = request.repoId ?? createId()
435 const createdAt = request.createdAt ?? now()
436 const reposDoc = await loadDoc(storage, "code:repos")
437
438 try {
439 if (findRepoMap(reposDoc, repoId)) {
440 return { repoId, createdAt }
441 }
442
443 reposDoc.transact(() => {
444 pushOrderedItem(reposDoc, "repos", {
445 id: repoId,
446 name: request.name,
447 path: request.path,
448 createdBy: request.createdBy,
449 createdAt,
450 updatedAt: createdAt,
451 tasks: [],
452 })
453 })
454 await saveDoc(storage, "code:repos", reposDoc)
455 return { repoId, createdAt }
456 } finally {
457 reposDoc.destroy()
458 }
459 },
460
461 async updateRepo(request) {
462 const updatedAt = request.updatedAt ?? now()

Callers

nothing calls this directly

Calls 6

findRepoMapFunction · 0.85
pushOrderedItemFunction · 0.85
destroyMethod · 0.80
nowFunction · 0.70
loadDocFunction · 0.70
saveDocFunction · 0.70

Tested by

no test coverage detected