@eventcatalog/core 5.1.1 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/architecture-export.cjs +34 -2
- package/dist/architecture-export.d.cts +25 -1
- package/dist/architecture-export.d.ts +25 -1
- package/dist/architecture-export.js +11 -3
- package/dist/{chunk-DJCOJ77J.js → chunk-7RJN4FNG.js} +1 -1
- package/dist/{chunk-UCUZ44U2.js → chunk-HVCPU4V3.js} +1 -1
- package/dist/chunk-IR5MKGKS.js +60 -0
- package/dist/{chunk-BAUH53EV.js → chunk-MESHMXLR.js} +1 -1
- package/dist/{chunk-NJTLAFFT.js → chunk-OVEXZEJJ.js} +1 -1
- package/dist/{chunk-GKEHJQ5K.js → chunk-QSD6WMYE.js} +1 -1
- package/dist/{chunk-BEBDEEDY.js → chunk-VEQLCFU6.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/docs/api/02-config.md +31 -1
- package/dist/docs/development/ask-your-architecture/03-mcp-server/getting-started.md +1 -1
- package/dist/docs/development/bring-your-own-documentation/_category_.json +1 -1
- package/dist/docs/development/customization/08-custom-properties.md +48 -1
- package/dist/docs/development/developer-tools/api-catalog.md +0 -2
- package/dist/docs/development/export/01-introduction.md +90 -0
- package/dist/docs/development/{guides/96-architecture-reference.md → export/02-architecture-reference.md} +6 -27
- package/dist/docs/development/export/03-custom-exports.md +257 -0
- package/dist/docs/development/export/04-reference.md +383 -0
- package/dist/docs/development/export/_category_.json +12 -0
- package/dist/docs/development/guides/owners/05-teams-reference.md +0 -12
- package/dist/docs/development/guides/owners/06-users-reference.md +0 -12
- package/dist/docs/development/upgrading/v5.md +1 -1
- package/dist/eventcatalog.cjs +65 -2
- package/dist/eventcatalog.config.d.cts +28 -0
- package/dist/eventcatalog.config.d.ts +28 -0
- package/dist/eventcatalog.js +54 -14
- package/dist/federation/federate.js +3 -3
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/search-indexer.cjs +1 -1
- package/dist/search-indexer.js +1 -1
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/content.config.ts +0 -3
- package/eventcatalog/src/features/collections/resource-docs.ts +0 -1
- package/eventcatalog/src/features/mcp/mcp-scope.ts +2 -3
- package/eventcatalog/src/features/tools/catalog-tools.ts +6 -8
- package/eventcatalog/src/pages/api-catalog/specifications/[collection]/[id]/[version]/[specification].ts +2 -4
- package/eventcatalog/src/utils/collections/adrs.ts +0 -1
- package/eventcatalog/src/utils/collections/agents.ts +0 -1
- package/eventcatalog/src/utils/collections/channels.ts +0 -1
- package/eventcatalog/src/utils/collections/commands.ts +0 -1
- package/eventcatalog/src/utils/collections/containers.ts +0 -1
- package/eventcatalog/src/utils/collections/domains.ts +0 -2
- package/eventcatalog/src/utils/collections/entities.ts +0 -1
- package/eventcatalog/src/utils/collections/events.ts +0 -1
- package/eventcatalog/src/utils/collections/flows.ts +0 -2
- package/eventcatalog/src/utils/collections/owners.ts +1 -4
- package/eventcatalog/src/utils/collections/queries.ts +0 -1
- package/eventcatalog/src/utils/collections/resource-docs.ts +1 -5
- package/eventcatalog/src/utils/collections/resource-owners.ts +1 -2
- package/eventcatalog/src/utils/collections/services.ts +0 -1
- package/eventcatalog/src/utils/collections/systems.ts +0 -1
- package/eventcatalog/src/utils/collections/teams.ts +3 -6
- package/eventcatalog/src/utils/collections/users.ts +4 -8
- package/eventcatalog/src/utils/homepage-dashboard.ts +2 -3
- package/eventcatalog/src/utils/node-graphs/flow-lanes.ts +2 -6
- package/package.json +5 -5
- package/dist/chunk-E6WTCJUL.js +0 -32
- package/dist/{chunk-QJ7KKN2D.js → chunk-NCEZDQSW.js} +7 -7
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 3
|
|
3
|
+
keywords:
|
|
4
|
+
- EventCatalog custom exports
|
|
5
|
+
- Partner documentation
|
|
6
|
+
- Public architecture documentation
|
|
7
|
+
- Export part of a catalog
|
|
8
|
+
- Include and exclude resources
|
|
9
|
+
sidebar_label: Custom exports
|
|
10
|
+
title: Custom exports
|
|
11
|
+
description: Export the part of your catalog you choose for partners, a regulator or another team, as one HTML file with your own introduction.
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
import AddedIn from '@site/src/components/MDX/AddedIn';
|
|
15
|
+
|
|
16
|
+
<AddedIn version="5.2.0" />
|
|
17
|
+
|
|
18
|
+
The [architecture reference](/docs/development/export/architecture-reference) has your whole catalog in it, which is right for your own teams. For people outside them you usually want **part** of it: the services and events a partner integrates with, without the internal workers, databases and owners around them.
|
|
19
|
+
|
|
20
|
+
A **custom export** is that part of your catalog, written as a file in your catalog. Its frontmatter says what's in it, and its body is the introduction readers see first. Each one is written as its own HTML file, in the same format as the reference.
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
Some custom exports you might write:
|
|
25
|
+
|
|
26
|
+
- **For partners**: the services, events and specifications they integrate with.
|
|
27
|
+
- **For a regulator or a data protection review**: every resource that holds personal data.
|
|
28
|
+
- **For the team taking over a domain**: the whole domain, with its owners and docs.
|
|
29
|
+
- **For the public**: whatever your resources mark as public, with a [custom property](#by-custom-property) such as `x-public: true`.
|
|
30
|
+
|
|
31
|
+
## Create a custom export
|
|
32
|
+
|
|
33
|
+
Add a file to the `exports` folder at the root of your catalog. The file name is the export's id: `exports/partner-payments.mdx` is the export `partner-payments`, written to `partner-payments.html`.
|
|
34
|
+
|
|
35
|
+
```mdx title="exports/partner-payments.mdx"
|
|
36
|
+
---
|
|
37
|
+
title: Payments for partners
|
|
38
|
+
summary: How partners take payment for orders and stay in sync with what happens next.
|
|
39
|
+
audience: Partners integrating with Acme Checkout
|
|
40
|
+
version: 2026.10
|
|
41
|
+
|
|
42
|
+
include:
|
|
43
|
+
# A whole system: its services, data stores and the messages they send and receive
|
|
44
|
+
- system: payment-processing-system
|
|
45
|
+
# One service, at the version partners integrate with
|
|
46
|
+
- service: checkout-api
|
|
47
|
+
version: 1.x
|
|
48
|
+
# Single messages
|
|
49
|
+
- event: payment-succeeded
|
|
50
|
+
- event: payment-failed
|
|
51
|
+
- event: refund-processed
|
|
52
|
+
|
|
53
|
+
exclude:
|
|
54
|
+
# Internal, even though it's in the system above
|
|
55
|
+
- service: payment-worker
|
|
56
|
+
- data-store: payment-database
|
|
57
|
+
# Anything holding personal data, by its custom property
|
|
58
|
+
- x-contains-personal-data: true
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
Welcome! This guide covers everything you need to take payment for an Acme order and react to what happens afterwards.
|
|
62
|
+
|
|
63
|
+
## How it works
|
|
64
|
+
|
|
65
|
+
1. Your app checks out a cart through the [[service|checkout-api]].
|
|
66
|
+
2. You receive [[event|payment-succeeded]] or [[event|payment-failed]], then [[event|refund-processed]] if the order is refunded later.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`title` and `include` are required. `summary`, `audience` and `version` are shown at the top of the page. The body is markdown, and can link to resources with `[[type|id]]`, as your other pages do.
|
|
70
|
+
|
|
71
|
+
See the [reference](/docs/development/export/reference#frontmatter) for every field.
|
|
72
|
+
|
|
73
|
+
## Choose what's in it
|
|
74
|
+
|
|
75
|
+
`include` and `exclude` are lists of **selectors**. A selector names one resource by its kind and id, or matches every resource with a [custom property](/docs/development/customization/custom-properties).
|
|
76
|
+
|
|
77
|
+
### By id
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
include:
|
|
81
|
+
- domain: payments
|
|
82
|
+
- system: payment-processing-system
|
|
83
|
+
- service: checkout-api
|
|
84
|
+
version: 1.x # optional: an exact version or a range
|
|
85
|
+
- event: payment-succeeded
|
|
86
|
+
- message: refund-requested # an event, command or query with this id
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Only the latest version of each resource is exported, so a `version` must match the latest one. If it doesn't, [checking the export](#check-a-custom-export) tells you which version is exported. See the [reference](/docs/development/export/reference#selectors) for every kind you can select.
|
|
90
|
+
|
|
91
|
+
### By custom property
|
|
92
|
+
|
|
93
|
+
Any selector with an `x-` field matches every resource with that custom property, instead of one resource:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
include:
|
|
97
|
+
# Every resource with x-public: true
|
|
98
|
+
- x-public: true
|
|
99
|
+
# Tier 1 services only
|
|
100
|
+
- x-operational-tier: 1
|
|
101
|
+
kind: service
|
|
102
|
+
# Any of these values
|
|
103
|
+
- x-data-classification: [public, partner]
|
|
104
|
+
exclude:
|
|
105
|
+
- x-internal: true
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
- Every `x-` field in a selector must match. Separate selectors are alternatives.
|
|
109
|
+
- A field matches when the resource's value is one of those given. Values are compared as text, so `true` matches `true` and `"true"`.
|
|
110
|
+
- When a resource's value is a list, it matches when any item in it does.
|
|
111
|
+
- Objects can't be matched.
|
|
112
|
+
- `kind` narrows the selector to one kind of resource, or a list of them (`kind: [service, event]`).
|
|
113
|
+
|
|
114
|
+
This lets resources opt in from their own frontmatter: mark what partners may see with `x-public: true`, and one selector picks it all up, including whatever you mark later.
|
|
115
|
+
|
|
116
|
+
The custom properties choose what's in an export, but they're never shown in it. Values like `x-cost-centre` stay in your catalog.
|
|
117
|
+
|
|
118
|
+
### What include brings in
|
|
119
|
+
|
|
120
|
+
| You include | What goes in the export |
|
|
121
|
+
| --- | --- |
|
|
122
|
+
| A domain | The domain, its subdomains, systems, services, entities and flows, all the way down, and the messages its services send and receive |
|
|
123
|
+
| A system | The system, its services, data stores, entities and flows, and the messages its services send and receive |
|
|
124
|
+
| Anything else | That resource |
|
|
125
|
+
|
|
126
|
+
A service on its own doesn't bring its messages. Include them, include the system the service is in, or set `references: include`.
|
|
127
|
+
|
|
128
|
+
### Exclude
|
|
129
|
+
|
|
130
|
+
`exclude` is applied first and always wins over `include`.
|
|
131
|
+
|
|
132
|
+
- A resource you exclude isn't added, even when it's inside something you included.
|
|
133
|
+
- Excluding a domain or system takes out everything in it.
|
|
134
|
+
- An excluded resource brings nothing with it. The messages only an excluded service sends and receives aren't pulled in through it.
|
|
135
|
+
- **An excluded resource is never named**. Links to it are dropped, whatever `references` is set to, and links to it in docs read "another service".
|
|
136
|
+
|
|
137
|
+
### Never export {#never-export}
|
|
138
|
+
|
|
139
|
+
`neverExport` in `eventcatalog.config.js` works like an `exclude` in every custom export. Use it for what must never leave your catalog, whatever an export includes. It takes the same selectors, by id or by custom property:
|
|
140
|
+
|
|
141
|
+
```js title="eventcatalog.config.js"
|
|
142
|
+
module.exports = {
|
|
143
|
+
exports: {
|
|
144
|
+
custom: {
|
|
145
|
+
neverExport: [
|
|
146
|
+
{ service: 'fraud-detection' },
|
|
147
|
+
{ 'x-data-classification': ['confidential', 'restricted'] },
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Links to resources outside the export
|
|
155
|
+
|
|
156
|
+
Resources in the export still point at things that aren't in it, like a service that consumes one of your events. `references` sets what readers see:
|
|
157
|
+
|
|
158
|
+
- `omit` (the default): nothing. The link is dropped.
|
|
159
|
+
- `name-only`: the resource's name, without a link.
|
|
160
|
+
- `include`: the resource itself, pulled into the export. One level only, so what it points at isn't followed. Excluded resources are never pulled in.
|
|
161
|
+
|
|
162
|
+
### Hidden fields
|
|
163
|
+
|
|
164
|
+
Some fields are written for your own teams. By default, an export leaves out the owners, repositories, team contacts and the resources' own docs. Set `hide` to choose:
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
hide: [owners, repository] # show contacts and docs
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Set `hide: []` to show everything, for example in an export for one of your own teams. See the [reference](/docs/development/export/reference#hide) for every field you can hide.
|
|
171
|
+
|
|
172
|
+
The resources' docs are hidden by default because they're often full of what's around them. If you show them, links in them to resources outside the export read "another service", "another event" and so on (or the resource's name, with `references: name-only`, unless it was excluded).
|
|
173
|
+
|
|
174
|
+
### The order things happen in
|
|
175
|
+
|
|
176
|
+
1. `exclude` and `neverExport` take resources out, with everything inside them.
|
|
177
|
+
2. `include` adds what it names (a domain or system with what's inside it), skipping anything taken out.
|
|
178
|
+
3. `references: include` adds what those resources point at, one level.
|
|
179
|
+
4. Links to anything outside the export are dropped, or shown as names with `references: name-only`.
|
|
180
|
+
5. `hide` leaves fields out of what's left.
|
|
181
|
+
|
|
182
|
+
## Check a custom export
|
|
183
|
+
|
|
184
|
+
Before you share a custom export, check what's in it, what was left out, and why:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
npx @eventcatalog/cli export partner-payments --check
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
```
|
|
191
|
+
Payments for partners (exports/partner-payments.mdx)
|
|
192
|
+
|
|
193
|
+
Included (7)
|
|
194
|
+
system payment-processing-system 1.0.0 (include)
|
|
195
|
+
service payment-api 1.0.0 (in system payment-processing-system)
|
|
196
|
+
command authorize-payment 1.0.0 (in system payment-processing-system)
|
|
197
|
+
service checkout-api 1.0.0 (include)
|
|
198
|
+
event payment-succeeded 1.0.0 (include)
|
|
199
|
+
event payment-failed 1.0.0 (include)
|
|
200
|
+
event refund-processed 1.0.0 (include)
|
|
201
|
+
|
|
202
|
+
Excluded (2)
|
|
203
|
+
service payment-worker 1.0.0 (exclude, was in system payment-processing-system)
|
|
204
|
+
data store payment-database 1.0.0 (exclude, was in system payment-processing-system)
|
|
205
|
+
|
|
206
|
+
Links dropped (26)
|
|
207
|
+
system payment-processing-system → domain payments (not in this export)
|
|
208
|
+
...
|
|
209
|
+
|
|
210
|
+
Hidden: owners, repository, contacts, docs
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Resources matched by a custom property say so, for example `(include service with x-operational-tier: 1)`.
|
|
214
|
+
|
|
215
|
+
`--check` fails when a selector in `include` or `exclude` matches nothing in the catalog, so run it in CI to notice when a resource is renamed or removed.
|
|
216
|
+
|
|
217
|
+
## Export it
|
|
218
|
+
|
|
219
|
+
**Every time you build your catalog**, EventCatalog writes each custom export to `dist/exports/<id>.html` (`dist/client/exports/<id>.html` in [server mode](/docs/development/deployment/build-ssr-mode)). Wherever you host your catalog, it's at `/exports/<id>.html`.
|
|
220
|
+
|
|
221
|
+
Each one is written on its own: a custom export with a problem is skipped with a warning in the build's output, and the others are still written. Run [`--check`](#check-a-custom-export) on it to see what's wrong.
|
|
222
|
+
|
|
223
|
+
To export one without building the catalog, use the CLI:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npx @eventcatalog/cli export partner-payments
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
This writes `partner-payments.html` and opens it in your browser. See the [reference](/docs/development/export/reference#cli) for the CLI's options.
|
|
230
|
+
|
|
231
|
+
## Configure custom exports
|
|
232
|
+
|
|
233
|
+
Set options for every custom export in `eventcatalog.config.js`, under `exports.custom`:
|
|
234
|
+
|
|
235
|
+
```js title="eventcatalog.config.js"
|
|
236
|
+
module.exports = {
|
|
237
|
+
exports: {
|
|
238
|
+
custom: {
|
|
239
|
+
// Build only these custom exports (by id)
|
|
240
|
+
only: ['partner-payments'],
|
|
241
|
+
// What every custom export starts from. Its own frontmatter overrides it.
|
|
242
|
+
defaults: {
|
|
243
|
+
hide: ['owners', 'repository', 'contacts', 'docs'],
|
|
244
|
+
references: 'omit',
|
|
245
|
+
},
|
|
246
|
+
// Never in any custom export, whatever it includes
|
|
247
|
+
neverExport: [{ 'x-data-classification': ['confidential', 'restricted'] }],
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
To stop writing custom exports when you build, set `exports.custom.enabled` to `false`.
|
|
254
|
+
|
|
255
|
+
If your catalog uses [authentication](/docs/development/authentication/introduction), custom exports aren't written when you build unless you set `exports.custom.enabled` to `true`. You can still export them with the CLI.
|
|
256
|
+
|
|
257
|
+
See the [reference](/docs/development/export/reference#configuration) for every option.
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 4
|
|
3
|
+
keywords:
|
|
4
|
+
- EventCatalog export
|
|
5
|
+
- Custom export frontmatter
|
|
6
|
+
- Export configuration
|
|
7
|
+
- Export CLI
|
|
8
|
+
sidebar_label: Reference
|
|
9
|
+
title: Export reference
|
|
10
|
+
description: Paths, frontmatter fields, selectors, configuration, CLI options and APIs for the architecture reference and custom exports.
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
import AddedIn from '@site/src/components/MDX/AddedIn';
|
|
14
|
+
|
|
15
|
+
Everything about exporting your catalog in one place: the [architecture reference](/docs/development/export/architecture-reference) and [custom exports](/docs/development/export/custom-exports).
|
|
16
|
+
|
|
17
|
+
## Paths {#paths}
|
|
18
|
+
|
|
19
|
+
Custom exports are files in the `exports` folder at the root of your catalog, one per export:
|
|
20
|
+
|
|
21
|
+
```txt
|
|
22
|
+
/exports/{id}.mdx
|
|
23
|
+
/exports/{id}.md
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The folder isn't searched recursively. Set [`exports.custom.dir`](#exports-custom) to use another folder.
|
|
27
|
+
|
|
28
|
+
## Output {#output}
|
|
29
|
+
|
|
30
|
+
| File | Static build | [Server mode](/docs/development/deployment/build-ssr-mode) | Hosted at |
|
|
31
|
+
| --- | --- | --- | --- |
|
|
32
|
+
| Architecture reference | `dist/architecture.html` | `dist/client/architecture.html` | `/architecture.html` |
|
|
33
|
+
| Custom export | `dist/exports/{id}.html` | `dist/client/exports/{id}.html` | `/exports/{id}.html` |
|
|
34
|
+
|
|
35
|
+
The [CLI](#cli) writes `architecture.html` or `{id}.html` in the folder you run it from, unless you pass `--output`.
|
|
36
|
+
|
|
37
|
+
Every file is self-contained: styles, scripts, schemas and specifications are inside it. Only the latest version of each resource is exported.
|
|
38
|
+
|
|
39
|
+
## Frontmatter {#frontmatter}
|
|
40
|
+
|
|
41
|
+
The frontmatter of a custom export file. Any other field is an error, and every problem in a file is reported at once.
|
|
42
|
+
|
|
43
|
+
Values are read as text, so `version: 2026.10` stays `2026.10`.
|
|
44
|
+
|
|
45
|
+
### Required fields
|
|
46
|
+
|
|
47
|
+
#### `title` {#title}
|
|
48
|
+
|
|
49
|
+
- Type: `string`
|
|
50
|
+
|
|
51
|
+
The export's title, shown at the top of the page and in link previews.
|
|
52
|
+
|
|
53
|
+
```md title="Example"
|
|
54
|
+
---
|
|
55
|
+
title: Payments for partners
|
|
56
|
+
---
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### `include` {#include}
|
|
60
|
+
|
|
61
|
+
- Type: `array` of [selectors](#selectors)
|
|
62
|
+
|
|
63
|
+
What's in the export. A domain or system brings what's inside it.
|
|
64
|
+
|
|
65
|
+
```md title="Example"
|
|
66
|
+
---
|
|
67
|
+
include:
|
|
68
|
+
- system: payment-processing-system
|
|
69
|
+
- event: payment-succeeded
|
|
70
|
+
- x-public: true
|
|
71
|
+
---
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Optional fields
|
|
75
|
+
|
|
76
|
+
#### `id` {#id}
|
|
77
|
+
|
|
78
|
+
- Type: `string`
|
|
79
|
+
- Default: the file name, without its extension
|
|
80
|
+
|
|
81
|
+
The export's id. It names the HTML file and is what you pass to the CLI. Letters, numbers, `-` and `_` only, and unique across the folder.
|
|
82
|
+
|
|
83
|
+
```md title="Example"
|
|
84
|
+
---
|
|
85
|
+
id: payments-for-partners
|
|
86
|
+
---
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
#### `summary` {#summary}
|
|
90
|
+
|
|
91
|
+
- Type: `string`
|
|
92
|
+
|
|
93
|
+
A sentence under the title. Also used as the description in link previews.
|
|
94
|
+
|
|
95
|
+
```md title="Example"
|
|
96
|
+
---
|
|
97
|
+
summary: How partners take payment for orders and stay in sync with what happens next.
|
|
98
|
+
---
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### `audience` {#audience}
|
|
102
|
+
|
|
103
|
+
- Type: `string`
|
|
104
|
+
|
|
105
|
+
Who the export is for, shown under the title.
|
|
106
|
+
|
|
107
|
+
```md title="Example"
|
|
108
|
+
---
|
|
109
|
+
audience: Partners integrating with Acme Checkout
|
|
110
|
+
---
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### `version` {#version}
|
|
114
|
+
|
|
115
|
+
- Type: `string`
|
|
116
|
+
|
|
117
|
+
The export's own version, shown at the top of the page.
|
|
118
|
+
|
|
119
|
+
```md title="Example"
|
|
120
|
+
---
|
|
121
|
+
version: 2026.10
|
|
122
|
+
---
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### `exclude` {#exclude}
|
|
126
|
+
|
|
127
|
+
- Type: `array` of [selectors](#selectors)
|
|
128
|
+
|
|
129
|
+
What to take out again. Applied before `include`, and always wins. Excluding a domain or system takes out everything in it, and an excluded resource is never named in the export.
|
|
130
|
+
|
|
131
|
+
```md title="Example"
|
|
132
|
+
---
|
|
133
|
+
exclude:
|
|
134
|
+
- service: payment-worker
|
|
135
|
+
- x-internal: true
|
|
136
|
+
---
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
#### `references` {#references}
|
|
140
|
+
|
|
141
|
+
- Type: `omit`, `name-only` or `include`
|
|
142
|
+
- Default: `omit`, or [`exports.custom.defaults.references`](#exports-custom)
|
|
143
|
+
|
|
144
|
+
What to show for links to resources that aren't in the export:
|
|
145
|
+
|
|
146
|
+
| Value | What's shown |
|
|
147
|
+
| --- | --- |
|
|
148
|
+
| `omit` | Nothing. The link is dropped. |
|
|
149
|
+
| `name-only` | The resource's name, without a link. |
|
|
150
|
+
| `include` | The resource itself, pulled into the export. One level only: what it points at isn't followed. |
|
|
151
|
+
|
|
152
|
+
Links to excluded resources are always dropped.
|
|
153
|
+
|
|
154
|
+
```md title="Example"
|
|
155
|
+
---
|
|
156
|
+
references: name-only
|
|
157
|
+
---
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
#### `hide` {#hide}
|
|
161
|
+
|
|
162
|
+
- Type: `array`
|
|
163
|
+
- Default: `[owners, repository, contacts, docs]`, or [`exports.custom.defaults.hide`](#exports-custom)
|
|
164
|
+
|
|
165
|
+
Fields to leave out of every resource in the export. Set `hide: []` to show everything.
|
|
166
|
+
|
|
167
|
+
| Value | What it leaves out |
|
|
168
|
+
| --- | --- |
|
|
169
|
+
| `owners` | Who owns each resource, and what each team or user in the export owns |
|
|
170
|
+
| `repository` | Where a service's code lives |
|
|
171
|
+
| `contacts` | Team and user email addresses and Slack channels |
|
|
172
|
+
| `docs` | The resources' own documentation (the body of their pages) |
|
|
173
|
+
| `specifications` | OpenAPI, AsyncAPI and GraphQL specifications |
|
|
174
|
+
| `examples` | Example payloads for messages, including the one made from the schema |
|
|
175
|
+
|
|
176
|
+
```md title="Example"
|
|
177
|
+
---
|
|
178
|
+
hide: [owners, repository]
|
|
179
|
+
---
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Body
|
|
183
|
+
|
|
184
|
+
The body of the file is the export's introduction, in markdown, shown before the resources. It can link to resources with `[[type|id]]`. A link to a resource that isn't in the export reads "another service", "another event" and so on, or the resource's name with `references: name-only` (unless it was excluded).
|
|
185
|
+
|
|
186
|
+
## Selectors {#selectors}
|
|
187
|
+
|
|
188
|
+
`include`, `exclude` and [`neverExport`](#exports-custom) are lists of selectors.
|
|
189
|
+
|
|
190
|
+
### By id
|
|
191
|
+
|
|
192
|
+
One resource, by its kind and id, with an optional version:
|
|
193
|
+
|
|
194
|
+
```yaml
|
|
195
|
+
- service: checkout-api
|
|
196
|
+
version: 1.x
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
| Key | Matches |
|
|
200
|
+
| --- | --- |
|
|
201
|
+
| `domain` | A domain, with its subdomains, systems, services, entities and flows, and the messages its services send and receive |
|
|
202
|
+
| `system` | A system, with its services, data stores, entities and flows, and the messages its services send and receive |
|
|
203
|
+
| `service` | A service, or an agent with that id when no service has it |
|
|
204
|
+
| `agent` | An agent |
|
|
205
|
+
| `event`, `command`, `query` | A message of that kind |
|
|
206
|
+
| `message` | An event, command or query with that id |
|
|
207
|
+
| `channel` | A channel |
|
|
208
|
+
| `data-store` (or `container`) | A data store |
|
|
209
|
+
| `flow` | A flow |
|
|
210
|
+
| `entity` | An entity |
|
|
211
|
+
| `team`, `user` | A team or a user |
|
|
212
|
+
|
|
213
|
+
`version` is an exact version or a semver range. Only the latest version of each resource is exported, so it must match the latest one.
|
|
214
|
+
|
|
215
|
+
### By custom property
|
|
216
|
+
|
|
217
|
+
Every resource with [custom properties](/docs/development/customization/custom-properties) that have the given values:
|
|
218
|
+
|
|
219
|
+
```yaml
|
|
220
|
+
- x-operational-tier: [1, 2]
|
|
221
|
+
kind: [service, agent]
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
| Key | Description |
|
|
225
|
+
| --- | --- |
|
|
226
|
+
| `x-…` | A custom property, and the value (or list of values) it must have. Every `x-` key in a selector must match. |
|
|
227
|
+
| `kind` | Optional. One kind, or a list of them, from the table above. |
|
|
228
|
+
|
|
229
|
+
- Values are compared as text: `true` matches `true` and `"true"`, and `1` matches `1` and `"1"`.
|
|
230
|
+
- A resource's list matches when any of its items does.
|
|
231
|
+
- Objects can't be matched.
|
|
232
|
+
- A selector can't also name a resource by id, or take a `version`.
|
|
233
|
+
|
|
234
|
+
## Configuration {#configuration}
|
|
235
|
+
|
|
236
|
+
### `exports.html` {#exports-html}
|
|
237
|
+
|
|
238
|
+
<AddedIn version="5.1.0" />
|
|
239
|
+
|
|
240
|
+
| Option | Type | Default | Description |
|
|
241
|
+
| --- | --- | --- | --- |
|
|
242
|
+
| `exports.html.enabled` | `boolean` | `true` (`false` with authentication) | Write the architecture reference when you build. |
|
|
243
|
+
|
|
244
|
+
### `exports.custom` {#exports-custom}
|
|
245
|
+
|
|
246
|
+
<AddedIn version="5.2.0" />
|
|
247
|
+
|
|
248
|
+
| Option | Type | Default | Description |
|
|
249
|
+
| --- | --- | --- | --- |
|
|
250
|
+
| `exports.custom.enabled` | `boolean` | `true` (`false` with authentication) | Write the custom exports when you build. |
|
|
251
|
+
| `exports.custom.dir` | `string` | `'exports'` | The folder with your custom export files, relative to your catalog. |
|
|
252
|
+
| `exports.custom.only` | `string[]` | | Build only these custom exports, by id. The CLI can still export any of them. |
|
|
253
|
+
| `exports.custom.defaults.hide` | `string[]` | `['owners', 'repository', 'contacts', 'docs']` | What every custom export [hides](#hide), unless it sets its own `hide`. |
|
|
254
|
+
| `exports.custom.defaults.references` | `string` | `'omit'` | What every custom export shows for [links out of it](#references), unless it sets its own. |
|
|
255
|
+
| `exports.custom.neverExport` | `object[]` | | [Selectors](#selectors) for resources no custom export may show, whatever it includes. |
|
|
256
|
+
|
|
257
|
+
### When exports are written
|
|
258
|
+
|
|
259
|
+
| Your catalog | `enabled` not set | `true` | `false` |
|
|
260
|
+
| --- | --- | --- | --- |
|
|
261
|
+
| Without [authentication](/docs/development/authentication/introduction) | Written | Written | Not written |
|
|
262
|
+
| With authentication | Not written | Written | Not written |
|
|
263
|
+
|
|
264
|
+
Files in the build output are served without the authentication checks, so catalogs with authentication must turn exports on. Custom exports are only looked for when the folder has `.md` or `.mdx` files.
|
|
265
|
+
|
|
266
|
+
Each custom export is written on its own. One with a problem (a field that isn't valid, an id another file uses too, or nothing in it) is skipped with a warning in the build's output, and the others are still written. The build doesn't fail.
|
|
267
|
+
|
|
268
|
+
### Example
|
|
269
|
+
|
|
270
|
+
```js title="eventcatalog.config.js"
|
|
271
|
+
module.exports = {
|
|
272
|
+
exports: {
|
|
273
|
+
html: {
|
|
274
|
+
enabled: true,
|
|
275
|
+
},
|
|
276
|
+
custom: {
|
|
277
|
+
only: ['partner-payments', 'personal-data'],
|
|
278
|
+
defaults: {
|
|
279
|
+
hide: ['owners', 'repository', 'contacts', 'docs'],
|
|
280
|
+
references: 'omit',
|
|
281
|
+
},
|
|
282
|
+
neverExport: [
|
|
283
|
+
{ service: 'fraud-detection' },
|
|
284
|
+
{ 'x-data-classification': ['confidential', 'restricted'] },
|
|
285
|
+
],
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
};
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
See the [full configuration reference](/docs/api/config) for every EventCatalog option.
|
|
292
|
+
|
|
293
|
+
## CLI {#cli}
|
|
294
|
+
|
|
295
|
+
Run the [`export` command](/docs/cli/cli-export) of the [EventCatalog CLI](/docs/cli) from the root of your catalog:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
# The architecture reference
|
|
299
|
+
npx @eventcatalog/cli export --format html
|
|
300
|
+
|
|
301
|
+
# A custom export, by id
|
|
302
|
+
npx @eventcatalog/cli export partner-payments
|
|
303
|
+
|
|
304
|
+
# What's in a custom export, without writing it
|
|
305
|
+
npx @eventcatalog/cli export partner-payments --check
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
| Option | Description |
|
|
309
|
+
| --- | --- |
|
|
310
|
+
| `<id>` | The custom export to write. Leave it out, with `--format html`, for the architecture reference. |
|
|
311
|
+
| `--format html` | Export as HTML. Not needed with an id. |
|
|
312
|
+
| `--check` | With an id: list what's in the export, what was left out and why, without writing it. |
|
|
313
|
+
| `--output <path>` | Where to write the file. Defaults to `architecture.html` or `<id>.html` |
|
|
314
|
+
| `--no-open` | Don't open the file in your browser. It's never opened in CI, or when the output isn't a terminal. |
|
|
315
|
+
| `--stdout` | Print the HTML instead of writing a file. |
|
|
316
|
+
| `--dir <path>` | Path to your catalog, if you aren't running the command from it. |
|
|
317
|
+
|
|
318
|
+
The command exits with `1` when an export has a problem (an unknown id, or a field that isn't valid), and when `--check` finds a selector that matches nothing in the catalog.
|
|
319
|
+
|
|
320
|
+
### Check output
|
|
321
|
+
|
|
322
|
+
`--check` lists, in groups:
|
|
323
|
+
|
|
324
|
+
| Group | What it lists |
|
|
325
|
+
| --- | --- |
|
|
326
|
+
| Included | Every resource in the export, and why: `include`, `in system …`, `include x-public: true`, `referenced by …` |
|
|
327
|
+
| Excluded | What `exclude` or `neverExport` took out of what the export would otherwise have |
|
|
328
|
+
| Links dropped | Links to resources outside the export, and why: `not in this export`, `exclude` |
|
|
329
|
+
| Links shown as names | With `references: name-only`, the links shown as plain names |
|
|
330
|
+
| Not found | Selectors that matched nothing, and why |
|
|
331
|
+
| Links in docs that lead outside the export | `[[type\|id]]` links in docs, and the text shown in their place |
|
|
332
|
+
| Hidden | The fields left out |
|
|
333
|
+
|
|
334
|
+
## SDK {#sdk}
|
|
335
|
+
|
|
336
|
+
[`getResourcesByProperty`](/docs/development/customization/custom-properties#find-resources-by-custom-property) finds resources by custom property, as custom exports do:
|
|
337
|
+
|
|
338
|
+
```js
|
|
339
|
+
import utils from '@eventcatalog/sdk';
|
|
340
|
+
|
|
341
|
+
const { getResourcesByProperty } = utils('/path/to/eventcatalog');
|
|
342
|
+
|
|
343
|
+
await getResourcesByProperty('x-operational-tier', { equals: 1, types: ['service'], latestOnly: true });
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
| Option | Type | Description |
|
|
347
|
+
| --- | --- | --- |
|
|
348
|
+
| `equals` | any | Only resources whose value is this one. |
|
|
349
|
+
| `in` | `array` | Only resources whose value is one of these. |
|
|
350
|
+
| `types` | `string[]` | Only these kinds of resource, such as `service`, `event` or `domain`. |
|
|
351
|
+
| `latestOnly` | `boolean` | Only the latest version of each resource. |
|
|
352
|
+
|
|
353
|
+
Each result has the resource's `type`, `id`, `version`, the property's `value`, the `path` to its file and whether it's the `latest` version.
|
|
354
|
+
|
|
355
|
+
## Exporters package {#exporters-package}
|
|
356
|
+
|
|
357
|
+
To export from your own scripts, use the `@eventcatalog/exporters` package, which the build and the CLI use:
|
|
358
|
+
|
|
359
|
+
```js
|
|
360
|
+
import { renderHtml, writeHtml, renderCustomExports, writeCustomExports, formatCustomExportReport } from '@eventcatalog/exporters';
|
|
361
|
+
|
|
362
|
+
// The architecture reference
|
|
363
|
+
const { html } = await renderHtml('/path/to/catalog');
|
|
364
|
+
await writeHtml({ dir: '/path/to/catalog', outputPath: 'architecture.html' });
|
|
365
|
+
|
|
366
|
+
// Custom exports: all of them, or those in `only`
|
|
367
|
+
const { rendered, failed } = await renderCustomExports('/path/to/catalog', { only: ['partner-payments'] });
|
|
368
|
+
console.log(formatCustomExportReport(rendered[0].report));
|
|
369
|
+
await writeCustomExports({ dir: '/path/to/catalog', outputDir: 'dist/exports' });
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
| Function | Returns |
|
|
373
|
+
| --- | --- |
|
|
374
|
+
| `renderHtml(dir)` | `{ html, model }`: the architecture reference |
|
|
375
|
+
| `writeHtml({ dir, outputPath })` | `{ html, model, path, bytes, durationMs }` |
|
|
376
|
+
| `renderCustomExports(dir, { only?, config? })` | `{ rendered, failed }`: `rendered` has `{ spec, html, model, report }` for each custom export, and `failed` has `{ id, file, error }` for each one that couldn't be exported |
|
|
377
|
+
| `writeCustomExports({ dir, outputDir, only?, config? })` | `{ written, failed }`: the same, with each file's `path` and `bytes` |
|
|
378
|
+
| `formatCustomExportReport(report)` | The `--check` output, as text |
|
|
379
|
+
| `loadCatalog(dir)` | The catalog as one resolved model, to build your own export |
|
|
380
|
+
|
|
381
|
+
`config` is `exports.custom` from `eventcatalog.config.js`, which is read from the catalog when you don't pass it.
|
|
382
|
+
|
|
383
|
+
Each custom export stands alone. One that can't be exported (its file has problems, two files share its id, it has nothing in it, or an id in `only` has no file) is in `failed`, with a `CustomExportError` that lists every problem in its `problems`, and the others are still exported. A problem with `exports.custom` itself throws.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"label": "Export your catalog",
|
|
3
|
+
"position": 4.4,
|
|
4
|
+
"collapsible": true,
|
|
5
|
+
"collapsed": false,
|
|
6
|
+
"link": {
|
|
7
|
+
"type": "generated-index",
|
|
8
|
+
"slug": "development/export",
|
|
9
|
+
"title": "Export your catalog",
|
|
10
|
+
"description": "Share your architecture with people who can't open your catalog: all of it, or just the part they need, as one HTML file."
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -78,18 +78,6 @@ email: payments@example.com
|
|
|
78
78
|
---
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
### `hidden` {#hidden}
|
|
82
|
-
|
|
83
|
-
- Type: `boolean`
|
|
84
|
-
|
|
85
|
-
Hide the team from generated lists.
|
|
86
|
-
|
|
87
|
-
```md title="Example"
|
|
88
|
-
---
|
|
89
|
-
hidden: true
|
|
90
|
-
---
|
|
91
|
-
```
|
|
92
|
-
|
|
93
81
|
### `slackDirectMessageUrl` {#slackDirectMessageUrl}
|
|
94
82
|
|
|
95
83
|
- Type: `string`
|
|
@@ -90,18 +90,6 @@ email: david@example.com
|
|
|
90
90
|
---
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
### `hidden` {#hidden}
|
|
94
|
-
|
|
95
|
-
- Type: `boolean`
|
|
96
|
-
|
|
97
|
-
Hide the user from generated lists.
|
|
98
|
-
|
|
99
|
-
```md title="Example"
|
|
100
|
-
---
|
|
101
|
-
hidden: true
|
|
102
|
-
---
|
|
103
|
-
```
|
|
104
|
-
|
|
105
93
|
### `slackDirectMessageUrl` {#slackDirectMessageUrl}
|
|
106
94
|
|
|
107
95
|
- Type: `string`
|