@eventcatalog/core 2.33.7 → 2.33.9

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.
@@ -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.33.7";
40
+ var version = "2.33.9";
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-4BTH6TJB.js";
4
- import "../chunk-NL4PYW7O.js";
3
+ } from "../chunk-LHX6OHFE.js";
4
+ import "../chunk-OKSJ75RQ.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.33.7";
109
+ var version = "2.33.9";
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-VENFKOAJ.js";
4
- import "../chunk-4BTH6TJB.js";
5
- import "../chunk-NL4PYW7O.js";
3
+ } from "../chunk-LVSH6F2F.js";
4
+ import "../chunk-LHX6OHFE.js";
5
+ import "../chunk-OKSJ75RQ.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
  VERSION
3
- } from "./chunk-NL4PYW7O.js";
3
+ } from "./chunk-OKSJ75RQ.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-4BTH6TJB.js";
3
+ } from "./chunk-LHX6OHFE.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.33.7";
2
+ var version = "2.33.9";
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.33.7";
28
+ var version = "2.33.9";
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-NL4PYW7O.js";
3
+ } from "./chunk-OKSJ75RQ.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.33.7";
160
+ var version = "2.33.9";
161
161
 
162
162
  // src/constants.ts
163
163
  var VERSION = version;
@@ -6,15 +6,15 @@ import {
6
6
  } from "./chunk-UKJ7F5WR.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-VENFKOAJ.js";
10
- import "./chunk-4BTH6TJB.js";
9
+ } from "./chunk-LVSH6F2F.js";
10
+ import "./chunk-LHX6OHFE.js";
11
11
  import {
12
12
  catalogToAstro,
13
13
  checkAndConvertMdToMdx
14
14
  } from "./chunk-7SI5EVOX.js";
15
15
  import {
16
16
  VERSION
17
- } from "./chunk-NL4PYW7O.js";
17
+ } from "./chunk-OKSJ75RQ.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogScaleEnabled,
@@ -1,33 +1,37 @@
1
- import { ExclamationTriangleIcon } from '@heroicons/react/20/solid';
2
- import { InformationCircleIcon } from '@heroicons/react/24/solid';
1
+ import { InformationCircleIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline';
3
2
 
4
3
  const getConfigurationByType = (type: string) => {
5
4
  switch (type) {
5
+ case 'danger':
6
+ return { color: 'red', icon: ExclamationTriangleIcon, title: 'Danger' };
6
7
  case 'alert':
7
- return { color: 'red', icon: ExclamationTriangleIcon };
8
+ return { color: 'red', icon: ExclamationTriangleIcon, title: 'Alert' };
8
9
  case 'warning':
9
- return { color: 'yellow', icon: ExclamationTriangleIcon };
10
+ return { color: 'yellow', icon: ExclamationTriangleIcon, title: 'Warning' };
10
11
  default:
11
- return { color: 'indigo', icon: InformationCircleIcon };
12
+ return { color: 'indigo', icon: InformationCircleIcon, title: 'Info' };
12
13
  }
13
14
  };
14
15
 
15
16
  interface AdmonitionProps {
16
- children: JSX.Element;
17
+ children: React.ReactNode;
17
18
  type?: string;
18
19
  className?: string;
20
+ title?: string;
19
21
  }
20
22
 
21
- export default function Admonition({ children, type = 'info', className = '' }: AdmonitionProps) {
22
- const { color, icon: Icon } = getConfigurationByType(type);
23
+ export default function Admonition({ children, type = 'info', className = '', title }: AdmonitionProps) {
24
+ const config = getConfigurationByType(type);
25
+ const Icon = config.icon;
23
26
 
24
27
  return (
25
- <div className={`bg-${color}-50 border-l-4 border-${color}-400 my-4 ${className}`}>
26
- <div className="flex">
27
- <div className="ml-3 py-2 text-sm flex items-center">
28
- <Icon className={`block mr-2 h-7 w-7 text-${color}-400`} aria-hidden="true" />
29
- <div>{children}</div>
28
+ <div className={`bg-${config.color}-50 border-l-4 border-${config.color}-500 p-4 my-4 ${className} rounded-md`}>
29
+ <div className="flex flex-col">
30
+ <div className="flex items-center">
31
+ <Icon className={`h-6 w-6 text-${config.color}-500 stroke-2`} aria-hidden="true" />
32
+ <h3 className={`ml-2 text-${config.color}-600 font-bold text-md`}>{title || config.title}</h3>
30
33
  </div>
34
+ <div className={`mt-2 text-${config.color}-700 text-md`}>{children}</div>
31
35
  </div>
32
36
  </div>
33
37
  );
@@ -44,7 +44,7 @@ export default function ChannelNode({ data, sourcePosition, targetPosition }: an
44
44
 
45
45
  const { id, name, version, summary, owners = [], address, protocols = [], styles } = channel.data;
46
46
  const protocol = protocols[0];
47
- const { node: { color = 'gray', icon = 'ArrowsRightLeftIcon', label } = {} } = styles || {};
47
+ const { node: { color = 'gray', label } = {}, icon = 'ArrowsRightLeftIcon' } = styles || {};
48
48
 
49
49
  const Icon = getIconForProtocol(protocol);
50
50
 
@@ -23,7 +23,7 @@ export default function CommandNode({ data, sourcePosition, targetPosition }: an
23
23
  const { mode, message } = data as Data;
24
24
 
25
25
  const { id, name, version, summary, owners = [], producers = [], consumers = [], schemaPath, styles } = message.data;
26
- const { node: { color = 'blue', icon = 'ChatBubbleLeftIcon', label } = {} } = styles || {};
26
+ const { node: { color = 'blue', label } = {}, icon = 'ChatBubbleLeftIcon' } = styles || {};
27
27
 
28
28
  const Icon = getIcon(icon);
29
29
  const nodeLabel = label || message?.data?.sidebar?.badge || 'Command';
@@ -21,7 +21,7 @@ function classNames(...classes: any) {
21
21
  export default function EventNode({ data, sourcePosition, targetPosition }: any) {
22
22
  const { mode, message } = data as Data;
23
23
  const { name, version, summary, owners = [], producers = [], consumers = [], styles } = message.data;
24
- const { node: { color = 'orange', icon = 'BoltIcon', label } = {} } = styles || {};
24
+ const { node: { color = 'orange', label } = {}, icon = 'BoltIcon' } = styles || {};
25
25
 
26
26
  const Icon = getIcon(icon);
27
27
  const nodeLabel = label || message?.data?.sidebar?.badge || 'Event';
@@ -20,7 +20,7 @@ export default function QueryNode({ data, sourcePosition, targetPosition }: any)
20
20
  const { mode, message } = data as Data;
21
21
 
22
22
  const { name, version, summary, owners = [], producers = [], consumers = [], styles } = message.data;
23
- const { node: { color = 'green', icon = 'MagnifyingGlassIcon', label } = {} } = styles || {};
23
+ const { node: { color = 'green', label } = {}, icon = 'MagnifyingGlassIcon' } = styles || {};
24
24
 
25
25
  const Icon = getIcon(icon);
26
26
  const nodeLabel = label || message?.data?.sidebar?.badge || 'Query';
@@ -23,7 +23,7 @@ export default function ServiceNode({ data, sourcePosition, targetPosition }: an
23
23
  const { mode, service } = data as Data;
24
24
 
25
25
  const { id, version, owners = [], sends = [], receives = [], name, specifications, repository, styles } = service.data;
26
- const { node: { color = 'pink', icon = 'ServerIcon', label } = {} } = styles || {};
26
+ const { node: { color = 'pink', label } = {}, icon = 'ServerIcon' } = styles || {};
27
27
 
28
28
  const Icon = getIcon(icon);
29
29
  const nodeLabel = label || service?.data?.sidebar?.badge || 'Service';
@@ -106,15 +106,21 @@ const baseSchema = z.object({
106
106
  .optional(),
107
107
  styles: z
108
108
  .object({
109
+ icon: z.string().optional(),
109
110
  node: z
110
111
  .object({
111
112
  color: z.string().optional(),
112
- icon: z.string().optional(),
113
113
  label: z.string().optional(),
114
114
  })
115
115
  .optional(),
116
116
  })
117
117
  .optional(),
118
+ deprecated: z
119
+ .object({
120
+ message: z.string().optional(),
121
+ date: z.date().optional(),
122
+ })
123
+ .optional(),
118
124
  // Used by eventcatalog
119
125
  versions: z.array(z.string()).optional(),
120
126
  latestVersion: z.string().optional(),
@@ -1,11 +1,14 @@
1
1
  ---
2
2
  import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
3
3
  import Footer from '@layouts/Footer.astro';
4
+ import { marked } from 'marked';
4
5
 
5
6
  import components from '@components/MDX/components';
6
7
  import NodeGraph from '@components/MDX/NodeGraph/NodeGraph.astro';
7
8
  import SchemaViewer from '@components/MDX/SchemaViewer/SchemaViewerRoot.astro';
8
9
 
10
+ import Admonition from '@components/MDX/Admonition';
11
+
9
12
  // SideBars
10
13
  import ServiceSideBar from '@components/SideBars/ServiceSideBar.astro';
11
14
  import MessageSideBar from '@components/SideBars/MessageSideBar.astro';
@@ -132,6 +135,14 @@ const pagefindAttributes =
132
135
  'data-pagefind-meta': `title:${pageTitle}`,
133
136
  }
134
137
  : {};
138
+
139
+ const isMarkedAsDeprecated = props.data.deprecated;
140
+ const hasDeprecated = props.data.deprecated?.date && new Date(props.data.deprecated?.date) < new Date();
141
+ const formattedDate = props.data.deprecated?.date
142
+ ? new Date(props.data.deprecated?.date).toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })
143
+ : '';
144
+ let friendlyCollectionName = props.collection.slice(0, props.collection.length - 1);
145
+ friendlyCollectionName = friendlyCollectionName === 'querie' ? 'query' : friendlyCollectionName;
135
146
  ---
136
147
 
137
148
  <VerticalSideBarLayout title={pageTitle} description={props.data.summary}>
@@ -140,10 +151,46 @@ const pagefindAttributes =
140
151
  <div class="w-full lg:mr-2 pr-8 overflow-y-auto py-8">
141
152
  <div class="border-b border-gray-200 flex justify-between items-start md:pb-2">
142
153
  <div>
143
- <h2 id="doc-page-header" class="text-2xl md:text-4xl font-bold text-black">
154
+ <h2
155
+ id="doc-page-header"
156
+ class={`text-2xl md:text-4xl font-bold text-black ${props.data.deprecated && hasDeprecated ? 'text-red-500' : ''}`}
157
+ >
144
158
  {props.data.name}
145
159
  <span class="">(v{props.data.version})</span>
146
160
  </h2>
161
+ {
162
+ isMarkedAsDeprecated && hasDeprecated && (
163
+ <Admonition type="alert" title={`This ${friendlyCollectionName} was deprecated on ${formattedDate}`}>
164
+ <div>
165
+ {!props.data.deprecated?.message && (
166
+ <p>
167
+ The {friendlyCollectionName} has been deprecated ({props.data.deprecated?.date}).
168
+ </p>
169
+ )}
170
+ {props.data.deprecated?.message && (
171
+ <div class="prose prose-sm max-w-none" set:html={marked.parse(props.data.deprecated?.message)} />
172
+ )}
173
+ </div>
174
+ </Admonition>
175
+ )
176
+ }
177
+ {
178
+ isMarkedAsDeprecated && !hasDeprecated && (
179
+ <Admonition type="warning" title={`This ${friendlyCollectionName} will be deprecated on ${formattedDate}`}>
180
+ <div>
181
+ {!props.data.deprecated?.message && (
182
+ <p>
183
+ The {friendlyCollectionName} will be deprecated on {formattedDate}.
184
+ </p>
185
+ )}
186
+ {props.data.deprecated?.message && (
187
+ <div class="prose prose-sm max-w-none" set:html={marked.parse(props.data.deprecated?.message)} />
188
+ )}
189
+ </div>
190
+ </Admonition>
191
+ )
192
+ }
193
+
147
194
  <h2 class="text-lg pt-2 text-gray-500 font-light">{props.data.summary}</h2>
148
195
  {
149
196
  badges && (
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.33.7",
9
+ "version": "2.33.9",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },