@eventcatalog/core 2.29.1 → 2.29.3
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/README.md +4 -1
- 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-UMSVZL34.js → chunk-7LKTKQLT.js} +1 -1
- package/dist/{chunk-YKQAIHRX.js → chunk-BA6XXQEM.js} +1 -1
- package/dist/{chunk-OXENAILQ.js → chunk-KCR7LC5R.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/SideNav/ListViewSideBar/components/MessageList.tsx +23 -3
- package/eventcatalog/src/components/SideNav/ListViewSideBar/utils.ts +1 -0
- package/eventcatalog/src/content.config.ts +6 -0
- package/eventcatalog/src/enterprise/ai-assistant/components/Chat.tsx +2 -2
- package/eventcatalog/src/enterprise/ai-assistant/components/ChatWindow.tsx +12 -6
- package/eventcatalog/src/pages/chat/index.astro +2 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/index.astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/index.astro +1 -1
- package/eventcatalog/src/pages/visualiser/[type]/[id]/index.astro +2 -2
- package/eventcatalog/src/utils/url-builder.ts +2 -2
- package/package.json +1 -1
- /package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/{OpenAPI.tsx → _OpenAPI.tsx} +0 -0
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
35
35
|
|
|
36
36
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
37
|
-
[](#contributors-)
|
|
38
38
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
39
39
|
|
|
40
40
|
[Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
|
|
@@ -259,6 +259,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
259
259
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Vertygo"><img src="https://avatars.githubusercontent.com/u/1658326?v=4?s=100" width="100px;" alt="Ivan Milosavljevic"/><br /><sub><b>Ivan Milosavljevic</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=Vertygo" title="Documentation">📖</a></td>
|
|
260
260
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Mezzle"><img src="https://avatars.githubusercontent.com/u/570639?v=4?s=100" width="100px;" alt="Martin Meredith"/><br /><sub><b>Martin Meredith</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=Mezzle" title="Code">💻</a></td>
|
|
261
261
|
</tr>
|
|
262
|
+
<tr>
|
|
263
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/ruudwelling/"><img src="https://avatars.githubusercontent.com/u/4014179?v=4?s=100" width="100px;" alt="Ruud Welling"/><br /><sub><b>Ruud Welling</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=WellingR" title="Code">💻</a></td>
|
|
264
|
+
</tr>
|
|
262
265
|
</tbody>
|
|
263
266
|
</table>
|
|
264
267
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BA6XXQEM.js";
|
|
4
|
+
import "../chunk-7LKTKQLT.js";
|
|
5
|
+
import "../chunk-KCR7LC5R.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.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
package/dist/eventcatalog.js
CHANGED
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
} from "./chunk-WUCY3QHK.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BA6XXQEM.js";
|
|
10
|
+
import "./chunk-7LKTKQLT.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro
|
|
13
13
|
} from "./chunk-R2NILSWL.js";
|
|
14
14
|
import {
|
|
15
15
|
VERSION
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KCR7LC5R.js";
|
|
17
17
|
import {
|
|
18
18
|
isBackstagePluginEnabled
|
|
19
19
|
} from "./chunk-XMDPVKIJ.js";
|
|
@@ -5,6 +5,26 @@ interface MessageListProps {
|
|
|
5
5
|
decodedCurrentPath: string;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
+
const getMessageColorByLabelOrCollection = (collection: string, badge?: string) => {
|
|
9
|
+
if (!badge) {
|
|
10
|
+
return getMessageColorByCollection(collection);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Will try and match the label against HTTP verbs
|
|
14
|
+
const httpVerbs = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'];
|
|
15
|
+
if (badge && httpVerbs.includes(badge.toUpperCase())) {
|
|
16
|
+
if (badge.toUpperCase() === 'GET') return 'bg-blue-50 text-blue-600';
|
|
17
|
+
if (badge.toUpperCase() === 'POST') return 'bg-green-50 text-green-600';
|
|
18
|
+
if (badge.toUpperCase() === 'PUT') return 'bg-yellow-50 text-yellow-600';
|
|
19
|
+
if (badge.toUpperCase() === 'DELETE') return 'bg-red-50 text-red-600';
|
|
20
|
+
if (badge.toUpperCase() === 'PATCH') return 'bg-purple-50 text-purple-600';
|
|
21
|
+
if (badge.toUpperCase() === 'HEAD') return 'bg-gray-50 text-gray-600';
|
|
22
|
+
if (badge.toUpperCase() === 'OPTIONS') return 'bg-orange-50 text-orange-600';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return getMessageColorByCollection(collection);
|
|
26
|
+
};
|
|
27
|
+
|
|
8
28
|
const MessageList: React.FC<MessageListProps> = ({ messages, decodedCurrentPath }) => (
|
|
9
29
|
<ul className="space-y-0.5 border-l border-gray-200/80 ml-[9px] pl-4">
|
|
10
30
|
{messages.map((message: any) => (
|
|
@@ -15,11 +35,11 @@ const MessageList: React.FC<MessageListProps> = ({ messages, decodedCurrentPath
|
|
|
15
35
|
decodedCurrentPath.includes(message.href) ? 'bg-purple-100 ' : 'hover:bg-purple-100'
|
|
16
36
|
}`}
|
|
17
37
|
>
|
|
18
|
-
<span className="truncate">{message.data.name}</span>
|
|
38
|
+
<span className="truncate">{message.data?.sidebar?.label || message.data.name}</span>
|
|
19
39
|
<span
|
|
20
|
-
className={`ml-2 text-[10px]
|
|
40
|
+
className={`ml-2 text-[10px] flex items-center gap-1 font-medium px-2 uppercase py-0.5 rounded ${getMessageColorByLabelOrCollection(message.collection, message.data?.sidebar?.badge)}`}
|
|
21
41
|
>
|
|
22
|
-
{getMessageCollectionName(message.collection)}
|
|
42
|
+
{message.data?.sidebar?.badge || getMessageCollectionName(message.collection)}
|
|
23
43
|
</span>
|
|
24
44
|
</a>
|
|
25
45
|
</li>
|
|
@@ -68,6 +68,7 @@ export async function getResourcesForNavigation({ currentPath }: { currentPath:
|
|
|
68
68
|
sends: sendsWithHref,
|
|
69
69
|
receives: receivesWithHref,
|
|
70
70
|
specifications: item.collection === 'services' ? item.data.specifications : null,
|
|
71
|
+
sidebar: item.data?.sidebar,
|
|
71
72
|
};
|
|
72
73
|
|
|
73
74
|
group.push(navigationItem);
|
|
@@ -73,6 +73,12 @@ const baseSchema = z.object({
|
|
|
73
73
|
badges: z.array(badge).optional(),
|
|
74
74
|
owners: z.array(ownerReference).optional(),
|
|
75
75
|
schemaPath: z.string().optional(),
|
|
76
|
+
sidebar: z
|
|
77
|
+
.object({
|
|
78
|
+
label: z.string().optional(),
|
|
79
|
+
badge: z.string().optional(),
|
|
80
|
+
})
|
|
81
|
+
.optional(),
|
|
76
82
|
repository: z
|
|
77
83
|
.object({
|
|
78
84
|
language: z.string().optional(),
|
|
@@ -2,12 +2,12 @@ import Sidebar from './ChatSidebar';
|
|
|
2
2
|
import { ChatProvider } from './hooks/ChatProvider';
|
|
3
3
|
import ChatWindow from './ChatWindow';
|
|
4
4
|
|
|
5
|
-
const Chat = () => {
|
|
5
|
+
const Chat = ({ chatConfig }: { chatConfig: any }) => {
|
|
6
6
|
return (
|
|
7
7
|
<ChatProvider>
|
|
8
8
|
<div className="flex overflow-hidden w-full">
|
|
9
9
|
<Sidebar />
|
|
10
|
-
<ChatWindow />
|
|
10
|
+
<ChatWindow {...chatConfig} />
|
|
11
11
|
</div>
|
|
12
12
|
</ChatProvider>
|
|
13
13
|
);
|
|
@@ -2,7 +2,6 @@ import { useEffect, useState, useRef, useCallback, useMemo } from 'react';
|
|
|
2
2
|
import { BookOpen, Send } from 'lucide-react';
|
|
3
3
|
import { CreateWebWorkerMLCEngine, type InitProgressReport } from '@mlc-ai/web-llm';
|
|
4
4
|
import { useChat, type Message } from './hooks/ChatProvider';
|
|
5
|
-
import config from '@config';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
|
|
8
7
|
// Update Message type to include resources
|
|
@@ -102,7 +101,17 @@ const ChatMessage = React.memo(({ message }: { message: Message }) => (
|
|
|
102
101
|
|
|
103
102
|
ChatMessage.displayName = 'ChatMessage';
|
|
104
103
|
|
|
105
|
-
|
|
104
|
+
interface ChatWindowProps {
|
|
105
|
+
model?: string;
|
|
106
|
+
max_tokens?: number;
|
|
107
|
+
similarityResults?: number;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const ChatWindow = ({
|
|
111
|
+
model = 'Hermes-3-Llama-3.2-3B-q4f16_1-MLC',
|
|
112
|
+
max_tokens = 4096,
|
|
113
|
+
similarityResults = 50,
|
|
114
|
+
}: ChatWindowProps) => {
|
|
106
115
|
const [loading, setLoading] = useState(true);
|
|
107
116
|
const [loadingProgress, setLoadingProgress] = useState(0);
|
|
108
117
|
const [engine, setEngine] = useState<any>(null);
|
|
@@ -114,10 +123,7 @@ const ChatWindow = () => {
|
|
|
114
123
|
const completionRef = useRef<any>(null);
|
|
115
124
|
const outputRef = useRef<HTMLDivElement>(null);
|
|
116
125
|
|
|
117
|
-
|
|
118
|
-
const model = config.chat?.model || 'Hermes-3-Llama-3.2-3B-q4f16_1-MLC';
|
|
119
|
-
const max_tokens = config.chat?.max_tokens || 4096;
|
|
120
|
-
const similarityResults = config.chat?.similarityResults || 50;
|
|
126
|
+
console.log('model', model);
|
|
121
127
|
|
|
122
128
|
const { currentSession, storeMessagesToSession, updateSession, isStreaming, setIsStreaming } = useChat();
|
|
123
129
|
|
|
@@ -8,6 +8,7 @@ import fs from 'node:fs';
|
|
|
8
8
|
import { Code } from 'astro-expressive-code/components';
|
|
9
9
|
|
|
10
10
|
const isEnabled = config.chat?.enabled || false;
|
|
11
|
+
const chatConfig = config.chat || {};
|
|
11
12
|
|
|
12
13
|
const PROJECT_DIR = path.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
13
14
|
const GENERATED_AI_DIR = path.resolve(PROJECT_DIR, 'public/ai');
|
|
@@ -46,7 +47,7 @@ const generatorConfig = `
|
|
|
46
47
|
</div>
|
|
47
48
|
</div>
|
|
48
49
|
<div id="chatContainer" class="w-full">
|
|
49
|
-
<Chat client:only="react" />
|
|
50
|
+
<Chat client:only="react" chatConfig={chatConfig} />
|
|
50
51
|
</div>
|
|
51
52
|
</>
|
|
52
53
|
) : (
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { CollectionEntry } from 'astro:content';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import fs from 'node:fs';
|
|
5
|
-
import OpenAPISpec from './
|
|
5
|
+
import OpenAPISpec from './_OpenAPI.tsx';
|
|
6
6
|
|
|
7
7
|
import type { CollectionTypes, PageTypes } from '@types';
|
|
8
8
|
import { DocumentMinusIcon } from '@heroicons/react/24/outline';
|
|
@@ -44,7 +44,7 @@ const props = Astro.props;
|
|
|
44
44
|
const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c) => c.toUpperCase());
|
|
45
45
|
|
|
46
46
|
const { pathname } = Astro.url;
|
|
47
|
-
const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
|
|
47
|
+
const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion, false, true);
|
|
48
48
|
---
|
|
49
49
|
|
|
50
50
|
<!doctype html>
|
|
@@ -32,8 +32,7 @@ const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c)
|
|
|
32
32
|
|
|
33
33
|
const { pathname } = Astro.url;
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
|
|
35
|
+
const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion, false, true);
|
|
37
36
|
---
|
|
38
37
|
|
|
39
38
|
<!doctype html>
|
|
@@ -48,6 +47,7 @@ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
|
|
|
48
47
|
|
|
49
48
|
<script define:vars={{ redirectUrl }}>
|
|
50
49
|
document.addEventListener('DOMContentLoaded', () => {
|
|
50
|
+
// redirect with any search params too
|
|
51
51
|
const searchParams = window.location.search;
|
|
52
52
|
const fullRedirectUrl = redirectUrl + searchParams;
|
|
53
53
|
window.location.href = fullRedirectUrl;
|
|
@@ -3,14 +3,14 @@ const cleanUrl = (url: string) => {
|
|
|
3
3
|
};
|
|
4
4
|
|
|
5
5
|
// Custom URL builder as Astro does not support this stuff out the box
|
|
6
|
-
export const buildUrl = (url: string, ignoreTrailingSlash = false) => {
|
|
6
|
+
export const buildUrl = (url: string, ignoreTrailingSlash = false, urlAlreadyIncludesBaseUrl = false) => {
|
|
7
7
|
// Should a trailingSlash be added to urls?
|
|
8
8
|
const trailingSlash = __EC_TRAILING_SLASH__;
|
|
9
9
|
|
|
10
10
|
let newUrl = url;
|
|
11
11
|
|
|
12
12
|
// If the base URL is not the root, we need to append it
|
|
13
|
-
if (import.meta.env.BASE_URL !== '/') {
|
|
13
|
+
if (import.meta.env.BASE_URL !== '/' && !urlAlreadyIncludesBaseUrl) {
|
|
14
14
|
newUrl = `${import.meta.env.BASE_URL}${url}`;
|
|
15
15
|
}
|
|
16
16
|
|
package/package.json
CHANGED
/package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/{OpenAPI.tsx → _OpenAPI.tsx}
RENAMED
|
File without changes
|