@eventcatalog/core 3.39.2 → 3.39.4

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-K2IR7X4Z.js → chunk-NSR4DZXS.js} +1 -1
  6. package/dist/{chunk-2VUYMTYY.js → chunk-O2CZERUN.js} +1 -1
  7. package/dist/{chunk-EC633RFS.js → chunk-ONQOIF2X.js} +1 -1
  8. package/dist/{chunk-Z3G6IPPF.js → chunk-PVOVC2UV.js} +1 -1
  9. package/dist/{chunk-4NHSANWO.js → chunk-WLUQZCIH.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/docs/api/02-config.md +25 -0
  13. package/dist/docs/api/03-domain-api.md +32 -2
  14. package/dist/docs/api/04-service-api.md +32 -2
  15. package/dist/docs/api/05-command-api.md +32 -2
  16. package/dist/docs/api/06-event-api.md +32 -2
  17. package/dist/docs/api/06-query-api.md +32 -2
  18. package/dist/docs/api/08-channel-api.md +32 -2
  19. package/dist/docs/api/09-flow-api.md +32 -2
  20. package/dist/docs/api/10-entity-api.md +32 -2
  21. package/dist/docs/api/12-data-product-api.md +14 -2
  22. package/dist/docs/development/guides/diagrams/05-comparing-diagrams.md +1 -1
  23. package/dist/docs/development/license-keys/_category_.json +12 -0
  24. package/dist/docs/development/license-keys/integrations.md +41 -0
  25. package/dist/docs/development/license-keys/license-validation.md +34 -0
  26. package/dist/docs/development/license-keys/overview.md +52 -0
  27. package/dist/docs/development/license-keys/plans.md +50 -0
  28. package/dist/eventcatalog.cjs +1 -1
  29. package/dist/eventcatalog.js +5 -5
  30. package/dist/generate.cjs +1 -1
  31. package/dist/generate.js +3 -3
  32. package/dist/utils/cli-logger.cjs +1 -1
  33. package/dist/utils/cli-logger.js +2 -2
  34. package/eventcatalog/src/components/Grids/DomainGrid.tsx +2 -1
  35. package/eventcatalog/src/components/Tables/Discover/columns.tsx +2 -0
  36. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +2 -0
  37. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +4 -4
  38. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +4 -4
  39. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +16 -10
  40. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +6 -5
  41. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +22 -51
  42. package/eventcatalog/src/pages/docs/[type]/[id]/_index.data.ts +67 -0
  43. package/eventcatalog/src/pages/docs/[type]/[id]/index.astro +4 -41
  44. package/eventcatalog/src/styles/theme.css +92 -0
  45. package/eventcatalog/src/utils/badge-styles.ts +206 -0
  46. package/eventcatalog/src/utils/page-loaders/page-data-loader.ts +16 -13
  47. package/package.json +3 -3
  48. package/dist/docs/development/deployment/licenses.md +0 -50
@@ -0,0 +1,34 @@
1
+ ---
2
+ sidebar_position: 4
3
+ keywords:
4
+ - licenses
5
+ - validation
6
+ - offline
7
+ sidebar_label: License Validation
8
+ title: How license validation works
9
+ description: How EventCatalog validates your license keys online and offline.
10
+ ---
11
+
12
+ Once you have a license key from [EventCatalog Cloud](https://eventcatalog.cloud) (see [Overview](/docs/development/license-keys/overview) if you don't yet), EventCatalog validates it every time you build or serve your catalog. There are two modes: online and offline.
13
+
14
+ ## Online validation (default)
15
+
16
+ By default, EventCatalog validates license keys online. Your keys are read from your `.env` file (or environment variables) and verified against the EventCatalog API.
17
+
18
+ This is the recommended mode — it requires no extra setup and your keys stay in sync with your account automatically.
19
+
20
+ ## Offline validation
21
+
22
+ If you're behind a firewall or otherwise can't reach the EventCatalog API at build time, you can validate your keys offline.
23
+
24
+ To set up offline validation:
25
+
26
+ 1. Email us at `hello@eventcatalog.dev` to request an offline license file (`license.jwt`).
27
+ 2. Place the `license.jwt` file in the root of your catalog directory.
28
+ 3. EventCatalog will validate against the local file instead of calling our API.
29
+
30
+ Offline license files expire one year from purchase. You'll need to request a new file each year.
31
+
32
+ ## Managing your keys
33
+
34
+ You can view, rotate, and revoke license keys at any time from your [API keys dashboard](https://eventcatalog.cloud/dashboard/api-keys).
@@ -0,0 +1,52 @@
1
+ ---
2
+ sidebar_position: 1
3
+ keywords:
4
+ - licenses
5
+ - license keys
6
+ - trial
7
+ sidebar_label: Overview
8
+ title: License Keys Overview
9
+ description: Learn how license keys work in EventCatalog, how to get a free trial, and where to find your keys.
10
+ ---
11
+
12
+ EventCatalog is open source with a [community edition and a commercial edition](/pricing). The commercial editions (Starter, Scale, Enterprise) and the [integrations](/integrations) (OpenAPI, AsyncAPI, Backstage, and others) are unlocked using **license keys**.
13
+
14
+ If you are using the community edition, you don't need a license key and can skip this section.
15
+
16
+ ## Where license keys come from
17
+
18
+ All license keys are managed in [EventCatalog Cloud](https://eventcatalog.cloud). You sign up for an account, activate the plan or integration you want to use, and your license keys appear on your dashboard.
19
+
20
+ You can then add those keys to your `.env` file (or set them as environment variables) and EventCatalog will unlock the corresponding features.
21
+
22
+ ## Free trials
23
+
24
+ :::tip 14 day free trials
25
+ Every plan and every integration comes with a **14 day free trial**. No payment is required to start one — just sign in to [EventCatalog Cloud](https://eventcatalog.cloud) and activate what you want to try.
26
+
27
+ Need longer to evaluate? Email us at `hello@eventcatalog.dev` and we'll happily extend your trial.
28
+ :::
29
+
30
+ ## Quick start
31
+
32
+ 1. Create an account at [eventcatalog.cloud](https://eventcatalog.cloud).
33
+ 2. From your [dashboard](https://eventcatalog.cloud/dashboard), pick what you need:
34
+ - [Pick your plan](https://eventcatalog.cloud/dashboard) (Starter or Scale) — see [Starting a plan](/docs/development/license-keys/plans).
35
+
36
+ ![Pick your plan in EventCatalog Cloud](./images/pick-your-plan.png)
37
+
38
+ - [Pick your integrations](https://eventcatalog.cloud/dashboard/integrations) (OpenAPI, AsyncAPI, etc.) — see [Getting integration keys](/docs/development/license-keys/integrations).
39
+
40
+ ![Pick your integrations in EventCatalog Cloud](./images/pick-your-integraions.png)
41
+
42
+ 3. Copy your license keys from the [API keys page](https://eventcatalog.cloud/dashboard/api-keys) into your `.env` file.
43
+
44
+ ![Your license keys in the EventCatalog Cloud API keys dashboard](./images/api-keys-dashboard.png)
45
+
46
+ 4. Run your catalog — your commercial features are now unlocked.
47
+
48
+ ## Next steps
49
+
50
+ - [Starting a Starter or Scale plan](/docs/development/license-keys/plans)
51
+ - [Getting license keys for integrations](/docs/development/license-keys/integrations)
52
+ - [How license validation works (online and offline)](/docs/development/license-keys/license-validation)
@@ -0,0 +1,50 @@
1
+ ---
2
+ sidebar_position: 2
3
+ keywords:
4
+ - licenses
5
+ - starter
6
+ - scale
7
+ - plans
8
+ sidebar_label: Starter & Scale Plans
9
+ title: Getting a license key for Starter or Scale
10
+ description: How to start a Starter or Scale plan in EventCatalog Cloud and get your license key.
11
+ ---
12
+
13
+ EventCatalog offers two commercial plans you can self-serve from [EventCatalog Cloud](https://eventcatalog.cloud):
14
+
15
+ - **Starter** — for small teams getting started with commercial features.
16
+ - **Scale** — for larger teams that need the full set of advanced capabilities.
17
+
18
+ See the [pricing page](/pricing) for a full breakdown of what each plan includes.
19
+
20
+ ## Starting a plan
21
+
22
+ 1. Sign in to [EventCatalog Cloud](https://eventcatalog.cloud). If you don't have an account yet, sign up — it's free.
23
+ 2. Go to your [dashboard](https://eventcatalog.cloud/dashboard).
24
+ 3. Choose **Starter** or **Scale** and start your plan. Every plan comes with a **14 day free trial**, so you can try it before you commit.
25
+
26
+ ![Pick your plan in EventCatalog Cloud](./images/pick-your-plan.png)
27
+
28
+ 4. Once the plan is active, head to your [API keys page](https://eventcatalog.cloud/dashboard/api-keys) to find your license key.
29
+
30
+ ![Your license keys in the EventCatalog Cloud API keys dashboard](./images/api-keys-dashboard.png)
31
+
32
+ ## Adding your license key to your catalog
33
+
34
+ Copy the license key from your dashboard into your `.env` file:
35
+
36
+ ```bash title=".env"
37
+ EVENTCATALOG_STARTER_LICENSE_KEY=your-license-key-here
38
+ # or for Scale
39
+ EVENTCATALOG_SCALE_LICENSE_KEY=your-license-key-here
40
+ ```
41
+
42
+ Then start EventCatalog as normal. The commercial features for your plan will be unlocked automatically.
43
+
44
+ ## Need more time?
45
+
46
+ The default trial is 14 days. If you need longer to evaluate, email us at `hello@eventcatalog.dev` and we'll extend it for you.
47
+
48
+ ## Enterprise
49
+
50
+ If you need features beyond Scale — SSO, dedicated support, custom contracts, or on-premise/offline deployment — get in touch at `hello@eventcatalog.dev`.
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
114
114
  var import_picocolors = __toESM(require("picocolors"), 1);
115
115
 
116
116
  // package.json
117
- var version = "3.39.2";
117
+ var version = "3.39.4";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -13,8 +13,8 @@ import {
13
13
  } from "./chunk-K3ZVEX2Y.js";
14
14
  import {
15
15
  log_build_default
16
- } from "./chunk-2VUYMTYY.js";
17
- import "./chunk-EC633RFS.js";
16
+ } from "./chunk-O2CZERUN.js";
17
+ import "./chunk-ONQOIF2X.js";
18
18
  import "./chunk-4UVFXLPI.js";
19
19
  import {
20
20
  catalogToAstro
@@ -28,13 +28,13 @@ import {
28
28
  } from "./chunk-ULZYHF3V.js";
29
29
  import {
30
30
  generate
31
- } from "./chunk-Z3G6IPPF.js";
31
+ } from "./chunk-PVOVC2UV.js";
32
32
  import {
33
33
  logger
34
- } from "./chunk-K2IR7X4Z.js";
34
+ } from "./chunk-NSR4DZXS.js";
35
35
  import {
36
36
  VERSION
37
- } from "./chunk-4NHSANWO.js";
37
+ } from "./chunk-WLUQZCIH.js";
38
38
  import {
39
39
  getEventCatalogConfigFile,
40
40
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.39.2";
81
+ var version = "3.39.4";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-Z3G6IPPF.js";
4
- import "./chunk-K2IR7X4Z.js";
5
- import "./chunk-4NHSANWO.js";
3
+ } from "./chunk-PVOVC2UV.js";
4
+ import "./chunk-NSR4DZXS.js";
5
+ import "./chunk-WLUQZCIH.js";
6
6
  import "./chunk-5T63CXKU.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.39.2";
39
+ var version = "3.39.4";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-K2IR7X4Z.js";
4
- import "../chunk-4NHSANWO.js";
3
+ } from "../chunk-NSR4DZXS.js";
4
+ import "../chunk-WLUQZCIH.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -49,10 +49,11 @@ const getMessageIcon = (collection: string) => {
49
49
  const EntityBadge = memo(({ entity }: { entity: any }) => {
50
50
  const id = entity?.data?.id || entity?.id;
51
51
  const name = entity?.data?.name || entity?.name || id;
52
+ const version = entity?.data?.version || entity?.version || 'latest';
52
53
 
53
54
  return (
54
55
  <a
55
- href={buildUrl(`/docs/entities/${id}`)}
56
+ href={buildUrl(`/docs/entities/${id}/${version}`)}
56
57
  className="inline-flex items-center gap-2 px-3 py-2 bg-[rgb(var(--ec-card-bg,var(--ec-page-bg)))] border border-[rgb(var(--ec-page-border))] rounded-lg text-sm font-medium text-[rgb(var(--ec-page-text))] hover:bg-[rgb(var(--ec-content-hover))] hover:border-[rgb(var(--ec-accent)/0.5)] transition-all shadow-xs"
57
58
  >
58
59
  <BoxIcon className="h-4 w-4 text-[rgb(var(--ec-accent))]" />
@@ -5,6 +5,7 @@ import { ArrowDownIcon, ArrowUpIcon, EllipsisVerticalIcon, StarIcon } from '@her
5
5
  import { buildUrl } from '@utils/url-builder';
6
6
  import { getColorAndIconForCollection } from '@utils/collections/icons';
7
7
  import { getCollectionTextColorClass } from '@utils/collection-colors';
8
+ import { getBadgeReactStyle } from '@utils/badge-styles';
8
9
  import { isIconPath, resolveIconUrl } from '@utils/icon';
9
10
  import { useStore } from '@nanostores/react';
10
11
  import { favoritesStore, toggleFavorite, type FavoriteItem } from '../../../stores/favorites-store';
@@ -28,6 +29,7 @@ const BadgesCell = ({ badges }: { badges: Array<{ content: string; backgroundCol
28
29
  <span
29
30
  key={`${badge.content}-${index}`}
30
31
  className="inline-flex items-center px-2 py-0.5 text-[11px] font-normal rounded-md max-w-[140px] truncate border border-[rgb(var(--ec-page-border))] text-[rgb(var(--ec-page-text-muted))] bg-transparent"
32
+ style={getBadgeReactStyle(badge)}
31
33
  title={badge.content}
32
34
  >
33
35
  {badge.content}
@@ -1,5 +1,6 @@
1
1
  import { createColumnHelper } from '@tanstack/react-table';
2
2
  import { useState } from 'react';
3
+ import { getBadgeReactStyle } from '@utils/badge-styles';
3
4
  import { filterByBadge } from '../filters/custom-filters';
4
5
  import type { TCollectionTypes, TData } from '../Table';
5
6
  import type { TableConfiguration } from '@types';
@@ -27,6 +28,7 @@ export const createBadgesColumn = <T extends { data: Pick<TData<U>['data'], 'bad
27
28
  <span
28
29
  key={`${badge.id}-${index}`}
29
30
  className="inline-flex items-center px-2 py-0.5 text-xs font-medium rounded-md border border-[rgb(var(--ec-accent)/0.5)] text-[rgb(var(--ec-page-text))] bg-transparent"
31
+ style={getBadgeReactStyle(badge)}
30
32
  title={badge.content}
31
33
  >
32
34
  {badge.content}
@@ -9,6 +9,7 @@ import { buildUrl } from '@utils/url-builder';
9
9
  import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
10
10
  import { isEventCatalogChatEnabled, isResourceDocsEnabled } from '@utils/feature';
11
11
  import { getIcon } from '@utils/badges';
12
+ import { getBadgeStyle } from '@utils/badge-styles';
12
13
  import { collectionToResourceMap } from '@utils/collections/util';
13
14
 
14
15
  import { Page } from './_index.data';
@@ -83,13 +84,12 @@ const pagefindAttributes =
83
84
  <span
84
85
  class={`
85
86
  inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
86
- bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
87
+ ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
87
88
  text-[rgb(var(--ec-page-text))]
88
89
  `}
90
+ style={getBadgeStyle(badge)}
89
91
  >
90
- {badge.iconComponent && (
91
- <badge.iconComponent className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />
92
- )}
92
+ {badge.iconComponent && <badge.iconComponent className="w-4 h-4 flex-shrink-0" />}
93
93
  <span>{badge.content}</span>
94
94
  </span>
95
95
  ))}
@@ -9,6 +9,7 @@ import { buildUrl } from '@utils/url-builder';
9
9
  import { AlignLeftIcon, HistoryIcon } from 'lucide-react';
10
10
  import { isEventCatalogChatEnabled, isResourceDocsEnabled } from '@utils/feature';
11
11
  import { getIcon } from '@utils/badges';
12
+ import { getBadgeStyle } from '@utils/badge-styles';
12
13
  import { collectionToResourceMap } from '@utils/collections/util';
13
14
 
14
15
  import { Page } from './_index.data';
@@ -76,13 +77,12 @@ const pagefindAttributes =
76
77
  <span
77
78
  class={`
78
79
  inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
79
- bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
80
+ ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
80
81
  text-[rgb(var(--ec-page-text))]
81
82
  `}
83
+ style={getBadgeStyle(badge)}
82
84
  >
83
- {badge.iconComponent && (
84
- <badge.iconComponent className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />
85
- )}
85
+ {badge.iconComponent && <badge.iconComponent className="w-4 h-4 flex-shrink-0" />}
86
86
  <span>{badge.content}</span>
87
87
  </span>
88
88
  ))}
@@ -15,6 +15,7 @@ import mdxComponents from '@components/MDX/components';
15
15
  import 'diff2html/bundles/css/diff2html.min.css';
16
16
 
17
17
  import { buildUrl } from '@utils/url-builder';
18
+ import { getBadgeStyle } from '@utils/badge-styles';
18
19
  import { getPreviousVersion } from '@utils/collections/util';
19
20
  import { getDiffsForCurrentAndPreviousVersion } from '@utils/file-diffs';
20
21
  import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
@@ -71,27 +72,29 @@ const logListPromise = logsToRender.map(async (log, index) => {
71
72
 
72
73
  const logList = await Promise.all(logListPromise);
73
74
 
75
+ const createResourceBadge = (content: string, icon: any) => ({ content, icon, textColor: 'gray' });
76
+
74
77
  const getBadge = () => {
75
78
  if (props.collection === 'services') {
76
- return { badgeType: 'service', content: 'Service', icon: ServerIcon };
79
+ return createResourceBadge('Service', ServerIcon);
77
80
  }
78
81
  if (props.collection === 'events') {
79
- return { badgeType: 'event', content: 'Event', icon: BoltIcon };
82
+ return createResourceBadge('Event', BoltIcon);
80
83
  }
81
84
  if (props.collection === 'commands') {
82
- return { badgeType: 'command', content: 'Command', icon: ChatBubbleLeftIcon };
85
+ return createResourceBadge('Command', ChatBubbleLeftIcon);
83
86
  }
84
87
  if (props.collection === 'queries') {
85
- return { badgeType: 'query', content: 'Query', icon: MagnifyingGlassIcon };
88
+ return createResourceBadge('Query', MagnifyingGlassIcon);
86
89
  }
87
90
  if (props.collection === 'domains') {
88
- return { badgeType: 'domain', content: 'Domain', icon: RectangleGroupIcon };
91
+ return createResourceBadge('Domain', RectangleGroupIcon);
89
92
  }
90
93
  if (props.collection === 'containers') {
91
- return { badgeType: 'default', content: 'Container', icon: DatabaseIcon };
94
+ return createResourceBadge('Container', DatabaseIcon);
92
95
  }
93
96
  if (props.collection === 'flows') {
94
- return { badgeType: 'design', content: 'Flow', icon: QueueListIcon };
97
+ return createResourceBadge('Flow', QueueListIcon);
95
98
  }
96
99
  };
97
100
 
@@ -141,8 +144,8 @@ const badges = [getBadge()];
141
144
  <div class="flex flex-wrap py-2 pt-4">
142
145
  {badges.map((badge: any) => (
143
146
  <span
144
- class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center"
145
- style={`background-color: rgb(var(--ec-badge-${badge.badgeType}-bg)); color: rgb(var(--ec-badge-${badge.badgeType}-text));`}
147
+ class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-transparent border border-[rgb(var(--ec-page-border))]"
148
+ style={getBadgeStyle(badge)}
146
149
  >
147
150
  {badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1" />}
148
151
  <span>{badge.content}</span>
@@ -192,7 +195,10 @@ const badges = [getBadge()];
192
195
  {log.badges && (
193
196
  <div class="flex flex-wrap">
194
197
  {log.badges.map((badge: any) => (
195
- <span class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]">
198
+ <span
199
+ class="text-sm font-medium px-2 py-1 rounded-md mr-2 space-x-1 flex items-center bg-[rgb(var(--ec-badge-default-bg))] text-[rgb(var(--ec-badge-default-text))]"
200
+ style={getBadgeStyle(badge)}
201
+ >
196
202
  {badge.icon && <badge.icon className="w-4 h-4 inline-block mr-1" />}
197
203
  <span>{badge.content}</span>
198
204
  </span>
@@ -7,6 +7,7 @@ import Footer from '@layouts/Footer.astro';
7
7
  import { Page } from './_[filename].data';
8
8
  import { getAbsoluteFilePathForAstroFile } from '@utils/files';
9
9
  import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
10
+ import { getBadgeStyle } from '@utils/badge-styles';
10
11
  import Admonition from '@components/MDX/Admonition';
11
12
 
12
13
  import { ServerIcon } from '@heroicons/react/24/outline';
@@ -36,14 +37,13 @@ if (isRemote) {
36
37
  const pageTitle = `${collection} | ${data.name} | GraphQL Schema`.replace(/^\w/, (c) => c.toUpperCase());
37
38
 
38
39
  const getServiceBadge = () => {
39
- return [{ backgroundColor: 'pink', textColor: 'pink', content: 'Service', icon: ServerIcon }];
40
+ return [{ textColor: 'gray', content: 'Service', icon: ServerIcon }];
40
41
  };
41
42
 
42
43
  const getGraphQLBadge = () => {
43
44
  return [
44
45
  {
45
- backgroundColor: 'purple',
46
- textColor: 'purple',
46
+ textColor: 'gray',
47
47
  content: 'GraphQL Schema',
48
48
  iconURL: buildUrl('/icons/graphql.svg', true),
49
49
  id: 'graphql-schema-badge',
@@ -88,13 +88,14 @@ const pagefindAttributes =
88
88
  id={badge.id || ''}
89
89
  class={`
90
90
  inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
91
- bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
91
+ ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
92
92
  text-[rgb(var(--ec-page-text))]
93
93
  shadow-xs
94
94
  ${badge.class ? badge.class : ''}
95
95
  `}
96
+ style={getBadgeStyle(badge)}
96
97
  >
97
- {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />}
98
+ {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0" />}
98
99
  {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
99
100
  <span>{badge.content}</span>
100
101
  </span>
@@ -34,6 +34,7 @@ import { getSpecificationsForService } from '@utils/collections/services';
34
34
  import { resourceToCollectionMap, collectionToResourceMap, getDeprecatedDetails } from '@utils/collections/util';
35
35
  import { getSchemasFromResource } from '@utils/collections/schemas';
36
36
  import { getIcon } from '@utils/badges';
37
+ import { getBadgeStyle } from '@utils/badge-styles';
37
38
  import { buildUrl, buildEditUrlForResource } from '@utils/url-builder';
38
39
  import { isIconPath, resolveIconUrl } from '@utils/icon';
39
40
  import {
@@ -72,102 +73,71 @@ const getContentBadges = () =>
72
73
  icon: badge.icon ? getIcon(badge.icon) : null,
73
74
  }));
74
75
 
76
+ const createResourceBadge = (content: string, icon: any) => ({ content, icon, textColor: 'gray' });
77
+
75
78
  const getBadge = () => {
76
79
  if (props.collection === 'services') {
77
- return [{ backgroundColor: 'pink', textColor: 'pink', content: 'Service', icon: ServerIcon }];
80
+ return [createResourceBadge('Service', ServerIcon)];
78
81
  }
79
82
  if (props.collection === 'events') {
80
- return [{ backgroundColor: 'orange', textColor: 'orange', content: 'Event', icon: BoltIcon }];
83
+ return [createResourceBadge('Event', BoltIcon)];
81
84
  }
82
85
  if (props.collection === 'commands') {
83
- return [{ backgroundColor: 'blue', textColor: 'blue', content: 'Command', icon: ChatBubbleLeftIcon }];
86
+ return [createResourceBadge('Command', ChatBubbleLeftIcon)];
84
87
  }
85
88
  if (props.collection === 'queries') {
86
- return [{ backgroundColor: 'green', textColor: 'green', content: 'Query', icon: MagnifyingGlassIcon }];
89
+ return [createResourceBadge('Query', MagnifyingGlassIcon)];
87
90
  }
88
91
  if (props.collection === 'domains') {
89
- return [
90
- {
91
- backgroundColor: 'yellow',
92
- textColor: 'yellow',
93
- content: 'Domain',
94
- icon: RectangleGroupIcon,
95
- },
96
- ];
92
+ return [createResourceBadge('Domain', RectangleGroupIcon)];
97
93
  }
98
94
 
99
95
  if (props.collection === 'flows') {
100
- return [{ backgroundColor: 'teal', textColor: 'teal', content: 'Flow', icon: QueueListIcon }];
96
+ return [createResourceBadge('Flow', QueueListIcon)];
101
97
  }
102
98
 
103
99
  if (props.collection === 'channels') {
104
- return [{ backgroundColor: 'teal', textColor: 'teal', content: 'Channel', icon: ArrowsRightLeftIcon }];
100
+ return [createResourceBadge('Channel', ArrowsRightLeftIcon)];
105
101
  }
106
102
 
107
103
  if (props.collection === 'containers') {
108
104
  const badges = [];
109
105
  const content = props.data.container_type?.charAt(0).toUpperCase() + props.data.container_type?.slice(1) || 'Database';
110
106
 
111
- badges.push({ backgroundColor: 'blue', textColor: 'blue', content: content, icon: DatabaseIcon });
107
+ badges.push(createResourceBadge(content, DatabaseIcon));
112
108
 
113
109
  if (props.data?.technology) {
114
- badges.push({
115
- backgroundColor: 'indigo',
116
- textColor: 'indigo',
117
- content: `${props.data.technology}`,
118
- icon: DatabaseZapIcon,
119
- });
110
+ badges.push(createResourceBadge(`${props.data.technology}`, DatabaseZapIcon));
120
111
  }
121
112
 
122
113
  if (props.data?.residency) {
123
- badges.push({
124
- backgroundColor: 'red',
125
- textColor: 'red',
126
- content: `Residency: ${props.data.residency}`,
127
- icon: MapIcon,
128
- });
114
+ badges.push(createResourceBadge(`Residency: ${props.data.residency}`, MapIcon));
129
115
  }
130
116
 
131
117
  if (props.data?.retention) {
132
- badges.push({
133
- backgroundColor: 'green',
134
- textColor: 'green',
135
- content: `Retention: ${props.data.retention}`,
136
- icon: ClockIcon,
137
- });
118
+ badges.push(createResourceBadge(`Retention: ${props.data.retention}`, ClockIcon));
138
119
  }
139
120
 
140
121
  if (props.data?.access_mode) {
141
- badges.push({
142
- backgroundColor: 'green',
143
- textColor: 'green',
144
- content: `Access Mode: ${props.data.access_mode}`,
145
- icon: ShieldCheckIcon,
146
- });
122
+ badges.push(createResourceBadge(`Access Mode: ${props.data.access_mode}`, ShieldCheckIcon));
147
123
  }
148
124
 
149
125
  return badges;
150
126
  }
151
127
 
152
128
  if (props.collection === 'entities') {
153
- const entityBadges = [{ backgroundColor: 'purple', textColor: 'purple', content: 'Entity', icon: Box, class: 'text-gray' }];
129
+ const entityBadges = [createResourceBadge('Entity', Box)];
154
130
  if (props.data.aggregateRoot) {
155
- entityBadges.push({
156
- backgroundColor: 'purple',
157
- textColor: 'purple',
158
- content: '(Aggregate Root)',
159
- icon: Boxes,
160
- class: 'text-gray',
161
- });
131
+ entityBadges.push(createResourceBadge('(Aggregate Root)', Boxes));
162
132
  }
163
133
  return entityBadges;
164
134
  }
165
135
 
166
136
  if (props.collection === 'data-products') {
167
- return [{ backgroundColor: 'indigo', textColor: 'indigo', content: 'Data Product', icon: Package }];
137
+ return [createResourceBadge('Data Product', Package)];
168
138
  }
169
139
 
170
- return [{ backgroundColor: 'teal', textColor: 'teal', content: '', icon: QueueListIcon, class: 'text-gray' }];
140
+ return [createResourceBadge('', QueueListIcon)];
171
141
  };
172
142
 
173
143
  const getSpecificationBadges = () => {
@@ -412,13 +382,14 @@ if (!hasCurrentFlowEmbed && !hasCurrentPageNodeGraph) {
412
382
  id={badge.id || ''}
413
383
  class={`
414
384
  inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium
415
- bg-[rgb(var(--ec-content-hover))] border border-[rgb(var(--ec-page-border))]
385
+ ${badge.backgroundColor ? 'bg-[rgb(var(--ec-content-hover))]' : 'bg-transparent'} border border-[rgb(var(--ec-page-border))]
416
386
  text-[rgb(var(--ec-page-text))]
417
387
  shadow-xs
418
388
  ${badge.class ? badge.class : ''}
419
389
  `}
390
+ style={getBadgeStyle(badge)}
420
391
  >
421
- {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0 text-[rgb(var(--ec-icon-color))]" />}
392
+ {badge.icon && <badge.icon className="w-4 h-4 flex-shrink-0" />}
422
393
  {badge.iconURL && <img src={badge.iconURL} class="w-4 h-4 flex-shrink-0 opacity-80" alt="" />}
423
394
  <span>{badge.content}</span>
424
395
  </span>
@@ -0,0 +1,67 @@
1
+ import type { CollectionTypes, PageTypes } from '@types';
2
+ import { HybridPage } from '@utils/page-loaders/hybrid-page';
3
+ import { pageDataLoader } from '@utils/page-loaders/page-data-loader';
4
+ import { isSSR } from '@utils/feature';
5
+
6
+ const itemTypes: PageTypes[] = [
7
+ 'events',
8
+ 'commands',
9
+ 'queries',
10
+ 'services',
11
+ 'domains',
12
+ 'flows',
13
+ 'channels',
14
+ 'entities',
15
+ 'containers',
16
+ 'data-products',
17
+ ];
18
+
19
+ export class Page extends HybridPage {
20
+ static async getStaticPaths() {
21
+ if (isSSR()) {
22
+ return [];
23
+ }
24
+
25
+ const allItems = await Promise.all(itemTypes.map((type) => pageDataLoader[type]({ getAllVersions: false })));
26
+
27
+ return allItems.flatMap((items, index) =>
28
+ items.map((item) => ({
29
+ params: {
30
+ type: itemTypes[index],
31
+ id: item.data.id,
32
+ },
33
+ props: {
34
+ type: itemTypes[index],
35
+ ...item,
36
+ },
37
+ }))
38
+ );
39
+ }
40
+
41
+ protected static async fetchData(params: any) {
42
+ const { type, id } = params;
43
+
44
+ if (!type || !id || !(type in pageDataLoader)) {
45
+ return null;
46
+ }
47
+
48
+ const items = await pageDataLoader[type as PageTypes]({ getAllVersions: false });
49
+ const item = items.find((entry) => entry.data.id === id);
50
+
51
+ if (!item) {
52
+ return null;
53
+ }
54
+
55
+ return {
56
+ type: type as CollectionTypes,
57
+ ...item,
58
+ };
59
+ }
60
+
61
+ protected static createNotFoundResponse(): Response {
62
+ return new Response(null, {
63
+ status: 404,
64
+ statusText: 'Documentation not found',
65
+ });
66
+ }
67
+ }