You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Common Architecture Language Model](./calm)|[@rocketstack-matt](https://github.com/rocketstack-matt), [@jpgough-ms](https://github.com/jpgough-ms)|[](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml)|
|[Docs](./docs)|[@rocketstack-matt](https://github.com/rocketstack-matt)|[](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml)[](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml)|
|[Common Architecture Language Model](./calm)|[@rocketstack-matt](https://github.com/rocketstack-matt), [@jpgough-ms](https://github.com/jpgough-ms)|[](https://github.com/finos/architecture-as-code/actions/workflows/validate-spectral.yml)|
|[Docs](./docs)|[@rocketstack-matt](https://github.com/rocketstack-matt)|[](https://github.com/finos/architecture-as-code/actions/workflows/s3-docs-sync.yml)[](https://github.com/finos/architecture-as-code/actions/workflows/build-docs.yml)|
This module contains the TypeScript type definitions and interfaces for the Common Architecture Language Model (CALM). It serves as a shared foundation for type safety across all CALM tooling and prevents circular dependencies between modules.
4
+
5
+
## Module Structure
6
+
7
+
The `calm-models` module is organized into three sub-modules:
8
+
9
+
### 1. **types**
10
+
A 1:1 mapping to the CALM schema definitions. These types directly represent the JSON schema structure of CALM documents and provide strict type safety for schema validation and parsing.
11
+
12
+
### 2. **model**
13
+
An internal business model built to allow for lazy loading of nested CALM documents when required. This layer provides rich object models with methods and computed properties that support complex operations on CALM data.
14
+
15
+
### 3. **canonical**
16
+
A flattened data model used for templating. This represents CALM data in a simplified, template-friendly format that's optimized for rendering documentation and generating output files.
17
+
18
+
## What Should Be In This Module
19
+
20
+
✅ **Include:**
21
+
-**types/**: Direct TypeScript mappings of CALM JSON schema definitions
22
+
-**models/**: Business logic types supporting lazy loading and document relationships
23
+
-**canonical/**: Flattened, template-optimized data structures
24
+
- Any additional approved model representations of CALM data used by the CALM tooling.
25
+
26
+
## What Should NOT Be In This Module
27
+
❌ **Avoid:**
28
+
- Business logic or processing functions
29
+
- Template rendering code
30
+
- Widget implementations
31
+
- CLI-specific utilities
32
+
- File system operations
33
+
- Network requests or API clients
34
+
- Complex validation logic (keep validation types, not validation implementations)
35
+
36
+
## Dependencies
37
+
38
+
This module should maintain minimal dependencies to avoid becoming a bottleneck:
39
+
- Only essential TypeScript utility libraries
40
+
- No dependency on other CALM modules (`shared`, `calm-widgets`, etc.)
41
+
- Avoid heavy runtime dependencies
42
+
43
+
## Usage
44
+
45
+
Other modules in the CALM ecosystem import types from this module's sub-modules:
46
+
47
+
```typescript
48
+
// Import direct schema types from types/
49
+
import {
50
+
CalmNodeSchema,
51
+
CalmNodeTypeSchema,
52
+
CalmInteractsRelationshipSchema
53
+
} from'@finos/calm-models/types';
54
+
55
+
// Import business model classes from model/
56
+
import {
57
+
CalmNode,
58
+
CalmRelationship,
59
+
CalmInteractsType,
60
+
CalmConnectsType
61
+
} from'@finos/calm-models/model';
62
+
63
+
// Import flattened template types from canonical/
64
+
import {
65
+
CalmCoreCanonicalModel,
66
+
CalmNodeCanonicalModel,
67
+
CalmDecisionCanonicalModel
68
+
} from'@finos/calm-models/canonical';
69
+
```
70
+
71
+
For any questions about whether a type belongs in this module, consult the lead maintainers or discuss in the relevant GitHub issue.
0 commit comments