@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
|
@@ -54,7 +54,6 @@ export const getServices = async ({ getAllVersions = true, returnBody = false }:
|
|
|
54
54
|
|
|
55
55
|
// 3. Filter services
|
|
56
56
|
const targetServices = allServices.filter((service) => {
|
|
57
|
-
if (service.data.hidden === true) return false;
|
|
58
57
|
if (!getAllVersions && service.filePath?.includes('versioned')) return false;
|
|
59
58
|
return true;
|
|
60
59
|
});
|
|
@@ -42,7 +42,6 @@ export const getSystems = async ({ getAllVersions = true, enrichServices = false
|
|
|
42
42
|
|
|
43
43
|
// Filter systems
|
|
44
44
|
const targetSystems = allSystems.filter((system) => {
|
|
45
|
-
if (system.data.hidden === true) return false;
|
|
46
45
|
if (!getAllVersions && system.filePath?.includes('versioned')) return false;
|
|
47
46
|
return true;
|
|
48
47
|
});
|
|
@@ -29,10 +29,7 @@ export const getTeams = async (): Promise<Team[]> => {
|
|
|
29
29
|
getAdrs({ getAllVersions: false }),
|
|
30
30
|
]);
|
|
31
31
|
|
|
32
|
-
// 2.
|
|
33
|
-
const targetTeams = allTeams.filter((team) => team.data.hidden !== true);
|
|
34
|
-
|
|
35
|
-
// 3. Build Owner Index: Map<OwnerID, Item[]>
|
|
32
|
+
// 2. Build Owner Index: Map<OwnerID, Item[]>
|
|
36
33
|
// This index groups all items (domains, services, etc.) by their owner IDs.
|
|
37
34
|
// This allows O(1) lookup to find all items owned by a specific team.
|
|
38
35
|
const ownershipMap = new Map<string, CollectionEntry<CollectionTypes>[]>();
|
|
@@ -59,8 +56,8 @@ export const getTeams = async (): Promise<Team[]> => {
|
|
|
59
56
|
addToIndex(allQueries);
|
|
60
57
|
addToIndex(allAdrs);
|
|
61
58
|
|
|
62
|
-
//
|
|
63
|
-
const processedTeams =
|
|
59
|
+
// 3. Enrich teams using the ownership index
|
|
60
|
+
const processedTeams = allTeams.map((team) => {
|
|
64
61
|
const teamId = team.data.id;
|
|
65
62
|
const ownedItems = ownershipMap.get(teamId) || [];
|
|
66
63
|
|
|
@@ -31,11 +31,7 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
31
31
|
getAdrs({ getAllVersions: false }),
|
|
32
32
|
]);
|
|
33
33
|
|
|
34
|
-
// 2.
|
|
35
|
-
const targetUsers = allUsers.filter((user) => user.data.hidden !== true);
|
|
36
|
-
const visibleTeams = allTeams.filter((team) => team.data.hidden !== true);
|
|
37
|
-
|
|
38
|
-
// 3. Process users (Optimization: Iterate once over relationships if possible,
|
|
34
|
+
// 2. Process users (Optimization: Iterate once over relationships if possible,
|
|
39
35
|
// but since we need to check ownership for EACH user against ALL items,
|
|
40
36
|
// we can't easily invert the map without building an "owner" index first.
|
|
41
37
|
// Given users/teams count is usually lower than events/services, iterating users and filtering items is acceptable,
|
|
@@ -67,8 +63,8 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
67
63
|
addToIndex(allAdrs);
|
|
68
64
|
|
|
69
65
|
// Team Membership Index: Map<UserID, Team[]>
|
|
70
|
-
const teamMembershipMap = new Map<string, typeof
|
|
71
|
-
for (const team of
|
|
66
|
+
const teamMembershipMap = new Map<string, typeof allTeams>();
|
|
67
|
+
for (const team of allTeams) {
|
|
72
68
|
if (team.data.members) {
|
|
73
69
|
for (const member of team.data.members) {
|
|
74
70
|
if (!teamMembershipMap.has(member.id)) {
|
|
@@ -79,7 +75,7 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
79
75
|
}
|
|
80
76
|
}
|
|
81
77
|
|
|
82
|
-
const mappedUsers =
|
|
78
|
+
const mappedUsers = allUsers.map((user) => {
|
|
83
79
|
const userId = user.data.id;
|
|
84
80
|
const associatedTeams = teamMembershipMap.get(userId) || [];
|
|
85
81
|
const associatedTeamIds = associatedTeams.map((t) => t.data.id);
|
|
@@ -17,7 +17,6 @@ export type DashboardEntry = {
|
|
|
17
17
|
name?: string;
|
|
18
18
|
version: string;
|
|
19
19
|
summary?: string;
|
|
20
|
-
hidden?: boolean;
|
|
21
20
|
owners?: Owner[];
|
|
22
21
|
schemaPath?: string;
|
|
23
22
|
};
|
|
@@ -41,8 +40,8 @@ export type DashboardData = {
|
|
|
41
40
|
|
|
42
41
|
const MESSAGE_COLLECTIONS = ['events', 'commands', 'queries'] as const;
|
|
43
42
|
|
|
44
|
-
// The latest version of a resource
|
|
45
|
-
const isCurrent = (entry: DashboardEntry) =>
|
|
43
|
+
// The latest version of a resource (older versions live in a `versioned` folder)
|
|
44
|
+
const isCurrent = (entry: DashboardEntry) => !entry.filePath?.includes('versioned');
|
|
46
45
|
|
|
47
46
|
/**
|
|
48
47
|
* Everything the homepage dashboard shows, from the catalog's collections: counts, and what changed recently.
|
|
@@ -39,8 +39,7 @@ const pointerIds = (pointers?: { id: string }[]) => (pointers || []).map((pointe
|
|
|
39
39
|
* A resource listed by a domain directly belongs to that domain, otherwise to
|
|
40
40
|
* the domain of the system it's in. Built once per flow from the collections,
|
|
41
41
|
* rather than asking `getDomainsForService`, `getOwner` and so on for each step,
|
|
42
|
-
* so it follows their rules: latest versions only
|
|
43
|
-
* are left out.
|
|
42
|
+
* so it follows their rules: latest versions only.
|
|
44
43
|
*/
|
|
45
44
|
export const createLaneIndex = ({ domains, systems, teams, users }: LaneCollections) => {
|
|
46
45
|
const systemOf = new Map<string, Lane>();
|
|
@@ -75,14 +74,12 @@ export const createLaneIndex = ({ domains, systems, teams, users }: LaneCollecti
|
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
const owners = new Map<string, { lane: Lane; isTeam: boolean }>();
|
|
78
|
-
const hiddenOwners = new Set<string>();
|
|
79
77
|
for (const [entries, isTeam] of [
|
|
80
78
|
[users, false],
|
|
81
79
|
[teams, true],
|
|
82
80
|
] as const) {
|
|
83
81
|
for (const owner of entries) {
|
|
84
|
-
|
|
85
|
-
else owners.set(owner.data.id, { lane: toLane(owner), isTeam });
|
|
82
|
+
owners.set(owner.data.id, { lane: toLane(owner), isTeam });
|
|
86
83
|
}
|
|
87
84
|
}
|
|
88
85
|
|
|
@@ -90,7 +87,6 @@ export const createLaneIndex = ({ domains, systems, teams, users }: LaneCollecti
|
|
|
90
87
|
const teamOf = (resource: Resource): Lane | undefined => {
|
|
91
88
|
const resolved = (resource.data.owners || [])
|
|
92
89
|
.map((owner) => (typeof owner === 'string' ? owner : owner.id))
|
|
93
|
-
.filter((id) => !hiddenOwners.has(id))
|
|
94
90
|
.map((id) => owners.get(id) ?? { lane: { id, name: id }, isTeam: false })
|
|
95
91
|
.sort((a, b) => Number(b.isTeam) - Number(a.isTeam));
|
|
96
92
|
return resolved[0]?.lane;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"license": "BUSL-1.1",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"version": "5.
|
|
10
|
+
"version": "5.2.1",
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
@@ -140,10 +140,10 @@
|
|
|
140
140
|
"y-protocols": "^1.0.7",
|
|
141
141
|
"yjs": "^13.6.33",
|
|
142
142
|
"zod": "^4.6.6",
|
|
143
|
-
"@eventcatalog/exporters": "0.
|
|
144
|
-
"@eventcatalog/
|
|
145
|
-
"@eventcatalog/
|
|
146
|
-
"@eventcatalog/
|
|
143
|
+
"@eventcatalog/exporters": "0.1.1",
|
|
144
|
+
"@eventcatalog/linter": "1.2.3",
|
|
145
|
+
"@eventcatalog/sdk": "2.31.1",
|
|
146
|
+
"@eventcatalog/visualiser": "^5.0.0"
|
|
147
147
|
},
|
|
148
148
|
"devDependencies": {
|
|
149
149
|
"@astrojs/check": "^0.9.10",
|
package/dist/chunk-E6WTCJUL.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// src/architecture-export.ts
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import path from "path";
|
|
4
|
-
import { writeHtml } from "@eventcatalog/exporters";
|
|
5
|
-
var isCatalogAuthEnabled = ({
|
|
6
|
-
config,
|
|
7
|
-
projectDir,
|
|
8
|
-
isServer
|
|
9
|
-
}) => Boolean(config?.auth?.enabled) && isServer && fs.existsSync(path.join(projectDir, "eventcatalog.auth.js"));
|
|
10
|
-
var resolveArchitectureExport = (config, { authEnabled }) => {
|
|
11
|
-
const enabled = config?.exports?.html?.enabled;
|
|
12
|
-
if (enabled === false) return { enabled: false, reason: "disabled" };
|
|
13
|
-
if (authEnabled && enabled !== true) return { enabled: false, reason: "auth" };
|
|
14
|
-
return { enabled: true };
|
|
15
|
-
};
|
|
16
|
-
var getArchitectureExportPath = ({ outDir, isServer }) => path.join(outDir, isServer ? "client" : "", "architecture.html");
|
|
17
|
-
var writeArchitectureExport = ({
|
|
18
|
-
projectDir,
|
|
19
|
-
outDir,
|
|
20
|
-
isServer
|
|
21
|
-
}) => writeHtml({
|
|
22
|
-
dir: projectDir,
|
|
23
|
-
outputPath: getArchitectureExportPath({ outDir, isServer }),
|
|
24
|
-
regenerateCommand: "npx eventcatalog build"
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export {
|
|
28
|
-
isCatalogAuthEnabled,
|
|
29
|
-
resolveArchitectureExport,
|
|
30
|
-
getArchitectureExportPath,
|
|
31
|
-
writeArchitectureExport
|
|
32
|
-
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createFederationContentCache
|
|
3
|
+
} from "./chunk-R7Z5ALYI.js";
|
|
4
|
+
import {
|
|
5
|
+
getFederationDiagnostics,
|
|
6
|
+
resolveFederationRules
|
|
7
|
+
} from "./chunk-JJPB6EOZ.js";
|
|
1
8
|
import {
|
|
2
9
|
withFederationOutputTransaction
|
|
3
10
|
} from "./chunk-WRNH5C3U.js";
|
|
@@ -7,13 +14,6 @@ import {
|
|
|
7
14
|
import {
|
|
8
15
|
createFederationSourceProvider
|
|
9
16
|
} from "./chunk-A2RZR3U4.js";
|
|
10
|
-
import {
|
|
11
|
-
createFederationContentCache
|
|
12
|
-
} from "./chunk-R7Z5ALYI.js";
|
|
13
|
-
import {
|
|
14
|
-
getFederationDiagnostics,
|
|
15
|
-
resolveFederationRules
|
|
16
|
-
} from "./chunk-JJPB6EOZ.js";
|
|
17
17
|
import {
|
|
18
18
|
getEventCatalogConfigFile
|
|
19
19
|
} from "./chunk-4G7FSRPN.js";
|