@eventcatalog/core 2.42.6 → 2.42.7

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 CHANGED
@@ -101,7 +101,7 @@ You can read more on [how it works on GitHub](https://github.com/event-catalog/e
101
101
 
102
102
  You should be able to get setup within minutes if you head over to our documentation to get started 👇
103
103
 
104
- ➡️ [Get Started](https://eventcatalog-website-v2.vercel.app/docs/development/getting-started/installation)
104
+ ➡️ [Get Started](https://www.eventcatalog.dev/docs/development/getting-started/installation)
105
105
 
106
106
  Or run this command to build a new catalog
107
107
 
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.42.6";
40
+ var version = "2.42.7";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-R2ESPFL6.js";
4
- import "../chunk-ZDLD4Z6H.js";
3
+ } from "../chunk-774S2HDO.js";
4
+ import "../chunk-AIFALM4J.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.42.6";
109
+ var version = "2.42.7";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-FRAHATZL.js";
4
- import "../chunk-R2ESPFL6.js";
5
- import "../chunk-ZDLD4Z6H.js";
3
+ } from "../chunk-3HMUTETN.js";
4
+ import "../chunk-774S2HDO.js";
5
+ import "../chunk-AIFALM4J.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-R2ESPFL6.js";
3
+ } from "./chunk-774S2HDO.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-ZDLD4Z6H.js";
3
+ } from "./chunk-AIFALM4J.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.42.6";
2
+ var version = "2.42.7";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.42.6";
28
+ var version = "2.42.7";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-ZDLD4Z6H.js";
3
+ } from "./chunk-AIFALM4J.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
157
157
  var import_os = __toESM(require("os"), 1);
158
158
 
159
159
  // package.json
160
- var version = "2.42.6";
160
+ var version = "2.42.7";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-DCLTVJDP.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-FRAHATZL.js";
10
- import "./chunk-R2ESPFL6.js";
9
+ } from "./chunk-3HMUTETN.js";
10
+ import "./chunk-774S2HDO.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
14
14
  } from "./chunk-SLEMYHTU.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-ZDLD4Z6H.js";
17
+ } from "./chunk-AIFALM4J.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogScaleEnabled,
@@ -387,7 +387,7 @@ const channels = defineCollection({
387
387
 
388
388
  const ubiquitousLanguages = defineCollection({
389
389
  loader: glob({
390
- pattern: ['domains/*/ubiquitous-language.(md|mdx)'],
390
+ pattern: ['domains/*/ubiquitous-language.(md|mdx)', 'domains/*/subdomains/*/ubiquitous-language.(md|mdx)'],
391
391
  base: projectDirBase,
392
392
  generateId: ({ data }) => {
393
393
  // File has no id, so we need to generate one
@@ -0,0 +1,42 @@
1
+ import { getDomains, getUbiquitousLanguage } from '@utils/collections/domains';
2
+ import type { CollectionEntry } from 'astro:content';
3
+ import type { APIRoute } from 'astro';
4
+ import config from '@config';
5
+ import fs from 'fs';
6
+
7
+ export async function getStaticPaths() {
8
+ const domains = await getDomains({ getAllVersions: false });
9
+
10
+ const buildPages = (collection: CollectionEntry<'domains'>[]) => {
11
+ return collection.map((item) => ({
12
+ params: {
13
+ type: item.collection,
14
+ id: item.data.id,
15
+ },
16
+ props: {
17
+ type: item.collection,
18
+ ...item,
19
+ },
20
+ }));
21
+ };
22
+
23
+ return [...buildPages(domains)];
24
+ }
25
+
26
+ export const GET: APIRoute = async ({ params, props }) => {
27
+ // Just return empty array if LLMs are not enabled
28
+ if (!config.llmsTxt?.enabled) {
29
+ return new Response('llms.txt is not enabled for this Catalog.', { status: 404 });
30
+ }
31
+
32
+ const ubiquitousLanguages = await getUbiquitousLanguage(props);
33
+ const ubiquitousLanguage = ubiquitousLanguages[0];
34
+
35
+ if (ubiquitousLanguage?.filePath) {
36
+ let file = fs.readFileSync(ubiquitousLanguage.filePath, 'utf8');
37
+
38
+ return new Response(file, { status: 200 });
39
+ }
40
+
41
+ return new Response('Not found', { status: 404 });
42
+ };
@@ -5,7 +5,18 @@ import fs from 'fs';
5
5
  import { isCustomDocsEnabled } from '@utils/feature';
6
6
  import { addSchemaToMarkdown } from '@utils/llms';
7
7
 
8
- type AllowedCollections = 'events' | 'commands' | 'queries' | 'services' | 'domains' | 'teams' | 'users' | 'customPages';
8
+ type AllowedCollections =
9
+ | 'events'
10
+ | 'commands'
11
+ | 'queries'
12
+ | 'services'
13
+ | 'domains'
14
+ | 'teams'
15
+ | 'users'
16
+ | 'customPages'
17
+ | 'channels'
18
+ | 'entities'
19
+ | 'flows';
9
20
 
10
21
  const events = await getCollection('events');
11
22
  const commands = await getCollection('commands');
@@ -14,6 +25,9 @@ const services = await getCollection('services');
14
25
  const domains = await getCollection('domains');
15
26
  const teams = await getCollection('teams');
16
27
  const users = await getCollection('users');
28
+ const entities = await getCollection('entities');
29
+ const channels = await getCollection('channels');
30
+ const flows = await getCollection('flows');
17
31
 
18
32
  const customDocs = await getCollection('customPages');
19
33
 
@@ -30,6 +44,9 @@ export const GET: APIRoute = async ({ params, request }) => {
30
44
  ...domains,
31
45
  ...teams,
32
46
  ...users,
47
+ ...entities,
48
+ ...channels,
49
+ ...flows,
33
50
  ];
34
51
 
35
52
  if (isCustomDocsEnabled()) {
@@ -3,6 +3,7 @@ import config from '@config';
3
3
  import type { APIRoute } from 'astro';
4
4
 
5
5
  import { isCustomDocsEnabled } from '@utils/feature';
6
+ import { getUbiquitousLanguage, type UbiquitousLanguage } from '@utils/collections/domains';
6
7
 
7
8
  const events = await getCollection('events');
8
9
  const commands = await getCollection('commands');
@@ -14,14 +15,78 @@ const domains = await getCollection('domains');
14
15
  const teams = await getCollection('teams');
15
16
  const users = await getCollection('users');
16
17
 
18
+ const flows = await getCollection('flows');
19
+ const channels = await getCollection('channels');
20
+
21
+ const entities = await getCollection('entities');
22
+
17
23
  const customDocs = await getCollection('customPages');
18
24
 
25
+ const ubiquitousLanguages: Record<string, { id: string; version: string; properties: any }[]> = {};
26
+
27
+ for (const domain of domains) {
28
+ const ubiquitousLanguagesForDomain = await getUbiquitousLanguage(domain);
29
+ if (ubiquitousLanguagesForDomain.length > 0) {
30
+ ubiquitousLanguages[domain.id] = ubiquitousLanguagesForDomain.map((item) => ({
31
+ id: domain.id,
32
+ version: domain.data.version,
33
+ properties: item.data.dictionary,
34
+ }));
35
+ }
36
+ }
37
+
38
+ // Render the Ubiquitous Languages section
39
+ const renderUbiquitousLanguages = (baseUrl: string) => {
40
+ return Object.entries(ubiquitousLanguages)
41
+ .map(([domainId, items]) => {
42
+ const domainName = domains.find((domain) => domain.id === domainId)?.data.name || domainId;
43
+ const itemsList = items
44
+ .map((item) => {
45
+ // @ts-ignore
46
+ const propertiesList = Object.entries(item.properties)
47
+ .map(
48
+ ([key, value]) =>
49
+ ` - [${value.name}: - ${value.summary}](${baseUrl}/docs/domains/${domainId.split('-')[0]}/language.mdx)`
50
+ )
51
+ .join('\n');
52
+ return propertiesList;
53
+ })
54
+ .join('\n');
55
+ return `- ${domainName} Domain\n${itemsList}`;
56
+ })
57
+ .join('\n');
58
+ };
59
+
60
+ // render the entities from the domain list
61
+ const renderEntities = (baseUrl: string) => {
62
+ const domainsWithEntities = domains.filter((domain) => domain.data.entities?.length && domain.data.entities.length > 0);
63
+
64
+ if (domainsWithEntities.length === 0) {
65
+ return '';
66
+ }
67
+
68
+ return domainsWithEntities
69
+ .map((domain) => {
70
+ const entitiesList = domain.data.entities
71
+ ?.map((entity) => {
72
+ const entityItem = entities.find((e) => e.data.id === entity.id);
73
+ return ` - [${entityItem?.data.name}](${baseUrl}/docs/entities/${entityItem?.data.id}/${entityItem?.data.version}.mdx) - ${entityItem?.data.summary}`;
74
+ })
75
+ .join('\n');
76
+ return `- ${domain.data.name} Domain\n${entitiesList || ''}`;
77
+ })
78
+ .join('\n');
79
+ };
80
+
81
+ console.log('PROTOCOL', channels[0]);
19
82
  export const GET: APIRoute = async ({ params, request }) => {
20
83
  const url = new URL(request.url);
21
84
  const baseUrl = process.env.LLMS_TXT_BASE_URL || `${url.origin}`;
22
85
 
23
- const formatVersionedItem = (item: any, type: string) =>
24
- `- [${item.data.name} - ${item.data.id} - ${item.data.version}](${baseUrl}/docs/${type}/${item.data.id}/${item.data.version}.mdx) - ${item.data.summary}`;
86
+ const formatVersionedItem = (item: any, type: string, extraParams?: string | string[]) => {
87
+ const params = Array.isArray(extraParams) ? extraParams.join('&') : extraParams || '';
88
+ return `- [${item.data.name} - ${item.data.id} - ${item.data.version} ${params ? `- ${params}` : ''}](${baseUrl}/docs/${type}/${item.data.id}/${item.data.version}.mdx) ${item.data.summary ? `- ${item.data.summary}` : ''}`;
89
+ };
25
90
 
26
91
  const formatSimpleItem = (item: any, type: string) =>
27
92
  `- [${item.id.replace('.mdx', '')}](${baseUrl}/docs/${type}/${item.data.id}.mdx) - ${item.data.name}`;
@@ -31,8 +96,8 @@ export const GET: APIRoute = async ({ params, request }) => {
31
96
 
32
97
  const content = [
33
98
  `# ${config.organizationName} EventCatalog Documentation\n`,
34
- `> ${config.tagline}`,
35
- '\n## Events',
99
+ `> ${config.tagline}\n`,
100
+ '## Events',
36
101
  events.map((item) => formatVersionedItem(item, 'events')).join(''),
37
102
  '\n## Commands',
38
103
  commands.map((item) => formatVersionedItem(item, 'commands')).join(''),
@@ -42,6 +107,17 @@ export const GET: APIRoute = async ({ params, request }) => {
42
107
  services.map((item) => formatVersionedItem(item, 'services')).join(''),
43
108
  '\n## Domains',
44
109
  domains.map((item) => formatVersionedItem(item, 'domains')).join(''),
110
+ '\n## Flows',
111
+ flows.map((item) => formatVersionedItem(item, 'flows')).join('\n'),
112
+ '\n## Channels',
113
+ channels
114
+ .map((item) =>
115
+ formatVersionedItem(item, 'channels', item.data.protocols?.map((protocol) => `protocol - ${protocol}`).join('&'))
116
+ )
117
+ .join(''),
118
+ ...(Object.keys(ubiquitousLanguages).length > 0 ? ['## Ubiquitous Language', renderUbiquitousLanguages(baseUrl)] : []),
119
+ '\n## Entities',
120
+ renderEntities(baseUrl),
45
121
  '\n## Teams',
46
122
  teams.map((item) => formatSimpleItem(item, 'teams')).join('\n'),
47
123
  '\n## Users',
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.42.6",
9
+ "version": "2.42.7",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },