chore(8.0): final pre-RC1 sweep — API consistency, named errors, orphans, zero-cast codebase

This commit is contained in:
David Snelling 2026-06-11 14:51:00 -07:00
parent 970e08c466
commit 1f7e365a4e
237 changed files with 1951 additions and 49413 deletions

View file

@ -77,7 +77,7 @@ describe('Brainy 3.0 API', () => {
type: NounType.Document
})
await brain.delete(id)
await brain.remove(id)
const entity = await brain.get(id)
expect(entity).toBeNull()
@ -124,7 +124,7 @@ describe('Brainy 3.0 API', () => {
type: VerbType.References
})
const relations = await brain.getRelations({ from: doc1 })
const relations = await brain.related({ from: doc1 })
expect(relations).toHaveLength(1)
expect(relations[0].from).toBe(doc1)
@ -150,8 +150,8 @@ describe('Brainy 3.0 API', () => {
bidirectional: true
})
const fromPerson = await brain.getRelations({ from: person })
const toPerson = await brain.getRelations({ to: person })
const fromPerson = await brain.related({ from: person })
const toPerson = await brain.related({ to: person })
expect(fromPerson).toHaveLength(1)
expect(toPerson).toHaveLength(1)
@ -176,7 +176,7 @@ describe('Brainy 3.0 API', () => {
await brain.unrelate(relationId)
const relations = await brain.getRelations({ from: doc1 })
const relations = await brain.related({ from: doc1 })
expect(relations).toHaveLength(0)
})
})
@ -331,7 +331,7 @@ describe('Brainy 3.0 API', () => {
brain.add({ data: 'Keep me', type: NounType.Document, metadata: { delete: false } })
])
const result = await brain.deleteMany({
const result = await brain.removeMany({
where: { delete: true }
})
@ -365,7 +365,7 @@ describe('Brainy 3.0 API', () => {
type: VerbType.References // Must use enum
})
const relations = await brain.getRelations({ from: doc1 })
const relations = await brain.related({ from: doc1 })
expect(relations[0].type).toBe(VerbType.References)
})
})