@eventcatalog/core 2.29.2 → 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.
@@ -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.29.2";
40
+ var version = "2.29.3";
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-7SZ6PH5O.js";
4
- import "../chunk-77IO2UDS.js";
3
+ } from "../chunk-7LKTKQLT.js";
4
+ import "../chunk-KCR7LC5R.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.29.2";
109
+ var version = "2.29.3";
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-MHSM6HM5.js";
4
- import "../chunk-7SZ6PH5O.js";
5
- import "../chunk-77IO2UDS.js";
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
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-77IO2UDS.js";
3
+ } from "./chunk-KCR7LC5R.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-7SZ6PH5O.js";
3
+ } from "./chunk-7LKTKQLT.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.29.2";
2
+ var version = "2.29.3";
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.29.2";
28
+ var version = "2.29.3";
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-77IO2UDS.js";
3
+ } from "./chunk-KCR7LC5R.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
161
161
  var import_os = __toESM(require("os"), 1);
162
162
 
163
163
  // package.json
164
- var version = "2.29.2";
164
+ var version = "2.29.3";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -6,14 +6,14 @@ import {
6
6
  } from "./chunk-WUCY3QHK.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-MHSM6HM5.js";
10
- import "./chunk-7SZ6PH5O.js";
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-77IO2UDS.js";
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] flex items-center gap-1 font-medium px-2 uppercase py-0.5 rounded ${getMessageColorByCollection(message.collection)}`}
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(),
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.29.2",
9
+ "version": "2.29.3",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },