@eventcatalog/core 4.10.11 → 4.10.13

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.
Files changed (48) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-N6U5CNT7.js → chunk-34RMFKFB.js} +1 -1
  6. package/dist/{chunk-TWZKZIRW.js → chunk-IIECZFXN.js} +1 -1
  7. package/dist/{chunk-RLGMIZSH.js → chunk-JHUICVBT.js} +1 -1
  8. package/dist/{chunk-3XTFNVGA.js → chunk-PADMH2RJ.js} +1 -1
  9. package/dist/{chunk-VFRR3M72.js → chunk-SSSN5FXC.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +1 -1
  13. package/dist/eventcatalog.config.d.cts +9 -0
  14. package/dist/eventcatalog.config.d.ts +9 -0
  15. package/dist/eventcatalog.js +5 -5
  16. package/dist/generate.cjs +1 -1
  17. package/dist/generate.js +3 -3
  18. package/dist/utils/cli-logger.cjs +1 -1
  19. package/dist/utils/cli-logger.js +2 -2
  20. package/eventcatalog/astro.config.mjs +2 -0
  21. package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +208 -119
  22. package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +28 -8
  23. package/eventcatalog/src/components/ChatPanel/OfflineReply.tsx +45 -0
  24. package/eventcatalog/src/components/Header.astro +11 -6
  25. package/eventcatalog/src/components/MDX/Design/Design.astro +2 -2
  26. package/eventcatalog/src/components/MDX/EntityMap/EntityMap.astro +2 -2
  27. package/eventcatalog/src/components/MDX/Flow/Flow.astro +2 -2
  28. package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.astro +2 -2
  29. package/eventcatalog/src/components/MDX/ResourceRef/ResourceRef.astro +22 -40
  30. package/eventcatalog/src/components/Search/Search.astro +11 -4
  31. package/eventcatalog/src/components/Settings/AssistantSettingsForm.tsx +29 -24
  32. package/eventcatalog/src/content.config.ts +1 -1
  33. package/eventcatalog/src/enterprise/custom-documentation/pages/docs/custom/index.astro +3 -3
  34. package/eventcatalog/src/pages/diagrams/[id]/[version]/index.astro +2 -2
  35. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +5 -3
  36. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +10 -4
  37. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +2 -2
  38. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +3 -3
  39. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +2 -2
  40. package/eventcatalog/src/pages/visualiser/designs/[id]/index.astro +2 -2
  41. package/eventcatalog/src/plugins/link-validation.ts +42 -0
  42. package/eventcatalog/src/utils/collections/glob-loader.spec.ts +69 -2
  43. package/eventcatalog/src/utils/collections/glob-loader.ts +5 -3
  44. package/eventcatalog/src/utils/collections/schema-loader.ts +1 -1
  45. package/eventcatalog/src/utils/feature.ts +1 -0
  46. package/eventcatalog/src/utils/link-validation.ts +224 -0
  47. package/eventcatalog/src/utils/resource-reference-links.ts +29 -0
  48. package/package.json +5 -4
@@ -0,0 +1,42 @@
1
+ import type { AstroConfig, AstroIntegration } from 'astro';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { formatBrokenLinks, validateBuiltLinks, type LinkValidationOptions } from '../utils/link-validation';
4
+
5
+ export const linkValidation = (options: LinkValidationOptions | false = {}): AstroIntegration => {
6
+ let config: AstroConfig;
7
+ let serverOutput = false;
8
+ return {
9
+ name: 'eventcatalog:link-validation',
10
+ hooks: {
11
+ 'astro:config:done': ({ config: resolvedConfig, buildOutput }) => {
12
+ config = resolvedConfig;
13
+ serverOutput = buildOutput === 'server';
14
+ },
15
+ 'astro:build:done': async ({ dir, logger }) => {
16
+ if (options === false || (options.onBrokenLinks === 'ignore' && options.onBrokenAnchors === 'ignore')) return;
17
+ if (serverOutput) {
18
+ logger.info('Link validation skipped: only static catalog builds are supported.');
19
+ return;
20
+ }
21
+ const start = performance.now();
22
+ const { pages, diagnostics } = await validateBuiltLinks({
23
+ ...options,
24
+ outDir: fileURLToPath(dir),
25
+ base: config.base,
26
+ site: config.site,
27
+ format: config.build.format,
28
+ trailingSlash: config.trailingSlash,
29
+ });
30
+ const errors = diagnostics.filter((diagnostic) =>
31
+ diagnostic.kind === 'link' ? options.onBrokenLinks === 'error' : options.onBrokenAnchors === 'error'
32
+ );
33
+ const warnings = diagnostics.filter((diagnostic) =>
34
+ diagnostic.kind === 'link' ? options.onBrokenLinks !== 'error' : options.onBrokenAnchors !== 'error'
35
+ );
36
+ if (warnings.length > 0) logger.warn(formatBrokenLinks(warnings));
37
+ if (errors.length > 0) throw new Error(`Link validation failed.\n${formatBrokenLinks(errors)}`);
38
+ logger.info(`Checked links in ${pages} HTML page(s) in ${((performance.now() - start) / 1000).toFixed(2)}s.`);
39
+ },
40
+ },
41
+ };
42
+ };
@@ -1,6 +1,73 @@
1
1
  import picomatch from 'picomatch';
2
- import { describe, expect, it } from 'vitest';
3
- import { withFederatedContent } from './glob-loader';
2
+ import { afterEach, describe, expect, it, vi } from 'vitest';
3
+ import { mkdtemp, mkdir, writeFile, symlink, rm } from 'node:fs/promises';
4
+ import { tmpdir } from 'node:os';
5
+ import path from 'node:path';
6
+ import { pathToFileURL } from 'node:url';
7
+ import { globWithSafeWatcher, withFederatedContent, withIgnoredBuildArtifacts } from './glob-loader';
8
+
9
+ describe('catalog discovery', () => {
10
+ const directories: string[] = [];
11
+
12
+ afterEach(async () => {
13
+ vi.unstubAllEnvs();
14
+ await Promise.all(directories.splice(0).map((directory) => rm(directory, { recursive: true, force: true })));
15
+ });
16
+
17
+ it.each([undefined, 'false', 'true'])('excludes dependency catalogs when IGNORE_BUILD_ARTIFACTS is %s', async (flag) => {
18
+ vi.stubEnv('IGNORE_BUILD_ARTIFACTS', flag);
19
+ const root = await mkdtemp(path.join(tmpdir(), 'catalog-discovery-'));
20
+ directories.push(root);
21
+ const catalog = path.join(root, 'catalog');
22
+ const resources = [
23
+ 'events/OrderConfirmed/index.md',
24
+ 'domains/Orders/services/Inventory/events/Adjusted/versioned/1.0.0/index.mdx',
25
+ 'federated/orders/events/OrderConfirmed/index.mdx',
26
+ ];
27
+ const dependencies = [
28
+ 'node_modules/core/src/__tests__/events/OrderConfirmed/index.md',
29
+ 'node_modules/core/node_modules/sdk/events/OrderConfirmed/index.mdx',
30
+ 'federated/orders/node_modules/sdk/events/OrderConfirmed/index.md',
31
+ ];
32
+ for (const entry of [...resources, ...dependencies]) {
33
+ const file = path.join(catalog, entry);
34
+ await mkdir(path.dirname(file), { recursive: true });
35
+ await writeFile(file, entry);
36
+ }
37
+ // Workspace dependencies are often symlinked outside the catalog.
38
+ const linkedPackage = path.join(root, 'linked-package');
39
+ await mkdir(path.join(linkedPackage, 'events/OrderConfirmed'), { recursive: true });
40
+ await writeFile(path.join(linkedPackage, 'events/OrderConfirmed/index.md'), 'dependency');
41
+ await symlink(linkedPackage, path.join(catalog, 'node_modules/linked'));
42
+
43
+ const loaded = new Map();
44
+ const logger = { warn: vi.fn(), error: vi.fn() };
45
+ const base = pathToFileURL(`${catalog}/`);
46
+ const loader = globWithSafeWatcher({
47
+ pattern: withIgnoredBuildArtifacts('**/events/**/index.(md|mdx)'),
48
+ base,
49
+ generateId: ({ entry }) => entry,
50
+ });
51
+ await loader.load({
52
+ config: { root: base, srcDir: new URL('src/', base) },
53
+ collection: 'events',
54
+ logger,
55
+ store: {
56
+ keys: () => loaded.keys(),
57
+ get: (id: string) => loaded.get(id),
58
+ set: (entry: { id: string }) => loaded.set(entry.id, entry),
59
+ delete: (id: string) => loaded.delete(id),
60
+ },
61
+ parseData: async ({ data }: { data: unknown }) => data,
62
+ generateDigest: (contents: string) => contents,
63
+ entryTypes: new Map(['.md', '.mdx'].map((ext) => [ext, { getEntryInfo: () => ({ data: {}, body: '' }) }])),
64
+ } as unknown as Parameters<typeof loader.load>[0]);
65
+
66
+ expect([...loaded.keys()].sort()).toEqual(resources.sort());
67
+ expect(logger.warn).not.toHaveBeenCalled();
68
+ expect(logger.error).not.toHaveBeenCalled();
69
+ });
70
+ });
4
71
 
5
72
  describe('withFederatedContent', () => {
6
73
  it('loads root catalog content from every federated source directory', () => {
@@ -6,11 +6,13 @@ import { fileURLToPath } from 'url';
6
6
  export type GlobOptions = Parameters<typeof glob>[0];
7
7
 
8
8
  export const withIgnoredBuildArtifacts = (patterns: string | string[]) => {
9
+ // Dependencies can contain entire example catalogs, including duplicate resource IDs.
10
+ // Exclude them in every mode, including astro check and the development watcher.
11
+ const ignoredArtifacts = ['!**/node_modules/**'];
9
12
  if (process.env.IGNORE_BUILD_ARTIFACTS === 'true') {
10
- const ignoredArtifacts = ['!dist/**', '!**/dist/**'];
11
- return Array.isArray(patterns) ? [...patterns, ...ignoredArtifacts] : [patterns, ...ignoredArtifacts];
13
+ ignoredArtifacts.push('!dist/**', '!**/dist/**');
12
14
  }
13
- return patterns;
15
+ return [...(Array.isArray(patterns) ? patterns : [patterns]), ...ignoredArtifacts];
14
16
  };
15
17
 
16
18
  const toPatterns = (patterns: string | string[]) => (Array.isArray(patterns) ? patterns : [patterns]);
@@ -450,7 +450,7 @@ const loadMessageSchemaResources = async ({ pattern, base }: SchemaLoaderOptions
450
450
  cwd: base,
451
451
  absolute: true,
452
452
  nodir: true,
453
- ignore: ['dist/**', '**/dist/**'],
453
+ ignore: ['dist/**', '**/dist/**', '**/node_modules/**'],
454
454
  });
455
455
 
456
456
  const schemas = await Promise.all(
@@ -1,6 +1,7 @@
1
1
  import config from '../../eventcatalog.config.js';
2
2
 
3
3
  // Open-source feature flags
4
+ export const isEventCatalogChatVisible = () => config?.chat?.enabled ?? true;
4
5
  export const isSSR = () => config?.output === 'server';
5
6
  export const isVisualiserEnabled = () => config?.visualiser?.enabled ?? true;
6
7
  // Opt-in while in beta — building the whole-catalog graph is unproven on very large catalogs
@@ -0,0 +1,224 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+ import { parse, type DefaultTreeAdapterMap } from 'parse5';
4
+ import picomatch from 'picomatch';
5
+
6
+ export type LinkValidationSeverity = 'warn' | 'error' | 'ignore';
7
+
8
+ export interface LinkValidationOptions {
9
+ onBrokenLinks?: LinkValidationSeverity;
10
+ onBrokenAnchors?: LinkValidationSeverity;
11
+ ignore?: string[];
12
+ }
13
+
14
+ export interface BrokenLink {
15
+ kind: 'link' | 'anchor';
16
+ source: string;
17
+ destination: string;
18
+ suggestion?: string;
19
+ }
20
+
21
+ interface PageLinks {
22
+ source: string;
23
+ baseHref?: string;
24
+ anchors: Set<string>;
25
+ links: Set<string>;
26
+ }
27
+
28
+ interface ValidateLinksOptions extends LinkValidationOptions {
29
+ outDir: string;
30
+ base?: string;
31
+ site?: string;
32
+ format?: 'directory' | 'file' | 'preserve';
33
+ trailingSlash?: 'always' | 'never' | 'ignore';
34
+ }
35
+
36
+ const decodeUrlPart = (value: string): string => {
37
+ try {
38
+ return decodeURIComponent(value);
39
+ } catch {
40
+ // A literal malformed percent escape can still be an HTML id or filename.
41
+ return value;
42
+ }
43
+ };
44
+
45
+ // Parse HTML rather than searching markup with a regex: attributes can contain
46
+ // entities, quoted > characters, or single/unquoted values. Scripts and inert
47
+ // template contents must not be mistaken for rendered links or anchor targets.
48
+ const readPage = (html: string, source: string): PageLinks => {
49
+ const page: PageLinks = { source, anchors: new Set(), links: new Set() };
50
+ const nodes: DefaultTreeAdapterMap['node'][] = [parse(html)];
51
+ while (nodes.length > 0) {
52
+ const node = nodes.pop()!;
53
+ if ('tagName' in node) {
54
+ const attrs = new Map(node.attrs.map((attr) => [attr.name, attr.value]));
55
+ const id = attrs.get('id');
56
+ if (id) page.anchors.add(id);
57
+ if (node.tagName === 'a' && attrs.get('name')) page.anchors.add(attrs.get('name')!);
58
+ const href = attrs.get('href');
59
+ if (href !== undefined) {
60
+ if (node.tagName === 'base' && page.baseHref === undefined) page.baseHref = href;
61
+ if (node.tagName === 'a' || node.tagName === 'area') page.links.add(href);
62
+ }
63
+ }
64
+ // Reverse the stack so the first <base href> wins in document order.
65
+ if ('childNodes' in node) {
66
+ for (let i = node.childNodes.length - 1; i >= 0; i--) nodes.push(node.childNodes[i]);
67
+ }
68
+ }
69
+ return page;
70
+ };
71
+
72
+ const listFiles = async (root: string, relative = '', files = new Set<string>()): Promise<Set<string>> => {
73
+ for (const entry of await fs.readdir(path.join(root, relative), { withFileTypes: true })) {
74
+ const file = path.posix.join(relative, entry.name);
75
+ if (entry.isDirectory()) await listFiles(root, file, files);
76
+ else if (entry.isFile()) files.add(file);
77
+ }
78
+ return files;
79
+ };
80
+
81
+ const readNavigationLinks = (value: unknown, links: Set<string>) => {
82
+ if (!value || typeof value !== 'object') return;
83
+ for (const [key, child] of Object.entries(value)) {
84
+ if (key === 'href' && typeof child === 'string') links.add(child);
85
+ else if (child && typeof child === 'object') readNavigationLinks(child, links);
86
+ }
87
+ };
88
+
89
+ export const validateBuiltLinks = async ({
90
+ outDir,
91
+ base = '/',
92
+ site,
93
+ format = 'directory',
94
+ trailingSlash = 'ignore',
95
+ onBrokenLinks = 'warn',
96
+ onBrokenAnchors = 'warn',
97
+ ignore = [],
98
+ }: ValidateLinksOptions): Promise<{ pages: number; diagnostics: BrokenLink[] }> => {
99
+ if (onBrokenLinks === 'ignore' && onBrokenAnchors === 'ignore') return { pages: 0, diagnostics: [] };
100
+
101
+ const origin = site ? new URL(site).origin : 'https://eventcatalog.invalid';
102
+ const prefix = new URL(`/${base.replace(/^\/+|\/+$/g, '')}`, origin).pathname.replace(/\/$/, '');
103
+ const withBase = (route: string) => `${prefix}${route}`;
104
+ const files = await listFiles(outDir);
105
+ const pages = new Map<string, PageLinks>();
106
+ const ignored = ignore.map((pattern) => picomatch(pattern, { dot: true }));
107
+
108
+ for (const file of [...files].sort()) {
109
+ if (!file.endsWith('.html')) continue;
110
+ let route = `/${file}`;
111
+ if (file === 'index.html') route = '/';
112
+ else if (file.endsWith('/index.html')) route = route.slice(0, -'index.html'.length);
113
+ else if (format !== 'directory') route = route.slice(0, -'.html'.length);
114
+ if (route !== '/' && trailingSlash === 'never') route = route.replace(/\/$/, '');
115
+ else if (format === 'file' && trailingSlash === 'always' && !route.endsWith('/')) route += '/';
116
+ // Encode path segments, not slashes, to handle spaces, # and Unicode in filenames.
117
+ const source = withBase(route.split('/').map(encodeURIComponent).join('/'));
118
+ pages.set(file, readPage(await fs.readFile(path.join(outDir, file), 'utf8'), source));
119
+ }
120
+
121
+ const sources = [...pages.values()];
122
+ // This is also used by client-only navigation, so its links aren't necessarily
123
+ // present as <a> elements in any generated HTML page.
124
+ if (files.has('api/sidebar-data.json')) {
125
+ const links = new Set<string>();
126
+ readNavigationLinks(JSON.parse(await fs.readFile(path.join(outDir, 'api/sidebar-data.json'), 'utf8')), links);
127
+ sources.push({
128
+ source: withBase('/api/sidebar-data.json'),
129
+ baseHref: withBase('/'),
130
+ anchors: new Set(),
131
+ links,
132
+ });
133
+ }
134
+
135
+ const findFile = (pathname: string): string | undefined => {
136
+ const relative = pathname.replace(/^\/+/, '');
137
+ if (files.has(relative)) return relative;
138
+ const index = path.posix.join(relative, 'index.html');
139
+ if (files.has(index)) return index;
140
+ const html = `${relative.replace(/\/$/, '')}.html`;
141
+ if (format !== 'directory' && files.has(html)) return html;
142
+ return undefined;
143
+ };
144
+
145
+ const diagnostics: BrokenLink[] = [];
146
+ for (const page of sources) {
147
+ const sourceUrl = new URL(page.source, origin);
148
+ let documentBase = sourceUrl;
149
+ try {
150
+ if (page.baseHref !== undefined) documentBase = new URL(page.baseHref, sourceUrl);
151
+ } catch {
152
+ // Browsers ignore an invalid base URL and use the document URL instead.
153
+ }
154
+ const seen = new Set<string>();
155
+ for (const href of page.links) {
156
+ let target: URL;
157
+ try {
158
+ target = new URL(href, documentBase);
159
+ } catch {
160
+ if (onBrokenLinks !== 'ignore') diagnostics.push({ kind: 'link', source: page.source, destination: href });
161
+ continue;
162
+ }
163
+ if (!['http:', 'https:'].includes(target.protocol) || target.origin !== origin) continue;
164
+ if (prefix && target.pathname !== prefix && !target.pathname.startsWith(`${prefix}/`)) continue;
165
+ const pathname = target.pathname.slice(prefix.length) || '/';
166
+ // Ignore patterns use paths relative to the catalog base, never filesystem paths.
167
+ if (ignored.some((matches) => matches(pathname))) continue;
168
+ const destination = target.pathname + target.hash;
169
+ if (seen.has(destination)) continue;
170
+ seen.add(destination);
171
+
172
+ const decodedPath = decodeUrlPart(pathname);
173
+ const anchor = decodeUrlPart(target.hash.slice(1).split(':~:')[0]);
174
+ const file = findFile(decodedPath);
175
+ if (!file) {
176
+ if (onBrokenLinks === 'ignore') continue;
177
+ // Give a precise suggestion for the common resource-type mixups, but
178
+ // only if the suggested destination actually exists in this build.
179
+ const alternatives = /^\/docs\/(users|teams)\//.test(decodedPath)
180
+ ? ['users', 'teams']
181
+ : /^\/docs\/(events|commands|queries)\//.test(decodedPath)
182
+ ? ['events', 'commands', 'queries']
183
+ : [];
184
+ const suggestion = alternatives
185
+ .map((collection) => decodedPath.replace(/^\/docs\/[^/]+\//, `/docs/${collection}/`))
186
+ .find((route) => findFile(route));
187
+ diagnostics.push({
188
+ kind: 'link',
189
+ source: page.source,
190
+ destination,
191
+ ...(suggestion ? { suggestion: withBase(suggestion) } : {}),
192
+ });
193
+ } else if (onBrokenAnchors !== 'ignore' && anchor && anchor.toLowerCase() !== 'top') {
194
+ const targetPage = pages.get(file);
195
+ // Fragments in PDFs/SVGs and other non-HTML assets have different semantics.
196
+ if (targetPage && !targetPage.anchors.has(anchor)) {
197
+ diagnostics.push({ kind: 'anchor', source: page.source, destination });
198
+ }
199
+ }
200
+ }
201
+ }
202
+ return {
203
+ pages: pages.size,
204
+ diagnostics: diagnostics.sort((a, b) => a.destination.localeCompare(b.destination) || a.source.localeCompare(b.source)),
205
+ };
206
+ };
207
+
208
+ export const formatBrokenLinks = (diagnostics: BrokenLink[]): string => {
209
+ const groups = new Map<string, { diagnostic: BrokenLink; sources: Set<string> }>();
210
+ for (const diagnostic of diagnostics) {
211
+ const key = `${diagnostic.kind}:${diagnostic.destination}`;
212
+ const group = groups.get(key) ?? { diagnostic, sources: new Set<string>() };
213
+ group.sources.add(diagnostic.source);
214
+ groups.set(key, group);
215
+ }
216
+ const lines = [`Found ${groups.size} broken link/anchor destination(s) in ${diagnostics.length} page reference(s).`];
217
+ for (const { diagnostic, sources } of groups.values()) {
218
+ lines.push(`\nBroken ${diagnostic.kind}: ${diagnostic.destination}`);
219
+ for (const source of [...sources].slice(0, 5)) lines.push(` From: ${source}`);
220
+ if (sources.size > 5) lines.push(` ...and ${sources.size - 5} more source(s)`);
221
+ if (diagnostic.suggestion) lines.push(` Possible destination: ${diagnostic.suggestion}`);
222
+ }
223
+ return lines.join('\n');
224
+ };
@@ -0,0 +1,29 @@
1
+ import { getCollection } from 'astro:content';
2
+ import { getItemsFromCollectionByIdAndSemverOrLatest, sortVersioned } from './collections/util';
3
+ import { buildUrl } from './url-builder';
4
+
5
+ export const isVersionedReference = (collection: string) => !['users', 'teams', 'customPages'].includes(collection);
6
+
7
+ export const getResourceReferenceUrl = (collection: string, id: string, version?: string) => {
8
+ if (!isVersionedReference(collection)) return buildUrl(`/docs/${collection}/${id}`);
9
+ return buildUrl(`${collection === 'diagrams' ? '/diagrams' : `/docs/${collection}`}/${id}/${version}`);
10
+ };
11
+
12
+ export const resolveMessageReference = async (message: { id: string; version?: string }) => {
13
+ for (const collection of ['events', 'commands', 'queries'] as const) {
14
+ const items = await getCollection(collection);
15
+ const matches = getItemsFromCollectionByIdAndSemverOrLatest(items, message.id, message.version);
16
+ const [resource] = sortVersioned(matches, (item) => item.data.version);
17
+ if (resource) return { version: resource.data.version, collection };
18
+ }
19
+ return { version: null, collection: null };
20
+ };
21
+
22
+ export const resolveOwnerReference = async (owner: string | { id: string }) => {
23
+ const id = typeof owner === 'string' ? owner : owner.id;
24
+ for (const collection of ['users', 'teams'] as const) {
25
+ const items = await getCollection(collection);
26
+ if (items.some((item) => item.data.id === id)) return { id, href: getResourceReferenceUrl(collection, id) };
27
+ }
28
+ return { id, href: null };
29
+ };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "type": "module",
10
- "version": "4.10.11",
10
+ "version": "4.10.13",
11
11
  "publishConfig": {
12
12
  "access": "public"
13
13
  },
@@ -94,6 +94,7 @@
94
94
  "nanostores": "^1.1.0",
95
95
  "pagefind": "^1.5.2",
96
96
  "pako": "^2.1.0",
97
+ "parse5": "^7.3.0",
97
98
  "picocolors": "^1.1.1",
98
99
  "picomatch": "^4.0.4",
99
100
  "react": "^18.3.1",
@@ -118,9 +119,9 @@
118
119
  "update-notifier": "^7.3.1",
119
120
  "uuid": "^11.1.1",
120
121
  "zod": "^4.3.6",
121
- "@eventcatalog/linter": "1.1.18",
122
- "@eventcatalog/sdk": "2.29.0",
123
- "@eventcatalog/visualiser": "^4.1.4"
122
+ "@eventcatalog/linter": "1.1.19",
123
+ "@eventcatalog/visualiser": "^4.1.4",
124
+ "@eventcatalog/sdk": "2.29.0"
124
125
  },
125
126
  "devDependencies": {
126
127
  "@astrojs/check": "^0.9.10",