API Reference
Schema version: v1.0
RiviereBuilder
The main class. Create an instance, add components, connect them, build a graph.
typescript
import { RiviereBuilder } from '@living-architecture/riviere-builder'
const builder = RiviereBuilder.new({
sources: [{ type: 'git', url: 'https://github.com/org/repo' }],
domains: {
orders: { description: 'Order management', systemType: 'domain' }
}
})Add components
| Method | Purpose |
|---|---|
addUI() | User interface entry points |
addApi() | REST or GraphQL endpoints |
addUseCase() | Application layer orchestration |
addDomainOp() | Domain logic operations |
addEvent() | Published domain events |
addEventHandler() | Event subscribers |
defineCustomType() | Register a custom component type |
addCustom() | Add instance of registered custom type |
Link components
typescript
builder.link({ from: api.id, to: useCase.id, type: 'sync' })Find components
| Method | Use Case |
|---|---|
nearMatches(criteria) | Find similar when exact match fails |
Enrichment
| Method | Use Case |
|---|---|
enrichComponent() | Add state changes or business rules to existing DomainOp |
Build and validate
| Method | Purpose |
|---|---|
validate() | Check graph validity without building |
stats() | Component/link/warning counts |
orphans() | Find unconnected components |
warnings() | Get warning messages |
build() | Validate and produce final graph |
query() | Get query client for analysis |
RiviereQuery
Query and analyze Riviere graphs.
typescript
// From builder
const query = builder.query()
// From JSON file
const query = RiviereQuery.fromJSON(jsonContents)Component methods
| Method | Purpose |
|---|---|
components() | Get all components |
componentById(id) | Find component by ID |
componentsInDomain(domainId) | Components in a domain |
componentsByType(type) | Components of a type |
find(predicate) | Find with custom function |
findAll(predicate) | Find all matching |
Link methods
| Method | Purpose |
|---|---|
links() | Get all links |
Domain methods
| Method | Purpose |
|---|---|
domains() | Domain info with component counts |
entities(domainId?) | Entity names in domain |
crossDomainLinks(domainId) | Links leaving domain |
Analysis methods
| Method | Purpose |
|---|---|
entryPoints() | UI/API/EventHandler with no incoming links |
Full Documentation
- RiviereBuilder — Build graphs with type-safe methods
- RiviereQuery — Query and analyze graphs
- Types — All TypeScript type definitions