@eventcatalog/core 2.33.2 → 2.33.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 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
- [![All Contributors](https://img.shields.io/badge/all_contributors-52-orange.svg?style=flat-square)](#contributors-)
37
+ [![All Contributors](https://img.shields.io/badge/all_contributors-53-orange.svg?style=flat-square)](#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)
@@ -263,6 +263,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
263
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
264
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/vienin"><img src="https://avatars.githubusercontent.com/u/2124283?v=4?s=100" width="100px;" alt="Kevin Pouget"/><br /><sub><b>Kevin Pouget</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=vienin" title="Code">💻</a></td>
265
265
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/VitaliiBalash"><img src="https://avatars.githubusercontent.com/u/4520809?v=4?s=100" width="100px;" alt="Vitalii Balash"/><br /><sub><b>Vitalii Balash</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=VitaliiBalash" title="Code">💻</a></td>
266
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/ababilone"><img src="https://avatars.githubusercontent.com/u/925013?v=4?s=100" width="100px;" alt="Arnaud Babilone"/><br /><sub><b>Arnaud Babilone</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=ababilone" title="Code">💻</a></td>
266
267
  </tr>
267
268
  </tbody>
268
269
  </table>
@@ -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.2";
40
+ var version = "2.33.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-ESJAFFBK.js";
4
- import "../chunk-DDOQCYNI.js";
3
+ } from "../chunk-5QUF2S7L.js";
4
+ import "../chunk-557OECV4.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.2";
109
+ var version = "2.33.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-QXRF5XEW.js";
4
- import "../chunk-ESJAFFBK.js";
5
- import "../chunk-DDOQCYNI.js";
3
+ } from "../chunk-5TXSONUY.js";
4
+ import "../chunk-5QUF2S7L.js";
5
+ import "../chunk-557OECV4.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.33.2";
2
+ var version = "2.33.3";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-DDOQCYNI.js";
3
+ } from "./chunk-557OECV4.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-ESJAFFBK.js";
3
+ } from "./chunk-5QUF2S7L.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -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.2";
28
+ var version = "2.33.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-DDOQCYNI.js";
3
+ } from "./chunk-557OECV4.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.2";
160
+ var version = "2.33.3";
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-QXRF5XEW.js";
10
- import "./chunk-ESJAFFBK.js";
9
+ } from "./chunk-5TXSONUY.js";
10
+ import "./chunk-5QUF2S7L.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-DDOQCYNI.js";
17
+ } from "./chunk-557OECV4.js";
18
18
  import {
19
19
  isBackstagePluginEnabled,
20
20
  isEventCatalogScaleEnabled,
@@ -26,9 +26,9 @@ const PillList = ({ title, pills, emptyMessage, color = 'gray' }: Props) => {
26
26
  </DisclosureButton>
27
27
  <DisclosurePanel className="mt-2 text-sm/5 text-black/50">
28
28
  <ul role="list" className=" py-2 ">
29
- {pills.map((item) => {
29
+ {pills.map((item, index) => {
30
30
  return (
31
- <li className="py-1 " key={item.href}>
31
+ <li className="py-1 " key={`${item.href}-${index}`}>
32
32
  <a
33
33
  className={`flex items-start group border border-pink-200 hover:border-pink-400 rounded-md`}
34
34
  href={item.href}
@@ -46,7 +46,7 @@ const PillList = ({ title, pills, emptyMessage, color = 'gray', limit = 10, ...p
46
46
  >
47
47
  <a className={`leading-3`} href={href}>
48
48
  <span className="space-x-2 flex items-center">
49
- {Icon && <Icon className={`h-4 w-4`} />}
49
+ {Icon && <Icon className="h-4 w-4 shrink-0" />}
50
50
  <span className="font-light text-sm truncate">
51
51
  {item.label} {item.tag && <>({item.tag})</>}
52
52
  </span>
@@ -46,14 +46,14 @@ const ProtocolList = ({ title, pills, emptyMessage, color = 'gray', ...props }:
46
46
  </DisclosureButton>
47
47
  <DisclosurePanel className="mt-2 text-sm/5 text-black/50">
48
48
  <ul role="list" className="space-y-2">
49
- {pills.map((item) => {
49
+ {pills.map((item, index) => {
50
50
  const href = item.href ?? '#';
51
51
  const Icon = item.icon ? getIconForProtocol(item.icon) : null;
52
52
 
53
53
  return (
54
54
  <li
55
55
  className=" has-tooltip rounded-md text-gray-600 group px-1 w-full hover:bg-gradient-to-l hover:from-purple-500 hover:to-purple-700 hover:text-white hover:font-normal "
56
- key={item.href}
56
+ key={`${item.href}-${index}`}
57
57
  >
58
58
  <a className={`leading-3`} href={href}>
59
59
  <span className="space-x-2 flex items-center">
@@ -1,23 +1,50 @@
1
1
  ---
2
2
  import { buildUrl } from '@utils/url-builder';
3
- import { resourceToCollectionMap } from '@utils/collections/util';
3
+ import { getItemsFromCollectionByIdAndSemverOrLatest, resourceToCollectionMap } from '@utils/collections/util';
4
+ import { getCollection } from 'astro:content';
4
5
 
5
6
  const { id, version, type } = Astro.props;
6
7
  const collection = resourceToCollectionMap[type as keyof typeof resourceToCollectionMap];
8
+
9
+ let slotHTML = await Astro.slots.render('default');
10
+ let href = '#';
11
+ let linkHasError = false;
12
+
13
+ try {
14
+ if (collection === 'users' || collection === 'teams') {
15
+ const resources = await getCollection(collection, (resource) => resource.data.id === id);
16
+ const resource = resources[0];
17
+
18
+ slotHTML = slotHTML || resource.data.name;
19
+ href = buildUrl(`/docs/${collection}/${id}`);
20
+ } else {
21
+ const resourcesCollection = await getCollection(collection);
22
+
23
+ const resources = getItemsFromCollectionByIdAndSemverOrLatest(resourcesCollection, id, version);
24
+ const resource = resources[0];
25
+
26
+ slotHTML = slotHTML || resource.data.name;
27
+ href = buildUrl(`/docs/${collection}/${id}/${resource.data.version}`);
28
+ }
29
+ } catch (error) {
30
+ console.error(`Failed to fetch related resource: ${id} of type ${type}`, error);
31
+ linkHasError = true;
32
+ slotHTML = id;
33
+ }
7
34
  ---
8
35
 
9
36
  {
10
- version && (
11
- <a href={buildUrl(`/docs/${collection}/${id}/${version}`)} class="text-purple-500 hover:text-purple-700">
12
- <slot />
37
+ linkHasError && (
38
+ <a href={href} class="text-red-500 hover:text-red-700">
39
+ ⚠️ {slotHTML} (broken link)
13
40
  </a>
14
41
  )
15
42
  }
16
43
 
17
44
  {
18
- !version && (
19
- <a href={buildUrl(`/docs/${collection}/${id}`)} class="text-purple-500 hover:text-purple-700">
20
- <slot />
45
+ !linkHasError && (
46
+ <a href={href} class="text-purple-500 hover:text-purple-700">
47
+ {slotHTML}
21
48
  </a>
22
49
  )
23
50
  }
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 96 96" id="Grpc--Streamline-Svg-Logos" ><desc>Grpc Streamline Icon: https://streamlinehq.com</desc><path fill="#244b5a" d="M11.4052 61.9509c.6979.9285 1.6048 1.6794 2.6473 2.1918 1.1274.5584 2.3714.8408 3.6294.8238 1.0172.0266 2.0297-.1461 2.9805-.5084.7605-.2988 1.4394-.7734 1.9811-1.385.5084-.5959.8795-1.2963 1.0871-2.0515.2264-.8163.3384-1.66.333-2.507v-2.9454h-.0699c-.6593 1.045-1.6103 1.8739-2.7355 2.3844-1.0728.4671-2.2311.7059-3.4012.7013-1.1465.0086-2.2838-.2057-3.3485-.6311-1.0082-.4003-1.9306-.9894-2.7177-1.7358-.781-.7499-1.4014-1.6507-1.8235-2.6478-.44911-1.0526-.67592-2.1866-.6662-3.331-.00969-1.1411.20483-2.2729.63137-3.3313.40313-1.0013.99203-1.9174 1.73553-2.6999.7434-.7761 1.6387-1.3909 2.63-1.806 1.0608-.441 2.2001-.6617 3.3488-.6486.5231.003 1.045.0499 1.5602.14.5666.099 1.1197.2638 1.6481.4911 1.2545.5437 2.3389 1.4161 3.1386 2.525h.0699v-2.7354h2.3146v16.2705c-.0079.956-.1197 1.9083-.3333 2.8402-.2234 1.0076-.6664 1.9534-1.2973 2.7701-.7179.901-1.6366 1.6216-2.6826 2.1043-1.1457.5608-2.6419.8411-4.4886.8411-1.5001.0256-2.9902-.2485-4.383-.8063-1.3326-.5708-2.5279-1.4196-3.50622-2.4894l1.71802-1.8237Zm.4207-11.7116c-.0058.8357.1552 1.6641.4735 2.4368.3035.7415.7435 1.4195 1.2971 1.9986.5504.5741 1.2049 1.0382 1.9287 1.3678.754.3426 1.5738.5162 2.402.5083 1.6401.0059 3.2206-.6149 4.4182-1.7355.5881-.555 1.0488-1.2311 1.3502-1.9816.3247-.825.4741-1.7086.4384-2.5944.0059-.831-.1366-1.6564-.4209-2.4373-.2701-.7422-.6876-1.4221-1.2274-1.9987-.5548-.5845-1.223-1.0498-1.9636-1.3675-.82-.3485-1.7039-.5218-2.5949-.5086-.8282-.0076-1.648.166-2.402.5086-.7236.3299-1.378.7939-1.9287 1.3675-.5535.5794-.9935 1.2573-1.2974 1.9987-.3181.7729-.479 1.6014-.4732 2.4373Zm23.9844 8.4156h-2.5245V33.8282H40.93c2.5247 0 4.5175.5493 5.9786 1.6481 1.4608 1.099 2.1914 2.7588 2.1917 4.9793.0445 1.6118-.5403 3.1776-1.6305 4.3656-1.0872 1.1807-2.6593 1.8645-4.7163 2.0512l7.1534 11.7825h-3.086l-6.8024-11.5367h-4.208l-.0002 11.5367Zm0-13.851h4.4886c.9644.0203 1.9268-.0978 2.8577-.3508.6809-.182 1.3186-.4978 1.8761-.929.4497-.3619.7997-.8326 1.0167-1.3675.2134-.5415.3205-1.119.3157-1.701.0026-.5702-.1046-1.1356-.3157-1.6654-.2196-.5384-.5688-1.0143-1.0167-1.3852-.5521-.4398-1.1917-.7566-1.8761-.9293-.933-.2402-1.8945-.3522-2.8577-.333h-4.4886v8.6612Zm18.4441-10.9757h7.2238c2.5245 0 4.5173.5494 5.9783 1.6483 1.4608 1.0991 2.1914 2.7589 2.1918 4.9794 0 2.2212-.7306 3.8867-2.1918 4.9967-1.461 1.1106-3.4538 1.6658-5.9783 1.6656h-4.6988v11.5367h-2.525V33.8282Zm2.5252 10.9759h4.0677c.9644.0203 1.9268-.0978 2.8577-.3507.6808-.1821 1.3186-.498 1.8761-.9291.4497-.3619.7996-.8326 1.0167-1.3675.2135-.5414.3206-1.1189.3157-1.7009.0027-.5703-.1045-1.1357-.3157-1.6654-.2196-.5385-.5688-1.0143-1.0167-1.3853-.5521-.4396-1.1917-.7565-1.8761-.9293-.933-.2401-1.8945-.3522-2.8577-.3329h-4.0679l.0002 8.6611ZM95 54.7276c-.4443.6582-.9682 1.2589-1.56 1.7884-.6406.5755-1.3539 1.0647-2.1216 1.4549-.8196.4185-1.6842.7421-2.5771.9646-.9579.2378-1.9415.3555-2.9284.3505-1.7604.0165-3.5065-.3172-5.1368-.9816-3.1091-1.2564-5.5719-3.7256-6.8204-6.8379-.6681-1.66-1.0017-3.4357-.9816-5.225-.02-1.7892.3136-3.5649.9816-5.2249 1.2484-3.1122 3.7113-5.5813 6.8204-6.8374 1.6302-.6646 3.3764-.9984 5.1368-.9819 1.5867.0085 3.1574.3178 4.6288.9115 1.5694.628 2.9388 1.6704 3.9622 3.0158l-2.2088 1.6481c-.2968-.442-.6506-.843-1.0523-1.1923-.464-.4109-.976-.764-1.5249-1.0518-.5864-.3089-1.2035-.5557-1.8412-.7364-.6383-.1847-1.2994-.2791-1.9638-.2806-1.4729-.0242-2.9332.2751-4.2779.8766-1.2199.5535-2.3122 1.3533-3.2083 2.3492-.8868.9987-1.5716 2.1599-2.0166 3.4192-.9349 2.6431-.9349 5.5268 0 8.1699.4449 1.2593 1.1297 2.4204 2.0166 3.4189.8958.9962 1.9882 1.7962 3.2083 2.3494 1.3446.602 2.8049.9014 4.2779.8769.6527.0003 1.3041-.0584 1.9462-.1753.6533-.1202 1.2893-.3204 1.8937-.5961.637-.2922 1.2277-.6763 1.7533-1.14.5904-.5274 1.1038-1.1352 1.5251-1.8054L95 54.7276Z"></path><path fill="url(#a)" d="m7.53809 41.9566-6.53851-6.49 6.49007-6.5386 6.53855 6.4901-6.49011 6.5385Z"></path><path fill="url(#b)" d="m25.3301 39.1863-3.8352-3.8067 3.8068-3.8352 3.8351 3.8068-3.8067 3.8351Z"></path><path fill="#244b5a" d="M7.77596 31.5034 3.8457 35.4631l3.95949 3.9303 3.34981-.0125-3.51277-3.4845 17.34547-.0643-1.5202 1.5305 1.6749-.0061 1.9653-1.9799-1.9799-1.965-1.6749.0061 1.5317 1.5195-17.34553.0643 3.48643-3.5105-3.34954.0124Z"></path><defs><linearGradient id="a" x1="-646.313" x2="656.545" y1="-607.051" y2="-611.894" gradientUnits="userSpaceOnUse"><stop stop-color="#72c9c9"></stop><stop offset="1" stop-color="#02b0ad"></stop></linearGradient><linearGradient id="b" x1="-358.188" x2="406.007" y1="-341.49" y2="-344.331" gradientUnits="userSpaceOnUse"><stop stop-color="#03b6b4"></stop><stop offset="1" stop-color="#74cbca"></stop></linearGradient></defs></svg>
@@ -14,3 +14,5 @@ export { default as EventBridge } from '@icons/protocols/eventbridge.svg?raw';
14
14
  export { default as Redis } from '@icons/protocols/redis.svg?raw';
15
15
  export { default as GooglePubSub } from '@icons/protocols/googlepubsub.svg?raw';
16
16
  export { default as Kinesis } from '@icons/protocols/kinesis.svg?raw';
17
+ export { default as GRPC } from '@icons/protocols/grpc.svg?raw';
18
+ export { default as ZMQ } from '@icons/protocols/zmq.svg?raw';
@@ -0,0 +1 @@
1
+ <svg version="1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 525 525"><path d="M245.85 3c-.07.15-3.07.45-6.6 0.75-7.27.6-7.35.6-24.38 3.15-1.2.22-2.78.52-3.38.68-.6.15-1.95.45-3 0.68-4.8 0.82-20.55 5.03-26.7 7.05-24.45 8.18-50.93 21.23-67.8 33.38-2.4 1.72-5.1 3.68-6 4.28-1 0.6-4.43 3.3-7.8 5.93-36.23 28.65-64.65 66.6-81.38 108.68-6.83 17.1-13.5 41.1-15.45 55.65-.22 1.88-.6 4.2-0.83 5.25-.38 2.1-.68 4.8-1.58 14.25-1.13 12.15-.6 44.18 0.9 53.33.15 0.98.45 3.45 0.75 5.55 0.68 5.7 1.2 8.7 1.88 12 0.38 1.65 0.83 3.98 1.05 5.25 0.68 3.68 0.98 4.95 2.7 11.63 1.58 6.38 5.48 19.28 6.68 22.13 0.38 0.83 1.88 4.88 3.45 9 3.68 9.75 13.65 30.08 18.83 38.33 2.25 3.53 4.05 6.75 4.05 7.13s-9.15 9.9-20.33 21.08l-20.25 20.4 39.23 39.23 39.3 39.3 20.25-20.25c11.18-11.18 20.78-20.33 21.3-20.33.53 0 2.7 1.13 4.8 2.55 2.1 1.35 6.53 3.98 9.83 5.7 3.3 1.8 6.38 3.45 6.75 3.75 0.68 0.45 14.1 6.68 20.25 9.38 15.9 6.98 45.53 15 64.13 17.33 1.05 0.15 3.08 0.38 4.5 0.6 14.03 2.18 49.05 2.1 63.75 0 20.18-2.93 35.18-6.45 51.75-12 43.58-14.78 84.08-41.63 112.73-74.93 2.48-2.93 4.73-5.4 5.03-5.63 0.23-0.23 2.63-3.23 5.33-6.75 31.2-40.5 49.65-87.45 54.45-138.38 1.13-11.63 0.45-52.2 0.9-54.38-.15-0.23-.45-2.25-0.68-4.5-.23-2.25-0.6-4.8-0.75-5.63-.15-0.83-0.83-4.58-1.58-8.25-5.33-28.8-16.8-58.73-32.33-84.83-2.25-3.75-4.05-7.05-4.05-7.43 0-0.3 8.33-8.93 18.6-19.13 10.2-10.2 19.28-19.43 20.18-20.4l1.65-1.8-39.23-39.23L445.73 0.6l-20.33 20.33C414.23 32.1 404.85 41.25 404.48 41.25s-3.15-1.58-6.23-3.53c-26.18-16.28-63.23-29.78-94.13-34.43-2.03-0.3-4.28-0.68-4.88-0.75-.6-.15-3.3-.45-6-0.68-2.7-0.3-5.78-0.68-6.75-0.9-2.03-0.38-40.2-1.05-40.65-0.68zm30.83 100.5c4.58 0.45 6.68 0.68 12.45 1.5 4.2 0.6 12.75 2.63 19.5 4.58 7.13 2.1 22.13 7.73 22.13 8.33 0 0.53-215.05 215.55-215.55 215.55-1.05 0-10.05-26.25-11.18-32.7-.23-1.2-0.9-5.03-1.58-8.55-2.55-14.1-2.93-38.55-0.83-49.65 0.23-0.9 0.83-4.58 1.5-8.18 0.6-3.53 2.25-10.35 3.75-15.15 10.35-34.35 28.2-60.15 58-83.93 4.88-3.83 17.4-11.4 25.8-15.6 8.85-4.35 27.23-11.18 33-11.7 1.8-0.3 7.43-1.43 8.1-1.58 0.23-0.08 2.1-0.38 4.13-0.75 2.1-0.3 4.43-0.68 5.25-0.83 0.83-0.15 4.58-0.53 8.25-0.75 3.75-0.3 6.83-0.53 6.9-0.68 0.38-0.23 15.38 0.23 20.4 0.68zm134.63 96.6c8.7 20.03 13.43 43.05 13.5 65.1 0 6.53-0.75 18.38-1.43 21.75-0.23 0.98-0.53 3.15-0.83 4.88-2.78 19.28-12.9 45.23-24.08 62.03-16.95 25.28-38 43.88-64.35 56.85-23.4 11.48-46.73 16.88-72.75 16.8-11.4-0.08-18.38-0.75-29.33-2.93-3.23-0.68-6.9-1.43-8.18-1.65-4.88-0.83-27.3-8.85-29.55-10.5-.3-0.23 214.58-215.4 215.18-215.4 0.23 0 1.05 1.43 1.8 3.15z"/></svg>
@@ -23,6 +23,7 @@ import { render } from 'astro:content';
23
23
  import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
24
24
 
25
25
  import config from '@config';
26
+ import { getIcon } from '@utils/badges';
26
27
 
27
28
  export async function getStaticPaths() {
28
29
  const itemTypes: PageTypes[] = ['events', 'commands', 'queries', 'services', 'domains', 'flows', 'channels'];
@@ -52,6 +53,12 @@ const { Content } = await render(props);
52
53
  const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c) => c.toUpperCase());
53
54
  const contentBadges = props.data.badges || [];
54
55
 
56
+ const getContentBadges = () =>
57
+ contentBadges.map((badge) => ({
58
+ ...badge,
59
+ icon: badge.icon ? getIcon(badge.icon) : null,
60
+ }));
61
+
55
62
  const getBadge = () => {
56
63
  if (props.collection === 'services') {
57
64
  return { backgroundColor: 'pink', textColor: 'pink', content: 'Service', icon: ServerIcon, class: 'text-pink-400' };
@@ -115,7 +122,7 @@ const getSpecificationBadges = () => {
115
122
  return badges;
116
123
  };
117
124
 
118
- const badges = [getBadge(), ...contentBadges, ...getSpecificationBadges()];
125
+ const badges = [getBadge(), ...getContentBadges(), ...getSpecificationBadges()];
119
126
 
120
127
  // Index only the latest version
121
128
  const pagefindAttributes =
@@ -5,6 +5,7 @@ export const badge = z.object({
5
5
  content: z.string(),
6
6
  backgroundColor: z.string(),
7
7
  textColor: z.string(),
8
+ icon: z.string().optional(),
8
9
  });
9
10
 
10
11
  // Create a union type for owners
@@ -0,0 +1,5 @@
1
+ import * as HeroIcons from '@heroicons/react/24/outline';
2
+
3
+ export function getIcon(iconName: string) {
4
+ return HeroIcons[iconName as keyof typeof HeroIcons] || null;
5
+ }
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.2",
9
+ "version": "2.33.3",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -22,8 +22,8 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "@astrojs/markdown-remark": "^6.3.1",
25
- "@astrojs/mdx": "^4.2.2",
26
- "@astrojs/react": "^4.2.2",
25
+ "@astrojs/mdx": "^4.2.3",
26
+ "@astrojs/react": "^4.2.3",
27
27
  "@astrojs/rss": "^4.0.11",
28
28
  "@astrojs/tailwind": "^6.0.2",
29
29
  "@asyncapi/avro-schema-parser": "^3.0.24",
@@ -45,7 +45,7 @@
45
45
  "@tailwindcss/typography": "^0.5.13",
46
46
  "@tanstack/react-table": "^8.17.3",
47
47
  "@xyflow/react": "^12.3.6",
48
- "astro": "^5.5.5",
48
+ "astro": "^5.5.6",
49
49
  "astro-expressive-code": "^0.40.1",
50
50
  "astro-pagefind": "^1.6.0",
51
51
  "astro-seo": "^0.8.4",