Skip to content

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

MethodPurpose
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
typescript
builder.link({ from: api.id, to: useCase.id, type: 'sync' })

Find components

MethodUse Case
nearMatches(criteria)Find similar when exact match fails

Enrichment

MethodUse Case
enrichComponent()Add state changes or business rules to existing DomainOp

Build and validate

MethodPurpose
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

MethodPurpose
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
MethodPurpose
links()Get all links

Domain methods

MethodPurpose
domains()Domain info with component counts
entities(domainId?)Entity names in domain
crossDomainLinks(domainId)Links leaving domain

Analysis methods

MethodPurpose
entryPoints()UI/API/EventHandler with no incoming links

Full Documentation

See Also