@eventcatalog/core 3.3.0 → 3.4.0
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/{chunk-I4CMEOEN.js → chunk-GLMX3ZTY.js} +1 -1
- package/dist/{chunk-NGKYYZZP.js → chunk-KFZIBXRQ.js} +1 -1
- package/dist/{chunk-QZF5ZYJB.js → chunk-MJRHV77M.js} +1 -1
- package/dist/{chunk-UPSN5H7S.js → chunk-Q4DKMESA.js} +1 -1
- package/dist/{chunk-OAUYXPXT.js → chunk-VAGFX36R.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +4 -3
- package/dist/eventcatalog.js +8 -7
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/integrations/eventcatalog-features.ts +9 -0
- package/eventcatalog/src/content.config.ts +9 -6
- package/eventcatalog/src/enterprise/ai/chat-api.ts +27 -83
- package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +1 -0
- package/eventcatalog/src/enterprise/mcp/mcp-server.ts +512 -0
- package/eventcatalog/src/enterprise/tools/catalog-tools.ts +690 -0
- package/eventcatalog/src/enterprise/tools/index.ts +5 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +24 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +2 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +22 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/_OpenAPI.tsx +28 -4
- package/eventcatalog/src/pages/docs/[type]/[id]/[version].mdx.ts +0 -4
- package/eventcatalog/src/utils/feature.ts +2 -0
- package/eventcatalog/tsconfig.json +1 -1
- package/package.json +4 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-Q4DKMESA.js";
|
|
4
|
+
import "../chunk-VAGFX36R.js";
|
|
5
|
+
import "../chunk-KFZIBXRQ.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -109,7 +109,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
109
109
|
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
110
110
|
|
|
111
111
|
// package.json
|
|
112
|
-
var version = "3.
|
|
112
|
+
var version = "3.4.0";
|
|
113
113
|
|
|
114
114
|
// src/constants.ts
|
|
115
115
|
var VERSION = version;
|
|
@@ -843,10 +843,11 @@ var startServerCatalog = ({
|
|
|
843
843
|
isEventCatalogStarter = false,
|
|
844
844
|
isEventCatalogScale = false
|
|
845
845
|
}) => {
|
|
846
|
+
const serverEntryPath = import_node_path8.default.join(dir, "dist", "server", "entry.mjs");
|
|
846
847
|
(0, import_node_child_process.execSync)(
|
|
847
|
-
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node
|
|
848
|
+
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
|
|
848
849
|
{
|
|
849
|
-
cwd:
|
|
850
|
+
cwd: core,
|
|
850
851
|
stdio: "inherit"
|
|
851
852
|
}
|
|
852
853
|
);
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-Q4DKMESA.js";
|
|
10
|
+
import "./chunk-VAGFX36R.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrations
|
|
13
13
|
} from "./chunk-BH3JMNAV.js";
|
|
@@ -21,13 +21,13 @@ import {
|
|
|
21
21
|
} from "./chunk-5VBIXL6C.js";
|
|
22
22
|
import {
|
|
23
23
|
generate
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-MJRHV77M.js";
|
|
25
25
|
import {
|
|
26
26
|
logger
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-GLMX3ZTY.js";
|
|
28
28
|
import {
|
|
29
29
|
VERSION
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-KFZIBXRQ.js";
|
|
31
31
|
import "./chunk-UPONRQSN.js";
|
|
32
32
|
|
|
33
33
|
// src/eventcatalog.ts
|
|
@@ -235,10 +235,11 @@ var startServerCatalog = ({
|
|
|
235
235
|
isEventCatalogStarter = false,
|
|
236
236
|
isEventCatalogScale = false
|
|
237
237
|
}) => {
|
|
238
|
+
const serverEntryPath = path.join(dir, "dist", "server", "entry.mjs");
|
|
238
239
|
execSync(
|
|
239
|
-
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node
|
|
240
|
+
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} node "${serverEntryPath}"`,
|
|
240
241
|
{
|
|
241
|
-
cwd:
|
|
242
|
+
cwd: core,
|
|
242
243
|
stdio: "inherit"
|
|
243
244
|
}
|
|
244
245
|
);
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-MJRHV77M.js";
|
|
4
|
+
import "./chunk-GLMX3ZTY.js";
|
|
5
|
+
import "./chunk-KFZIBXRQ.js";
|
|
6
6
|
import "./chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
isAuthEnabled,
|
|
6
6
|
isEventCatalogScaleEnabled,
|
|
7
7
|
isEventCatalogStarterEnabled,
|
|
8
|
+
isEventCatalogMCPEnabled,
|
|
8
9
|
} from '../src/utils/feature';
|
|
9
10
|
|
|
10
11
|
const catalogDirectory = process.env.CATALOG_DIR || process.cwd();
|
|
@@ -51,6 +52,14 @@ export default function eventCatalogIntegration(): AstroIntegration {
|
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
// Handle routes for MCP Server (requires SSR + Scale)
|
|
56
|
+
if (isEventCatalogMCPEnabled()) {
|
|
57
|
+
params.injectRoute({
|
|
58
|
+
pattern: '/docs/mcp/[...path]',
|
|
59
|
+
entrypoint: path.join(catalogDirectory, 'src/enterprise/mcp/mcp-server.ts'),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
54
63
|
// Handle routes for authentication
|
|
55
64
|
if (isAuthEnabled()) {
|
|
56
65
|
configureAuthentication(params);
|
|
@@ -448,6 +448,7 @@ const containers = defineCollection({
|
|
|
448
448
|
owners: detailPanelPropertySchema.optional(),
|
|
449
449
|
changelog: detailPanelPropertySchema.optional(),
|
|
450
450
|
attachments: detailPanelPropertySchema.optional(),
|
|
451
|
+
services: detailPanelPropertySchema.optional(),
|
|
451
452
|
})
|
|
452
453
|
.optional(),
|
|
453
454
|
services: z.array(reference('services')).optional(),
|
|
@@ -698,12 +699,14 @@ const diagrams = defineCollection({
|
|
|
698
699
|
base: projectDirBase,
|
|
699
700
|
generateId: ({ data }) => `${data.id}-${data.version}`,
|
|
700
701
|
}),
|
|
701
|
-
schema: z
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
702
|
+
schema: z
|
|
703
|
+
.object({
|
|
704
|
+
id: z.string(),
|
|
705
|
+
name: z.string(),
|
|
706
|
+
version: z.string(),
|
|
707
|
+
summary: z.string().optional(),
|
|
708
|
+
})
|
|
709
|
+
.merge(baseSchema),
|
|
707
710
|
});
|
|
708
711
|
|
|
709
712
|
export const collections = {
|
|
@@ -4,8 +4,16 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { isEventCatalogScaleEnabled } from '@utils/feature';
|
|
5
5
|
import { z, getCollection, getEntry } from 'astro:content';
|
|
6
6
|
import { getConsumersOfMessage, getProducersOfMessage } from '@utils/collections/services';
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
getResources as getResourcesImpl,
|
|
9
|
+
getResource as getResourceImpl,
|
|
10
|
+
getMessagesProducedOrConsumedByResource as getMessagesImpl,
|
|
11
|
+
getSchemaForResource as getSchemaImpl,
|
|
12
|
+
collectionSchema,
|
|
13
|
+
resourceCollectionSchema,
|
|
14
|
+
messageCollectionSchema,
|
|
15
|
+
toolDescriptions,
|
|
16
|
+
} from '@enterprise/tools/catalog-tools';
|
|
9
17
|
|
|
10
18
|
const catalogDirectory = process.env.PROJECT_DIR || process.cwd();
|
|
11
19
|
|
|
@@ -187,64 +195,31 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
187
195
|
// tools: tools,
|
|
188
196
|
tools: {
|
|
189
197
|
getResources: tool({
|
|
190
|
-
description:
|
|
191
|
-
'Use this tool to get events, services, commands, queries, flows, domains, channels, entities from EventCatalog',
|
|
198
|
+
description: toolDescriptions.getResources,
|
|
192
199
|
inputSchema: z.object({
|
|
193
|
-
collection:
|
|
194
|
-
.enum([
|
|
195
|
-
'events',
|
|
196
|
-
'services',
|
|
197
|
-
'commands',
|
|
198
|
-
'queries',
|
|
199
|
-
'flows',
|
|
200
|
-
'domains',
|
|
201
|
-
'channels',
|
|
202
|
-
'entities',
|
|
203
|
-
'containers',
|
|
204
|
-
'diagrams',
|
|
205
|
-
])
|
|
206
|
-
.describe('The collection to get the events from'),
|
|
200
|
+
collection: collectionSchema.describe('The collection to get the resources from'),
|
|
207
201
|
}),
|
|
208
202
|
execute: async ({ collection }) => {
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
version: resource.data.version,
|
|
213
|
-
name: resource.data.name,
|
|
214
|
-
}));
|
|
203
|
+
const result = await getResourcesImpl({ collection });
|
|
204
|
+
if ('error' in result) return result;
|
|
205
|
+
return result.resources;
|
|
215
206
|
},
|
|
216
207
|
}),
|
|
217
208
|
getResource: tool({
|
|
218
|
-
description:
|
|
209
|
+
description: toolDescriptions.getResource,
|
|
219
210
|
inputSchema: z.object({
|
|
220
|
-
collection:
|
|
221
|
-
.enum([
|
|
222
|
-
'events',
|
|
223
|
-
'services',
|
|
224
|
-
'commands',
|
|
225
|
-
'queries',
|
|
226
|
-
'flows',
|
|
227
|
-
'domains',
|
|
228
|
-
'channels',
|
|
229
|
-
'entities',
|
|
230
|
-
'containers',
|
|
231
|
-
'diagrams',
|
|
232
|
-
])
|
|
233
|
-
.describe('The collection to get the events from'),
|
|
211
|
+
collection: collectionSchema.describe('The collection to get the resource from'),
|
|
234
212
|
id: z.string().describe('The id of the resource to get'),
|
|
235
213
|
version: z.string().describe('The version of the resource to get'),
|
|
236
214
|
}),
|
|
237
215
|
execute: async ({ collection, id, version }) => {
|
|
238
|
-
|
|
239
|
-
return resource;
|
|
216
|
+
return await getResourceImpl({ collection, id, version });
|
|
240
217
|
},
|
|
241
218
|
}),
|
|
242
219
|
getProducersAndConsumersFromSchema: tool({
|
|
243
220
|
description: 'Use this tool to get the producers and consumers for a schema by its id and version',
|
|
244
221
|
inputSchema: z.object({
|
|
245
|
-
collection:
|
|
246
|
-
.enum(['events', 'commands', 'queries'])
|
|
247
|
-
.describe('The collection to get the producers and consumers from'),
|
|
222
|
+
collection: messageCollectionSchema.describe('The collection to get the producers and consumers from'),
|
|
248
223
|
id: z.string().describe('The id of the message to get the producers and consumers for'),
|
|
249
224
|
version: z.string().describe('The version of the message to get the producers and consumers for'),
|
|
250
225
|
}),
|
|
@@ -259,24 +234,16 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
259
234
|
},
|
|
260
235
|
}),
|
|
261
236
|
getMessagesProducedOrConsumedByResource: tool({
|
|
262
|
-
description:
|
|
263
|
-
'Use this tool to get the messages produced or consumed by a resource by its id and version. Look at the `sends` and `receives` properties to get the messages produced or consumed by the resource',
|
|
237
|
+
description: toolDescriptions.getMessagesProducedOrConsumedByResource,
|
|
264
238
|
inputSchema: z.object({
|
|
265
239
|
resourceId: z.string().describe('The id of the resource to get the messages produced or consumed for'),
|
|
266
240
|
resourceVersion: z.string().describe('The version of the resource to get the messages produced or consumed for'),
|
|
267
|
-
resourceCollection:
|
|
268
|
-
.enum(['services', 'events', 'commands', 'queries', 'flows', 'domains', 'channels', 'entities'])
|
|
241
|
+
resourceCollection: resourceCollectionSchema
|
|
269
242
|
.describe('The collection of the resource to get the messages produced or consumed for')
|
|
270
243
|
.default('services'),
|
|
271
244
|
}),
|
|
272
245
|
execute: async ({ resourceId, resourceVersion, resourceCollection }) => {
|
|
273
|
-
|
|
274
|
-
if (!resource) {
|
|
275
|
-
return {
|
|
276
|
-
error: `Resource not found with id ${resourceId} and version ${resourceVersion} and collection ${resourceCollection}`,
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
return resource;
|
|
246
|
+
return await getMessagesImpl({ resourceId, resourceVersion, resourceCollection });
|
|
280
247
|
},
|
|
281
248
|
}),
|
|
282
249
|
getProducerAndConsumerForMessage: tool({
|
|
@@ -284,8 +251,7 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
284
251
|
inputSchema: z.object({
|
|
285
252
|
messageId: z.string().describe('The id of the message to get the producers and consumers for'),
|
|
286
253
|
messageVersion: z.string().describe('The version of the message to get the producers and consumers for'),
|
|
287
|
-
messageCollection:
|
|
288
|
-
.enum(['events', 'commands', 'queries'])
|
|
254
|
+
messageCollection: messageCollectionSchema
|
|
289
255
|
.describe('The collection of the message to get the producers and consumers for')
|
|
290
256
|
.default('events'),
|
|
291
257
|
}),
|
|
@@ -301,8 +267,7 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
301
267
|
inputSchema: z.object({
|
|
302
268
|
messageId: z.string().describe('The id of the message to get the consumers for'),
|
|
303
269
|
messageVersion: z.string().describe('The version of the message to get the consumers for'),
|
|
304
|
-
messageCollection:
|
|
305
|
-
.enum(['events', 'commands', 'queries'])
|
|
270
|
+
messageCollection: messageCollectionSchema
|
|
306
271
|
.describe('The collection of the message to get the consumers for')
|
|
307
272
|
.default('events'),
|
|
308
273
|
}),
|
|
@@ -314,37 +279,16 @@ export const POST = async ({ request }: APIContext<{ question: string; messages:
|
|
|
314
279
|
},
|
|
315
280
|
}),
|
|
316
281
|
getSchemaForResource: tool({
|
|
317
|
-
description:
|
|
318
|
-
'Use this tool to get the schema or specifications (openapi or asyncapi or graphql) for a resource by its id and version, you will use code blocks to render the schema to the user too',
|
|
282
|
+
description: toolDescriptions.getSchemaForResource,
|
|
319
283
|
inputSchema: z.object({
|
|
320
284
|
resourceId: z.string().describe('The id of the resource to get the schema for'),
|
|
321
285
|
resourceVersion: z.string().describe('The version of the resource to get the schema for'),
|
|
322
|
-
resourceCollection:
|
|
323
|
-
.enum(['services', 'events', 'commands', 'queries', 'flows', 'domains', 'channels', 'entities'])
|
|
286
|
+
resourceCollection: resourceCollectionSchema
|
|
324
287
|
.describe('The collection of the resource to get the schema for')
|
|
325
288
|
.default('services'),
|
|
326
289
|
}),
|
|
327
290
|
execute: async ({ resourceId, resourceVersion, resourceCollection }) => {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (!resource) {
|
|
331
|
-
return {
|
|
332
|
-
error: `Resource not found with id ${resourceId} and version ${resourceVersion} and collection ${resourceCollection}`,
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const schema = await getSchemasFromResource(resource);
|
|
337
|
-
|
|
338
|
-
// If we have any schemas back then read them and return them
|
|
339
|
-
if (schema.length > 0) {
|
|
340
|
-
return schema.map((schemaItem) => ({
|
|
341
|
-
url: schemaItem.url,
|
|
342
|
-
format: schemaItem.format,
|
|
343
|
-
code: fs.readFileSync(schemaItem.url, 'utf-8'),
|
|
344
|
-
}));
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
return [];
|
|
291
|
+
return await getSchemaImpl({ resourceId, resourceVersion, resourceCollection });
|
|
348
292
|
},
|
|
349
293
|
}),
|
|
350
294
|
suggestFollowUpQuestions: tool({
|
|
@@ -380,6 +380,7 @@ const badges = doc?.badges || [];
|
|
|
380
380
|
|
|
381
381
|
if (window.eventcatalog.mermaid) {
|
|
382
382
|
const { icons } = await import('@iconify-json/logos');
|
|
383
|
+
// @ts-ignore
|
|
383
384
|
const { iconPacks = [], enableSupportForElkLayout = false } = window.eventcatalog.mermaid ?? {};
|
|
384
385
|
|
|
385
386
|
if (iconPacks.length > 0) {
|