Giter Site home page Giter Site logo

boyney123 / eventcatalog Goto Github PK

View Code? Open in Web Editor NEW
1.4K 19.0 122.0 16.13 MB

Discover, Explore and Document your Event Driven Architectures powered by Markdown.

Home Page: https://eventcatalog.dev

License: MIT License

TypeScript 84.05% JavaScript 13.77% CSS 1.56% C# 0.45% Dockerfile 0.12% Shell 0.05%
eda event-driven events architecture ddd catalog documentation plugins

eventcatalog's Introduction

πŸ“– EventCatalog

Discover, Explore and Document your Event Driven Architectures.

MIT License PRs Welcome

All Contributors

Watch on GitHub Star on GitHub


header

Features: Website generator for Event Driven Architectures, Markdown driven, Document Events/Services/Schemas, Event Versioning, Event/Service Owners, Schema Changelogs, and more...

Read the Docs | Edit the Docs | View Demo


Core Features

  • πŸ”Ž Discover Events
  • πŸ“ƒ Document Events
  • πŸ“Š Visualise Events & Services
  • ⭐ Supports any Event Schema
  • πŸ—‚οΈ Code Examples (Any Language)
  • πŸ—„οΈ Event and Schema Versioning
  • πŸ“‘ Event changelogs
  • ⭐ And much more...

All powered by markdown

The problem

Event-Driven Architectures allow us to scale, be agile and keep our architecture decoupled.

When starting off with Event-Driven Architectures we spend time discovering our core business events, writing code to match them and maintain versions going forward.

Over a period of time more events are added to our domain, requirements change, and our architecture scales.

As more events, services and schemas get added to our domains they can be hard for our teams to discover and explore.

Discovery and documentation is a key part to scalable Event Driven Architecture and EventCatalog helps you maintain documentation for them.

EventCatalog was built to help document your EDA and help your teams explore and understand events, schemas and much more.

Read more on these blogposts:

This solution

Think of EventCatalog as a website generator that allows you to document your event architectures with markdown files.

Markdown files are quite a popular tool to help us document content, so why not use markdown files to document our events, services and schemas?

EventCatalog is focused on discovery and documentation and allows you to:

  • Document Events/Schemas/Code Examples and more...
  • Visually shows relationships between upstream/downstream services using your Events
  • Allows you to version your documentation and supports changelogs
  • Add owners to events and services so your teams know who owns which parts of your domain
  • And much more...

EventCatalog is technology agnostic, which means you can integrate the Catalog with any EDA technology of your choice and any schema format.

EventCatalog supports a Plugin Architecture which will let you generate documentation from your systems.

You can read more on how it works on the website

Getting Started

You should be able to get setup within minutes if you head over to our documentation to get started πŸ‘‡

➑️ Get Started

Or run this command to build a new catalog

npx @eventcatalog/create-eventcatalog@latest my-catalog

Demo

Here is an example of a Retail system using events and services. Everything you see is driven by markdown files

app.eventcatalog.dev

You can see the markdown files that generated the website in the GitHub repo under examples.

Contributing

If you have any questions, features or issues please raise any issue or pull requests you like. We will try my best to get back to you.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

David Boyne
David Boyne

πŸ’» πŸ–‹ 🎨 πŸ’‘ πŸ€” πŸ“–
Benjamin Otto
Benjamin Otto

πŸ’» πŸ€” πŸ“– πŸ›
Tiago Oliveira
Tiago Oliveira

πŸ“– πŸ›
Jay McGuinness
Jay McGuinness

πŸ“–
David Khourshid
David Khourshid

πŸ“–
thim81
thim81

πŸ€” πŸ› πŸ’»
Muthu
Muthu

πŸ›
Dan Tavelli
Dan Tavelli

πŸ“–
steppi91
steppi91

πŸ“–
Donald Pipowitch
Donald Pipowitch

πŸ› πŸ’»
Ken
Ken

πŸ“–
Rodolfo Toro
Rodolfo Toro

πŸ’»
Drew Marsh
Drew Marsh

πŸ’»
Dec Kolakowski
Dec Kolakowski

πŸ’» πŸ“–
Yevhenii Dytyniuk
Yevhenii Dytyniuk

πŸ’»
lcsbltm
lcsbltm

πŸ’»
Matt Martz
Matt Martz

πŸ’»
Michel Grootjans
Michel Grootjans

πŸ’»
Arturo Abruzzini
Arturo Abruzzini

πŸ’»
Ad L'Ecluse
Ad L'Ecluse

πŸ’»
Rafael Renan Pacheco
Rafael Renan Pacheco

πŸ’» πŸ“–
Luis Diego
Luis Diego

πŸ’»
Daniel Ruf
Daniel Ruf

πŸ“–
Fredrik Johansson
Fredrik Johansson

πŸ’»
Naresh Kumar Reddy Gaddam
Naresh Kumar Reddy Gaddam

πŸ’»
Andre Deutmeyer
Andre Deutmeyer

πŸ’»
Pebbz
Pebbz

πŸ’»
Alexander Holbreich
Alexander Holbreich

πŸ“–
JosΓ© Delgado
JosΓ© Delgado

πŸ’»
jlee-spt
jlee-spt

πŸ’»
Kim RejstrΓΆm
Kim RejstrΓΆm

πŸ’»
Christophe Gabard
Christophe Gabard

πŸ’»
Carlo Bertini
Carlo Bertini

πŸ’»
David Regla
David Regla

πŸ’»
Marcio Vinicius
Marcio Vinicius

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Sponsor

If you like what you see, feel free to sponsor the project.

License

MIT.

eventcatalog's People

Contributors

adlecluse avatar aholbreich avatar allcontributors[bot] avatar arturoabruzzini avatar boyney123 avatar cgabard avatar danielruf avatar davidkpiano avatar donaldpipowitch avatar dpwdec avatar dreglad avatar dremonkey avatar drub0y avatar dylanwatsonsoftware avatar frenkan avatar github-actions[bot] avatar jaymcguinness avatar jslim avatar kimrejstrom avatar kzhen avatar ldiego73 avatar linas-ipxo avatar michelgrootjans avatar otbe avatar pebbz avatar rafaelrenanpacheco avatar rtoro avatar tavelli avatar thim81 avatar waydotnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eventcatalog's Issues

pages and events index.html generation

Have you read the Contributing Guidelines on issues?

Description

i'm not sure where this is configured but when build is run the index.html pages for events and services are not being placed correctly in their respective subfolders. instead they are created at root of site. this causes site to break if you try to refresh or deeplink to /events/ and /services/ paths which are used in main site navigation.

Steps to reproduce

  1. run npm run build commands
  2. check /out folder

Expected behavior

/out/events/index.html
/out/services/index.html

Actual behavior

/out/events.html
/out/services.html

Ability to version services (like we can events)

Have you read the Contributing Guidelines on issues?

Description

Users can version events using the versioned folder syntax.

I think we should also allow users to version services and they can also be versioned. Should work the same as the events, similar pattern.

Motivation

Allowing people to version services should allow them to keep historic information about services, and how they have evolved over time.

Eventbridge plugin rules and targets incomplete

Have you read the Contributing Guidelines on issues?

Description

When running the eventbridge generator, all events get documented as expected. But the rules and targets, do not get published to the document as expected. Only the last event in the events list is published.

Steps to reproduce

  1. setup the asyncgenerator with eventrbridge plugin
  2. make sure there are more than one event with rules and triggers for each
  3. run npm run generate
  4. observer that not all event documentation will have rules and targets (only one would have it)

Expected behavior

All events with rules and triggers should get documented in the index.md files

Actual behavior

Not all event documentation will have rules and targets (only one would have it)

Your environment

  • EventCatalog version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS)
    Screen Shot 2022-01-28 at 5 18 58 PM
    :

Support Versions for Services

Like events it would be nice if we could version the services too.

Services will adapt over time and would be great to give users the ability to version them like we can events.

Some ideas

  • Add version to the service markdown files
  • Implement the versioned directory like events
  • New page that loads the services

Link to external event documentation

Have you read the Contributing Guidelines on issues?

Description

Currently the application can display an Event Schema (JSON schema representation), Mermaid charts & Code Examples.

It would also be nice to include a link to external documentation on the event.

It could be a property as part of the event configuration (frontmatter), which generates a "link" in the sidebar.

---
name: UserSignedUp
version: 0.0.1
summary: |
  Tells us when the user has signed up
consumers:
    - Email Platform
producers:
    - User Service
links:
   - link: 
     - name: Public documentation
     - url: http://example.com/event/marco-polo#event-x
---

Motivation

Since EventCatalog is an excellent hub to centralise and visualise events, making it easy to reference "external documentation" will help centralising and cross-referencing of documentations + it will be help searchability & seo.

npm run build triggers error

Have you read the Contributing Guidelines on issues?

Description

When running npm run build in the root of the project, this error occurs.

$ tsc
error TS5055: Cannot write file '/Users/Sites/eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/index.d.ts' because it would overwrite input file.
error TS5055: Cannot write file '/Users/Sites/eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/lib/aws.d.ts' because it would overwrite input file.
error TS5055: Cannot write file '/Users//eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/markdown.d.ts' because it would overwrite input file.
error TS5055: Cannot write file '/Users/tes/eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/types.d.ts' because it would overwrite input file.

Steps to reproduce

  1. goto the root folder of the project
  2. yarn install
  3. npm run build

Expected behavior

build runs as expected, so that we can compile the asyncapi-plugin.

Actual behavior

When running npm run build in the root of the project, this error occurs.

$ tsc
error TS5055: Cannot write file '/Users/Sites/eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/index.d.ts' because it would overwrite input file.
error TS5055: Cannot write file '/Users/Sites/eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/lib/aws.d.ts' because it would overwrite input file.
error TS5055: Cannot write file '/Users//eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/markdown.d.ts' because it would overwrite input file.
error TS5055: Cannot write file '/Users/tes/eventcatalog/packages/eventcatalog-plugin-generator-amazon-eventbridge/lib/types.d.ts' because it would overwrite input file.

Your environment

  • EventCatalog version used: 0.0.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): NodeJS 17.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Mac Big Sur

Visualiser does not persist new source to query params

Have you read the Contributing Guidelines on issues?

Description

The new visualiser allows to jump in via a pre selected source (event/service) via query params but while switching between events/service it does not persist the selected entity to the query params.

It would be nice to do this in order to be able to share a link to a proper view.

Steps to reproduce

  • go to visualiser
  • select something
  • query params are not added/updated

Expected behavior

Should persist it

Actual behavior

Does not persist it.

Your environment

  • EventCatalog version used: 0.1.17
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Links to services are broken on Event detail pages

Have you read the Contributing Guidelines on issues?

Description

Links are broken if service is not part of a domain.

Expected behavior

/services/foo-service/

Actual behavior

/domains/null/services/foo-service/

Your environment

  • EventCatalog version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

favicon docs missing

Have you read the Contributing Guidelines on issues?

Description

In the customise docs it explains that you can set a favicon, but you cannot define it in the eventcatalog.config.js or it is not documented how to set it?

Steps to reproduce

Read customise docs
Include a favicon.ico in the "public" folder

Expected behavior

The favicon would be used automatically OR I have the option to define it in the eventcatalog.config.js

Actual behavior

no favicon is set

Your environment

  • EventCatalog version used: eventCatalog 0.1.2
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): NodeJS 17.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Mac Big Sur

Allow setting nextjs "trailingSlash" option

Have you read the Contributing Guidelines on issues?

Description

Depending on your deployment solution it would be nice (necessary) to have the pages generated a little bit different.

Right now you will get this output with the default settings:
Screenshot 2022-01-26 at 13 18 16

As you can see it generates a AddedItemToCart.html file and a AddedItemToCart folder. Thats fine as long as your hosting solution supports this kind of stuff. In Gitlab Pages its somehow supported. It will work until you hit F5. That means, If you navigate to /events/AddedItemToCart it works but if you hit F5 it will add a trailing slash /events/AddedItemToCart/ and present a 404 page because theres no index.html within the folder.

If we allow the user to set the trailingSlash option to true the output will look like this:
Screenshot 2022-01-26 at 13 17 12

This is going to work on Gitlab pages even after hitting F5.

Motivation

Would love to able to deploy it to Gitlab pages :)

feat: show event examples

Have you read the Contributing Guidelines on issues?

Description

Currently the application can display an Event Schema (JSON schema representation) and Code Examples.

It would also be nice to show an example of the "event" itself, especially if the event is in a JSON or non-binary format.
Where you see the "Event Schema" and the "Event Example" next to each other.

Example: https://redocly.github.io/redoc/#tag/pet

2022-01-12 at 14 09 50

Motivation

A common use-case for event documentation, is to have an actual example that makes the documentation and event very visual. An event schema describes the properties and the details on these properties. An event example shows the event content/data.

Edit links are broken

Have you read the Contributing Guidelines on issues?

Description

Edit links on various pages are broken because they are built using path.join which does not work properly for URLs.

Steps to reproduce

  1. Put an editUrl into config like https://github.com/drub0y/myEventCatalog/edit/master
  2. Publish your site anywhere (including localhost)
  3. Click an edit button
  4. Observe that an incorrect URL is built like: http://localhost:3000/github.com/drub0y/myEventCatalog/services/MyService/index.md

Expected behavior

I expect the edit URL to be built correctly as: https://github.com/drub0y/myEventCatalog/edit/master/services/MyService/index.md.

Actual behavior

Builds wrong URL that ends up going to a 404.

Your environment

  • EventCatalog version used: 0.2.14
  • Environment name and version: node v16.14.0, any browser
  • Operating system and version: OSX 12.3.1

Upgrading eventcatalog-core does not show changes

Describe the bug
When you have a version of eventcatalog-core and you update the package the changes are not shown in the UI.

To Reproduce

  • bumped packages.json "@eventcatalog/core": "0.0.1",
  • npm install
  • npm run dev

To Fix

  • remove ".next" folder
  • bumped packages.json "@eventcatalog/core": "0.0.1",
  • npm install
  • npm run dev

The problem

EventCatalog uses NextJS under the hood, and the .next folder is still in the .eventcatalog-core folder which is already cached and built from a previous build.

We would need to check and remove this file when new versions are installed which forces next to rebuild itself from the updated core version.

Links in NodeGraphs do not take domains into account

Have you read the Contributing Guidelines on issues?

Description

Clicking on a node in a NodeGraph that shows services and events that belong to domains links to top-level services and events directories rather than domains/<domain>/services and domains/<domain>/events directories.

Steps to reproduce

  1. Create a domain
  2. Add a service that produces an event
  3. Click on the Visualizer
  4. Click on the event created in step 2 that belongs to the domain
  5. Get a 404 because it goes to /events/<event-name> rather than /domains/<domain>/events/<event-name>

Expected behavior

Should navigate to the /domains/<domain>/events/<event-name> documentation.

Actual behavior

Navigates to the /events/<event-name> resulting in a 404 not found.

Your environment

  • EventCatalog version used: 0.2.14

JSON diff in chnagelog view can be larger than viewport

Have you read the Contributing Guidelines on issues?

Description

I recently noticed that if you have a longer description somewhere in the JSON schema it will expand the "diff" view infinitely.

Steps to reproduce

Screenshot 2022-02-07 at 19 05 57

Repro: https://github.com/otbe/eventcatalog-playground

Expected behavior

It should wrap the lines at some point I guess

Actual behavior

You have to scroll horizontally a lot :D

Your environment

  • EventCatalog version used: 0.1.14

Domains with events folders cause console error when starting the catalog

Have you read the Contributing Guidelines on issues?

Description

If you add a domains folder and a new domain without an events folder within it, the catalog will fail to start

Error: Command failed: PROJECT_DIR=/eventcatalog/examples/basic npm run scripts:move-schema-for-download

This is because move-schema-for-download script expects the events folder for domains to be there.

Suggested fix would be checking the events folder if it exists before continuing.

Steps to reproduce

  1. Add new domain without events
  2. Try and run the project

Expected behavior

Suggested fix would be checking the events folder if it exists before continuing.

Actual behavior

Suggested fix would be checking the events folder if it exists before continuing.

Your environment

  • EventCatalog version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

eventcatalog generate seems to do nothing

Have you read the Contributing Guidelines on issues?

Description

I created a new project via npx @eventcatalog/create-eventcatalog@latest my-dir

If I add a custom generator plugin and try to run npm run generate it seems to do nothing at all.

Output is

$ npm run generate           

> [email protected] generate
> eventcatalog generate


> @eventcatalog/[email protected] generate
> node scripts/generate.js

If I run the script manually via
PROJECT_DIR=/my-dir node node_modules/@eventcatalog/core/scripts/generate.js it also does nothing until I remove the if at https://github.com/boyney123/eventcatalog/blob/master/packages/eventcatalog/scripts/generate.js#L22

Afterwards the manual approach works

$ PROJECT_DIR=/my-dir node node_modules/@eventcatalog/core/scripts/generate.js
Generating EventCatalog docs using: my-plugin-

but npm run generate still does nothing.

Steps to reproduce

Not quite sure whats the most easy solution.

Expected behavior

Will run my generator.

Actual behavior

Does not run anything

Your environment

  • EventCatalog version used: 0.0.9
  • Environment name and version: Node.js 17.3
  • Operating system and version: macOs 12.1 on M1 mac

Testing

This is my first project idea

Build failure

Have you read the Contributing Guidelines on issues?

Description

Not able to run 'npm run build' successfully after adding the plugin 'plugin-generator-amazon-eventbridge'

npm run build

[email protected] build
eventcatalog build

@eventcatalog/[email protected] scripts:move-schema-for-download
node scripts/move-schemas-for-download.js

@eventcatalog/[email protected] build
next build && next export

Failed to compile.

./components/Sidebars/EventSidebar.tsx:39:43
Type error: Type 'Service' is not assignable to type 'Key'.

37 |


    38 | {producers.map((producer) => (

    39 |


  • | ^
    40 | <Link href={/services/${producer}}>
    41 |
    42 |

    info - Checking validity of types .Error: Command failed:

  • Steps to reproduce

    npm run build

    Expected behavior

    Build should be successfull

    Actual behavior

    Build is getting failed.

    Your environment

    eventcatalog.config.js configuration

    module.exports = {
    title: 'EventCatalog',
    tagline: 'Discover, Explore and Document your Event Driven Architectures',
    projectName: 'Event Catalog',
    editUrl: '',
    trailingSlash: true,
    logo: {
    alt: 'EventCatalog Logo',
    // found in the public dir
    src: 'logo.svg',
    },
    footerLinks: [],
    users: [],
    generators: [
    [
    '@eventcatalog/plugin-doc-generator-amazon-eventbridge',
    {
    eventBusName: '', // your event bus name
    region: 'us-east-1', // your region
    registryName: 'discovered-schemas', // your registry normally "discovered-schemas"
    credentials: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
    sessionToken: process.env.AWS_SESSION_TOKEN // optional
    },
    },
    ],
    ],
    }

Support "domains" for events and services

Be great to support domains for events and services and maybe even a new page that shows users their domains where they can see services and matching events within that domain.

Questions we need to think about

  • Can events/services belong in more than 1 domain?
  • Can events/services only have 1 domain?
  • Where should we store the domain? Guess the events and service can have a new property called domain.

Any ideas/thoughts anyone?

Be good to get some ideas going on this one.

Some css is lost during production build

Have you read the Contributing Guidelines on issues?

Description

If we run npm run build a production build&export will be generated. This works quite nice except for some css classes.

Example would be <Admonition type="warning"/>. In dev mode you will get a nice little yellow box, in the exported version its just a gray box. My assumption would be the class is somehow eliminated by DCE.

Steps to reproduce

Use <Admonition type="warning"/> somewhere and export the catalog.

Expected behavior

Box should be still yellow

Actual behavior

Its just gray :D

Your environment

  • EventCatalog version used: 0.1.1

npm run build error - core 0.1.5

Have you read the Contributing Guidelines on issues?

Description

@eventcatalog/[email protected] build
next build && next export

warn - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info - Checking validity of types...
It looks like you're trying to use TypeScript but do not have the required package(s) installed.

Please install @types/node by running:

npm install --save-dev @types/node

If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).

Error: Command failed: cross-env PROJECT_DIR=/home/vsts/work/1/s/event-catalog npm run build
at checkExecSyncError (node:child_process:826:11)
at execSync (node:child_process:900:15)
at Command. (/home/vsts/work/1/s/event-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:60:5)
at Command.listener [as _actionHandler] (/home/vsts/work/1/s/event-catalog/node_modules/commander/index.js:922:31)
at Command._parseCommand (/home/vsts/work/1/s/event-catalog/node_modules/commander/index.js:1503:14)
at Command._dispatchSubcommand (/home/vsts/work/1/s/event-catalog/node_modules/commander/index.js:1443:18)
at Command._parseCommand (/home/vsts/work/1/s/event-catalog/node_modules/commander/index.js:1460:12)
at Command.parse (/home/vsts/work/1/s/event-catalog/node_modules/commander/index.js:1292:10)
at run (/home/vsts/work/1/s/event-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:115:7)
at Object. (/home/vsts/work/1/s/event-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:122:1) {

Steps to reproduce

Do a clean install and try to run npm run build

Expected behavior

Succesfully build event catalog

Actual behavior

see the error in the description

Your environment

  • EventCatalog version used: 0.1.5
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): NodeJS 16.0
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Ubuntu 20.04.2 LTS

Mermaid diagrams don't respect domains when clicking services / events

Have you read the Contributing Guidelines on issues?

Description

When clicking on nodes within a mermaid diagram it tries to redirect you to the event / service however it doesn't respect the domain for that event / service.

event catalog

Steps to reproduce

  1. In a catalog with events and services that are in domains.
  2. Add a mermaid diagram to a service or event that that refers to another event or service in the same or different domain.
  3. Navigate to the mermaid diagram you just added.
  4. Click on one of the nodes.

Expected behavior

The redirection respects whether or not that event / service is in a domain.

Actual behavior

You are redirected but the url doesn't respect the domain.

Your environment

  • EventCatalog version used: 0.2.9

Long event names are getting cut on events page

Have you read the Contributing Guidelines on issues?

Description

For example
Screenshot 2022-01-22 at 14 11 19

Steps to reproduce

Having really long event names :)

Expected behavior

Thats a really good question. Im not quite sure maybe we should break them and continue on the next line.

Actual behavior

Its getting cut off by the event cards.

Your environment

  • EventCatalog version used: 0.0.12

Event is missing from Service detail page if it is not the most recent version

Have you read the Contributing Guidelines on issues?

Description

Imagine I have a service myService and it subscribes to two events eventA and eventB. Both events have versions (lets say for both version 1 and version 2).

If I add myService to the list of consumers for eventA version 2 (latest) and for eventB version 1, only eventA will be shown in the service overview.

If I navigate to the specific version of eventB my service is shown. I think this behaviour is fine for the event view itself but all events should be listed on the service view.

What do you think about it?
Screenshot 2022-01-19 at 08 28 11
Screenshot 2022-01-19 at 08 28 28

Steps to reproduce

https://github.com/otbe/eventcatalog-playground

Expected behavior

All events are shown in the service overview (that my service subscribes to/publishes).

Actual behavior

Only the most recent events are shown. If a service subscribes to an old version its not listed in the service overview.

Your environment

  • EventCatalog version used: 0.0.9

Support External Schema References

Have you read the Contributing Guidelines on issues?

Description

Support external references within JSON schemas for events

Motivation

This would be useful for events that share some common properties. For example, we have a "Timestamps" object that we attach to every event, and ideally we could reference an external (local) file instead of duplicating it into each individual event schema

AsyncAPI Generator does not parse relative message paths correctly.

Have you read the Contributing Guidelines on issues?

Description

The AsyncAPI Event Catalog generator does not correctly parse relative $ref file paths between APIs and message schemas. Instead it processes the $ref paths relative to the .eventcatalog-core folder.

Steps to reproduce

  1. Add an asyncapi file in a surface area folder (in this example called docs with a $ref to a message in a different location in that folder.
# api_1.yaml
# --- snip ---
publish:
    message:
        $ref: ../../../schemas/message_2.yaml
  1. Add the $ref'd message file.

  2. Run the parser.

The final set up should look something like this, but the paths are arbitrary really, as long as it doesn't exactly match how .eventcatalog-core structure works. This is very likely in real life scenarios for API parsing considering there is no standard for organising the AsyncAPI files on a file system.

docs
β”œβ”€β”€ spec
|   └── services
|       └── apis
|           └──api_1.yaml
|   
└── schemas
    └── message_2.yaml

Expected behavior

The $ref paths are parsed relative to where the original AsyncAPI file is located.

Actual behavior

The $ref path does not resolve correctly because these paths are parsed by the generator relative to the .eventcatalog-core folder.

So for an actual surface area representation to be parsed correctly all of the relative $ref paths need to be updated before generation.

In the above example the path would have to change to ../docs/schemas/message_2.yaml to come out of the .eventcatalog-core folder and down into the spec/schemas directory to find the correct message linked to this API.

Your environment

  • EventCatalog version used: 0.2.10
  • EventCatalog pluging-doc-generator-asyncapi version used: 0.0.0-2022030192614
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): macOS Catalina

Scrolling on the 3D graph page is kinda broken

Have you read the Contributing Guidelines on issues?

Description

Since scroll is used to zoom in/out the 3D graph, if I try to scroll to the footer, I can't because it "thinks" I want to zoom out. Same if I manage to get to the footer and want to scroll back up.

Steps to reproduce

Go to the 3D graph and try scrolling past the graph (e.g., the footer).

Expected behavior

I can easily scroll up and down without zooming in/out.

Actual behavior

It zooms in/out and doesn't let me scroll.

Your environment

  • EventCatalog version used: demo online
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Latest Firefox.
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Latest Mac OS X.

DS_Store files created by finder on mac result in Server Errors

Have you read the Contributing Guidelines on issues?

Description

After opening a folder on MacOS using their Finder program, it creates .DS_Store files automatically.
When starting the server and browsing to a directory (events, services or event the homepage) a "Server Error" is shown:

Steps to reproduce

  1. Open one of the program directories, can be the root or events, services,... using Finder
  2. Start the server (npm run dev)
  3. A crash occurs when viewing the page associated with a folder containing a .DS_Store file.

Expected behavior

No crash should occur even if there is a .DS_Store file, these files should be ignored.

Actual behavior

Server Error

Error: ENOTDIR: not a directory, open '/Users/harm/Projects/cashless-pay/docs/event-catalog/events/.DS_Store/index.md'
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Source
Object.openSync
node:fs (585:3)
Object.readFileSync
node:fs (453:35)

lib/file-reader.ts (19:15) @ readMarkdownFile

  17 | 
  18 | export const readMarkdownFile = (pathToFile: string) => {
> 19 |   const file = fs.readFileSync(pathToFile, {
     |               ^
  20 |     encoding: 'utf-8',
  21 |   });
  22 |   return matter(file);

Call Stack
eval
lib/events.ts (136:38)
Array.map
<anonymous>
getAllEvents
lib/events.ts (135:17)
getStaticProps
pages/events.tsx (252:29)
Object.renderToHTML
file:/Users/harm/Projects/cashless-pay/docs/event-catalog/node_modules/next/dist/server/render.js (442:26)
async doRender
file:/Users/harm/Projects/cashless-pay/docs/event-catalog/node_modules/next/dist/server/base-server.js (855:38)
async
file:/Users/harm/Projects/cashless-pay/docs/event-catalog/node_modules/next/dist/server/base-server.js (950:28)

Your environment

  • EventCatalog version used: 0.0.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): node 8.3.1, firefox 97
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): MacOS 12.2.1

Changelog page always shows "EmailSent" as title

Have you read the Contributing Guidelines on issues?

Description

Changelog page always shows "EmailSent" as title

Steps to reproduce

Statrting from npx @eventcatalog/create-eventcatalog@latest my-catalog and have a look at AddedItemToCart

Expected behavior

Should show the name of the event .

Actual behavior

Shows a static "EmailSent" event name. Its also in the docs.
https://eventcatalog.dev/docs/events/versioning

Your environment

  • EventCatalog version used: 0.0.8

Ability to generate AsyncAPI file from Docs (Services and Events)

Have you read the Contributing Guidelines on issues?

Description

EventCatalog allows you to define your event and services using markdown.

With the new plugin system (Coming) you can generate these docs using various tools (think spec first > docs, or code > docs).

What about docs > spec?

For example, if people have events and services documented and maybe schemas, then there should be no real reason why we can't generate AsyncAPI specs from this?

Maybe add a button on the UI that generates the spec file?

Motivation

Give people another option to get value from their docs into spec files.

With AsyncAPI you can do all sorts, like generate models, applications etc.

Visualiser produces UI glitch

Have you read the Contributing Guidelines on issues?

Description

If you have longer event names the visualiser tends to produce nodes that overlap each other.
Interestingly this only happens if you switch between events/service, if you jump in via query params the result looks good.

Steps to reproduce

Have events with very long names.
See https://github.com/otbe/eventcatalog-playground/tree/visualiser

Expected behavior

Should render a nicely view in every case :)

Actual behavior

Direct access via query params:
Screenshot 2022-02-09 at 21 40 37

Selected via menu
Screenshot 2022-02-09 at 21 40 46

This is a simple example. In our case it also happens that nodes overlaps each other more than half.

Your environment

  • EventCatalog version used: 0.1.17

Allow EventCatalog to handle catalogs without Services

Have you read the Contributing Guidelines on issues?

Description

EventCatalog will start and render without any service folders, but the UI still has buttons and icons that will try and load them.

Steps to reproduce

  1. Create a new catalog
  2. Remove the services folder
  3. Load the UI and try click on the services link in the navigation.
  4. UI breaks.

Expected behavior

The services links and buttons should only render if the user has services to render in the application.

Actual behavior

The UI breaks and user is not able to continue.

Your environment

  • EventCatalog version used:0.0.13

npm run build fails if editUrl is not set

Have you read the Contributing Guidelines on issues?

Description

I think #75 introduced an issue with building a prod build.

If I run npm run build it will fail with

Failed to compile.

./pages/events/[name].tsx:5:10
Type error: Module '"../../eventcatalog.config"' has no exported member 'editUrl'.

  3 | 
  4 | import { Event } from '@eventcatalog/types';
> 5 | import { editUrl } from '../../eventcatalog.config';

Steps to reproduce

https://github.com/otbe/eventcatalog-playground

Expected behavior

Should work without editUrl set

Actual behavior

Fails creating a production build

Your environment

  • EventCatalog version used: 0.0.9 and 0.0.10

Master diagram that shows all event, services and domains

It would be nice to have a master mermaid diagram somewhere that can show a high level of all the services and all the events within the catalog.

This could allow users to see at a high level the architecture of their catalog.

Can't change header logo when not using SVG

Have you read the Contributing Guidelines on issues?

Description

I've put in the public folder a logo.png and replaced it in eventcatalog.config.js file and the logo and favicon appears in the main page and in the browser tab but in the header the logo is always the default one. Code is always looking for SVG as per <img alt="logo" className="text-white w-8 inline-block mr-3" src={${basePath}/logo.svg} />

Screenshot 2022-02-04 at 13 57 27

Steps to reproduce

  1. Put a logo with .PNG extension in the public folder
  2. Update eventcatalog.config.js file accordingly
  3. Run npm run dev

Expected behavior

Header logo should be updated to whatever the logo is in the public folder and not always look for SVG extension

Actual behavior

Header logo is not replaced and default one is always used

Your environment

  • EventCatalog version used: 0.1.9
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome 97.0.4692.99 (Official Build) (x86_64)
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): MacOS 12.1

Adding new Domain Data prevents site restart

Have you read the Contributing Guidelines on issues?

Description

If I add Domain Data - domain folders and the associated md files, I can not get EventCatalog to run again after the initial session stops. This happens if I use my own domains or the samples as documented, on both my Windows 10 and OSX systems. On Windows and Mac, if I remove the new Domain directories and associated md files, I can get a clean restart. For the "first run" (when I just installed EventCatalog and started the site with "npm run dev" I can add and see my new Domains (and the md files in them), but after I stop the site, I can not get it to restart with this data in place, no matter what sort of "run" directive I use (dev, build or prod style run command).

Steps to reproduce

  1. download and install EventCatalog per the instructions
  2. Run EventCatalog from the directory created at install (I used both custom and default names to test - same results)
  3. Follow the directions in the documents to "add Domains" (I used the doc default and my own domain names/events - same results). Note you can add just the domain directories or go ahead and add domains and the associated events - same results)
  4. You can now see and interact with your new domains in EventCatalog as long as you are in the "first run" (first execution of the run command for the product).
  5. Stop npm at the command line.
  6. Try to start EventCatalog from the command line again with either the "npm run dev" or any provided run script (the failure is the same).
  7. For me on both Windows 10 and Mac OSX I get fatal errors when I try to run EventCatalog again.
  8. On the Mac, deleting the new domain structure does not appear to fix the error.
  9. On Windows 11 deleting the new domain structures does appear to let me run again.

Expected behavior

I expected that once new Domain Data was added it would be persistent and I could stop and start the server as needed.

Actual behavior

Below is the Windows 10 Enterprise error from the console:
The version of Node is 16.5.0
The version of Yarn is 1.22.18

Fails to run again after adding domain β€œOrders” per the guide. Failure message is:
C:\Users\cthornhill-etc\ct-catalog>npm run dev

[email protected] dev
eventcatalog dev

@eventcatalog/[email protected] scripts:move-schema-for-download
node scripts/move-schemas-for-download.js

node:fs:1405
handleErrorFromBinding(ctx);
^

Error: ENOENT: no such file or directory, scandir 'C:\Users\cthornhill-etc\ct-catalog\domains\Orders\events'
at Object.readdirSync (node:fs:1405:3)
at getAllEventsAndSchemaPaths (C:\Users\cthornhill-etc\ct-catalog.eventcatalog-core\scripts\move-schemas-for-download.js:5:22)
at parseEventDirectory (C:\Users\cthornhill-etc\ct-catalog.eventcatalog-core\scripts\move-schemas-for-download.js:26:33)
at C:\Users\cthornhill-etc\ct-catalog.eventcatalog-core\scripts\move-schemas-for-download.js:68:7
at Array.forEach ()
at main (C:\Users\cthornhill-etc\ct-catalog.eventcatalog-core\scripts\move-schemas-for-download.js:67:13)
at Object. (C:\Users\cthornhill-etc\ct-catalog.eventcatalog-core\scripts\move-schemas-for-download.js:78:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
errno: -4058,
syscall: 'scandir',
code: 'ENOENT',
path: 'C:\Users\cthornhill-etc\ct-catalog\domains\Orders\events'
}
Error: Command failed: cross-env PROJECT_DIR=C:\Users\cthornhill-etc\ct-catalog npm run scripts:move-schema-for-download
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:899:15)
at Command. (C:\Users\cthornhill-etc\ct-catalog\node_modules@eventcatalog\core\bin\eventcatalog.js:85:5)
at Command.listener [as _actionHandler] (C:\Users\cthornhill-etc\ct-catalog\node_modules\commander\index.js:922:31)
at Command._parseCommand (C:\Users\cthornhill-etc\ct-catalog\node_modules\commander\index.js:1503:14)
at Command._dispatchSubcommand (C:\Users\cthornhill-etc\ct-catalog\node_modules\commander\index.js:1443:18)
at Command._parseCommand (C:\Users\cthornhill-etc\ct-catalog\node_modules\commander\index.js:1460:12)
at Command.parse (C:\Users\cthornhill-etc\ct-catalog\node_modules\commander\index.js:1292:10)
at run (C:\Users\cthornhill-etc\ct-catalog\node_modules@eventcatalog\core\bin\eventcatalog.js:115:7) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 3608,
stdout: null,
stderr: null
}

Below are the errors from my Mac (OSX):
MacBook Air M1
OSX 12.2.1
Node v 16.15.0
Yarn v 3.2.0

cecilthornhill@M1-MacBook-Air my-catalog % npm run dev

[email protected] dev
eventcatalog dev

@eventcatalog/[email protected] scripts:move-schema-for-download
node scripts/move-schemas-for-download.js

node:fs:1405
handleErrorFromBinding(ctx);
^

Error: ENOENT: no such file or directory, scandir '/Users/cecilthornhill/my-catalog/domains/Orders/events'
at Object.readdirSync (node:fs:1405:3)
at getAllEventsAndSchemaPaths (/Users/cecilthornhill/my-catalog/.eventcatalog-core/scripts/move-schemas-for-download.js:5:22)
at parseEventDirectory (/Users/cecilthornhill/my-catalog/.eventcatalog-core/scripts/move-schemas-for-download.js:26:33)
at /Users/cecilthornhill/my-catalog/.eventcatalog-core/scripts/move-schemas-for-download.js:68:7
at Array.forEach ()
at main (/Users/cecilthornhill/my-catalog/.eventcatalog-core/scripts/move-schemas-for-download.js:67:13)
at Object. (/Users/cecilthornhill/my-catalog/.eventcatalog-core/scripts/move-schemas-for-download.js:78:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32) {
errno: -2,
syscall: 'scandir',
code: 'ENOENT',
path: '/Users/cecilthornhill/my-catalog/domains/Orders/events'
}
Error: Command failed: cross-env PROJECT_DIR=/Users/cecilthornhill/my-catalog npm run scripts:move-schema-for-download
at checkExecSyncError (node:child_process:828:11)
at execSync (node:child_process:899:15)
at Command. (/Users/cecilthornhill/my-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:85:5)
at Command.listener [as _actionHandler] (/Users/cecilthornhill/my-catalog/node_modules/commander/index.js:922:31)
at Command._parseCommand (/Users/cecilthornhill/my-catalog/node_modules/commander/index.js:1503:14)
at Command._dispatchSubcommand (/Users/cecilthornhill/my-catalog/node_modules/commander/index.js:1443:18)
at Command._parseCommand (/Users/cecilthornhill/my-catalog/node_modules/commander/index.js:1460:12)
at Command.parse (/Users/cecilthornhill/my-catalog/node_modules/commander/index.js:1292:10)
at run (/Users/cecilthornhill/my-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:115:7) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 16268,
stdout: null,
stderr: null
}

Your environment

  • EventCatalog version used:

  • "name":
    "my-catalog",
    "version":
    "0.0.1",
    "lockfileVersion":
    2,
    "requires":
    true,
    "packages": {
    "": {
    "name":
    "my-catalog",
    "version":
    "0.0.1",
    "dependencies": {
    "@eventcatalog/core":
    "0.2.14"
    },
    "devDependencies": {
    "@eventcatalog/types":
    "0.1.3",
    "@types/node":
    "17.0.31",
    "@types/react":
    "18.0.8",
    "autoprefixer":
    "^10.4.0",
    "cross-env":
    "^7.0.3",
    "postcss":
    "^8.3.11",
    "tailwindcss":
    "^2.2.19",
    "typescript":
    "^4.4.4"
    }

  • Environment name and version (e.g. Chrome 89, Node.js 16.4):

  • WINDOWS

  • Node is 16.5.0

  • Yarn is 1.22.18

  • Microsoft Edge 101.0.1210.32 (Official Build) (64-bit)

  • MAC

  • Node v 16.15.0

  • Yarn v 3.2.0
    -Safari v 15.3 (17612.4.9.1.8)

  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

  • Windows 10 Enterprise LTSC Version 1809 OS Build 17763.2803

  • OSX 12.2.1

Add additional documentation markdown to services (and domains)

Have you read the Contributing Guidelines on issues?

Description

It would be nice to be able to add docs to a service, we currently have documentation for services within a wiki on Azure Devops and it would be great to be able to migrate this over and have it in one place.

It would be nice to be able to have this folder structure in a service folder like this:
image
and then use a md component like which would essentially output a table of contents like this:
image

Motivation

Would allow structured documentation to be added to services and domains. This would allow an event catalog site to be used as a full documentation site that allows structuring rather then specifically events.

Adding domain support in eventcatalog utils

Have you read the Contributing Guidelines on issues?

Description

It would be great to have domain support for the functions writeEventToCatalog and writeServiceToCatalog.

We could have extra option to the function domain if the name of the domain is given it will:

  • Check to see if the domains folder has been created (create if not)
  • Check to see if the domain folder inside has been created (create if not)
  • Check to see if domain has required index.md file (create if not)
  • Put event inside the domains events folder /domains/{Your Domain}/events/{Domain Path}

Same with services.

This would allow plugin authors the ability to create services,events easier within domains.

Motivation

Making it easier for plugin authors to create events, services within eventcatalog into domains.

Bad linking on Graph nodes

Have you read the Contributing Guidelines on issues?

Description

On a graph when clicking on an object the redirection is not correct when the event or the service is on a domain.

Steps to reproduce

  1. Go to a domain like https://app.eventcatalog.dev/domains/Shopping/
  2. Click on AddedItemToCart on the Graph
  3. Error 404 not found

Expected behavior

Should be redirected to https://app.eventcatalog.dev/domains/Shopping/events/AddedItemToCart/

Actual behavior

It's redirected to https://app.eventcatalog.dev/events/AddedItemToCart/

Your environment

  • EventCatalog version used: 0.2.6
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome 89, Node.js 16.4
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10

Copy `out` directory back to users project vs in the .eventcatalog-core folder

Have you read the Contributing Guidelines on issues?

Description

When users build the project EventCatalog will create an out directory. This out directory is inside the .eventcatalog-core project, but it should be in the users project.

Steps to reproduce

  1. Create a new catalog
  2. Run build command
  3. See the out directory inside the incorrect folder.

Expected behavior

The idea is that users should not care/edit the .eventcatalog-core folder and should be able to everything they need in the root directory.

Actual behavior

When users build the project EventCatalog will create an out directory. This out directory is inside the .eventcatalog-core project, but it should be in the users project.

Your environment

  • EventCatalog version used: 0.1.2

Hide "Domains" from top navbar if there are no domains

Have you read the Contributing Guidelines on issues?

Description

If there is no "domains" directory or the directory is empty, do not display "Domains" item in the top navbar, as the "Domains" page would be empty.

Motivation

EventCatalog works fine if you have no "domains" defined. You can have only events and services, which is suitable for a small project or in the early phase.

If you have no domains created, on the events page the filtering by the domain is hidden, which is great.

Now it would be nice to also hide the link to the empty domains page in such a case, to keep the UI simple.

Linking flows in visualizer

Have you read the Contributing Guidelines on issues?

Description

In the visualizer currently all services are shown as event-service-event and all events are shown as service-event-service but they are not linked. For example the sample has:
image

Could it be possible to enable a toggle (or something) in the visualizer that shows the flows like:
image

If possible also allow recursions like:
image

Motivation

I think it would be good to get a feel of the whole flow of events from start to end. Currently it is hard to get an overview of the whole system. Domains helped with the structuring but this part is missing to get the overall picture

Failing to load examples in events with extensions that are not supports (.http for example)

Have you read the Contributing Guidelines on issues?

Description

When you create an Event with /examples and have file extensions that are not supported by the Catalog , the Catalog blows up.

Steps to reproduce

  1. Create a new Event
  2. Add /examples/test.http
  3. Add any content into this file.

Go to load the examples within the event and watch the application blow up.

Expected behavior

Should render the example

Actual behavior

The console blows up.

Your environment

No response

Support multiple AsyncAPI files in AsyncAPI Generator Plugin

Have you read the Contributing Guidelines on issues?

Description

The genertor-asyncapi plugin currently only supports one AsyncAPI file.

It would be nice to support multiple files.

Here is an example of how it could work

const path = require('path');

module.exports = {
   generators: [
    [
      '@eventcatalog/plugin-doc-generator-asyncapi',
      {
        // pass one
        pathToSpec: path.join(__dirname, 'asyncapi.yml'),

		// or pass more....
	    pathToSpec: [path.join(__dirname, 'asyncapi.yml'), path.join(__dirname, 'asyncapi2.yml')],

        // version events if already in catalog (optional)
        versionEvents: true
      },
    ],
  ],
};

Motivation

Allow users to use more than one AsyncAPI file with generator (based on feedback from community on Discord)

Custom EventBridge Schema Registry - Cannot export JSONSchemaDraft4 for non discovered or non aws managed schemas

Have you read the Contributing Guidelines on issues?

Description

When setting up the generator with a custom registryName (other than discovered-schemas),
running npm run generate will yield the following exception:
ForbiddenException: You cannot export non discovered or non aws managed schemas.

This seems to be due to the usage of exportSchema() on every returned schema by default (verified with Python boto3.schemas lib too).

We might need to make this feature optional or add a condition on the registryType.

Steps to reproduce

  1. Create a custom EventBridge Schema Registry
  2. Create a new Schema in your new EventBridge Schema Registry
  3. Set the generator to point to the custom EventBridge Schema Registry (registryName)
generators: [
    [
      '@eventcatalog/plugin-doc-generator-amazon-eventbridge',
      {
        eventBusName: 'MyEventBus',
        region: 'eu-west-2',
        registryName: 'MySchemaRegistry',
        schemaTypeToRenderToEvent: 'OpenAPI',
        credentials: {
          accessKeyId: process.env.AWS_ACCESS_KEY,
          secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
        },
      },
    ],
  ]
  1. Run npm run generate

Expected behavior

As for the default discovered-schemas registry, we expect listed schemas to be mapped into new events/ directories containing the templated markdown docs.

In the case of a custom EventBridge Schema Registry, the documentation could be templated without exporting the JSONSchemaDraft4 schema files.

Actual behavior

a 403 ForbiddenException: You cannot export non discovered or non aws managed schemas exception is thrown.

Generating EventCatalog docs using: @eventcatalog/plugin-doc-generator-amazon-eventbridge
/Users/john/my-event-catalog/node_modules/@aws-sdk/client-schemas/dist-cjs/protocols/Aws_restJson1.js:2888
    const exception = new models_0_1.ForbiddenException({
                      ^

ForbiddenException: You cannot export non discovered or non aws managed schemas.
    at deserializeAws_restJson1ForbiddenExceptionResponse (/Users/john/my-event-catalog/node_modules/@aws-sdk/client-schemas/dist-cjs/protocols/Aws_restJson1.js:2888:23)
    at deserializeAws_restJson1ExportSchemaCommandError (/Users/john/my-event-catalog/node_modules/@aws-sdk/client-schemas/dist-cjs/protocols/Aws_restJson1.js:1815:25)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /Users/john/my-event-catalog/node_modules/@aws-sdk/middleware-serde/dist-cjs/deserializerMiddleware.js:7:24
    at async /Users/john/my-event-catalog/node_modules/@aws-sdk/middleware-signing/dist-cjs/middleware.js:11:20
    at async StandardRetryStrategy.retry (/Users/john/my-event-catalog/node_modules/@aws-sdk/middleware-retry/dist-cjs/StandardRetryStrategy.js:51:46)
    at async /Users/john/my-event-catalog/node_modules/@aws-sdk/middleware-logger/dist-cjs/loggerMiddleware.js:6:22
    at async /Users/john/my-event-catalog/node_modules/@eventcatalog/plugin-doc-generator-amazon-eventbridge/lib/lib/aws.js:12:30
    at async Promise.all (index 0)
    at async exports.default (/Users/john/my-event-catalog/node_modules/@eventcatalog/plugin-doc-generator-amazon-eventbridge/lib/index.js:38:21) {
  '$fault': 'client',
  '$metadata': {
    httpStatusCode: 403,
    requestId: '4526e20b-4fbd-44a9-9a72-4bd4d427e791',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  },
  Code: 'Forbidden'
}
Error: Command failed: cross-env PROJECT_DIR=/Users/john/my-event-catalog npm run generate
    at checkExecSyncError (node:child_process:826:11)
    at execSync (node:child_process:900:15)
    at Command.<anonymous> (/Users/john/my-event-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:108:5)
    at Command.listener [as _actionHandler] (/Users/john/my-event-catalog/node_modules/commander/index.js:922:31)
    at Command._parseCommand (/Users/john/my-event-catalog/node_modules/commander/index.js:1503:14)
    at Command._dispatchSubcommand (/Users/john/my-event-catalog/node_modules/commander/index.js:1443:18)
    at Command._parseCommand (/Users/john/my-event-catalog/node_modules/commander/index.js:1460:12)
    at Command.parse (/Users/john/my-event-catalog/node_modules/commander/index.js:1292:10)
    at run (/Users/john/my-event-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:115:7)
    at Object.<anonymous> (/Users/john/my-event-catalog/node_modules/@eventcatalog/core/bin/eventcatalog.js:122:1) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 36420,
  stdout: null,
  stderr: null
}

Your environment

  • EventCatalog version used: 0.0.6
  • Environment name and version: Chrome 100.0.4896.127, Node.js 16.13.2
  • Operating system and version: MacOS 12.3.1

Cross linking of event fields.

Have you read the Contributing Guidelines on issues?

Description

It would be lovely if we could link/reference from one event field to the field of a different event. Speaking about this view here:

image

Motivation

Imagine you have TradeCreated event with the two fields buyerId and sellerId. It would be lovely if both fields could link/reference to an id field in a UserCreated event. That way people can jump to UserCreated and from here on check related fields or other related events.

This feature request is not exactly about supporting $ref in JSON Schemas. As far as I know $ref references a complete (sub)-schema. If TradeCreated: buyerId and TradeCreated: sellerId would reference UserCreated: id directly they would inherit the description of UserCreated: id and could not provide there own. (But I might be wrong here.) So I'd still like to be able to write something like this:

UserCreated:
  properties:
    id:
      description: "Use this to reference any user."

TradeCreated:
  properties:
    buyerId:
      description: "References a user which has money and trades it for some goods."
    sellerId:
      description: "References a user which offers goods."

I wonder what would be the best way to support? Currently I could imagine two weeks:

  • extend JSON Schema somehow (misusing fields like $comment or adding custom fields)
  • provide an additional EventCatalog-specific document (something like a sitemap.xml, but for events)

In case of an EventCatalog-specific document it would be nice if we could design it in a way that it can be extended in the future. E.g. another feature we'd love to see would be placing events in "business process flows. E.g. something like this:

TradeRequested ----- TradeAccepted ----- TradeDelivered
               \
                 --- TradeRejected

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.