This repository has been archived by the owner on Feb 5, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
David Boyne
authored and
David Boyne
committed
Aug 30, 2024
1 parent
985e871
commit d69a374
Showing
11 changed files
with
281 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,124 @@ | ||
## @eventcatalog/generator-asyncapi | ||
<div align="center"> | ||
|
||
Currently WIP...do not use (yet!)... | ||
<h1>⚡️ AsyncAPI generator for EventCatalog</h1> | ||
|
||
[![PRs Welcome][prs-badge]][prs] | ||
<img src="https://img.shields.io/github/actions/workflow/status/event-catalog/generator-asyncapi/verify-build.yml"/> | ||
[![](https://dcbadge.limes.pink/api/server/https://discord.gg/3rjaZMmrAm?style=flat)](https://discord.gg/3rjaZMmrAm) [<img src="https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white" height="20px" />](https://www.linkedin.com/in/david-boyne/) [![blog](https://img.shields.io/badge/blog-EDA--Visuals-brightgreen)](https://eda-visuals.boyney.io/?utm_source=event-catalog-gihub) | ||
|
||
|
||
<img alt="header" src="./images/asyncapi.jpeg" /> | ||
|
||
<h4>Features: Generate EventCatalogs with your AsyncAPI files, Auto versioning, schema downloads, map to domains, custom AsyncAPI extensions and more... </h4> | ||
|
||
|
||
[Read the Docs](https://eventcatalog.dev/) | [Edit the Docs](https://github.com/event-catalog/docs) | [View Demo](https://demo.eventcatalog.dev/docs) | ||
|
||
</div> | ||
|
||
<hr/> | ||
|
||
# Core Features | ||
|
||
- 📃 Document domains, services and messages from your AsyncAPI file ([example](https://github.com/event-catalog/eventcatalog-asyncapi-example)) | ||
- 📊 Visualise your architecture ([demo](https://demo.eventcatalog.dev/visualiser)) | ||
- ⭐ Download your AsyncAPI files and message schemas form EventCatalog (e.g Avro, JSON) ([demo](https://demo.eventcatalog.dev/docs/events/InventoryAdjusted/0.0.4)) | ||
- 💅 Custom MDX components ([read more](https://eventcatalog.dev/docs/development/components/using-components)) | ||
- 🗄️ Auto versioning of your domains, services and messages | ||
- ⭐ Discoverability feature (search, filter and more) ([demo](https://demo.eventcatalog.dev/discover/events)) | ||
- ⭐ And much more... | ||
|
||
# How it works | ||
|
||
EventCatalog is technology agnostic, meaning it can integrate with any schemas, specs or brokers. | ||
|
||
EventCatalog supports [generators](https://www.eventcatalog.dev/docs/development/plugins/generators). | ||
Generators are scripts are run to pre build to generate content in your catalog. Generators can use the [EventCatalog SDK](https://www.eventcatalog.dev/docs/sdk). | ||
|
||
With this AsyncAPI plugin you can connect your AsyncAPI files to your catalog. This is done by defining your generators in your `eventcatlaog.config.js` file. | ||
|
||
```js | ||
... | ||
generators: [ | ||
[ | ||
'@eventcatalogtest/generator-asyncapi', | ||
{ | ||
path: [path.join(__dirname, 'asyncapi-files', 'orders-service.yml'), | ||
domain: { id: 'orders', name: 'Orders', version: '0.0.1' }, | ||
}, | ||
], | ||
], | ||
... | ||
``` | ||
|
||
In this example the generator will read the `orders-service.yml` file and populate services and messages inside your catalog. It will add the service to the domain `Orders`. | ||
|
||
You can see an example in the [eventcatalog-asyncapi-example](https://github.com/event-catalog/eventcatalog-asyncapi-example/blob/main/eventcatalog.config.js) repo | ||
|
||
# Getting started | ||
|
||
## Installation and configuration | ||
|
||
_Make sure you are on the latest version of EventCatalog_. | ||
|
||
1. Install the package `@eventcatalog/generator-asyncapi` | ||
|
||
2. Configure your `eventcatalog.config.js` file [(see example)](https://github.com/event-catalog/eventcatalog-asyncapi-example/blob/main/eventcatalog.config.js) | ||
|
||
3. Run the generate command `npm run generate` | ||
|
||
4. See your new domains, services and messages, run `npm run dev` | ||
|
||
## Found a problem? | ||
|
||
Raise a GitHub issue on this project, or contact us on [our Discord server](https://discord.gg/3rjaZMmrAm). | ||
|
||
|
||
# Sponsors | ||
|
||
Thank you to our EventCatalog project sponsors. | ||
|
||
<hr /> | ||
|
||
<div align="center"> | ||
<img alt="hookdeck" src="./images/sponsors/hookdeck.svg" /> | ||
<p style="margin: 0; padding: 0;">Serverless infrastructure for event-driven architecture. </p> | ||
<a href="https://hookdeck.com/?ref=eventcatalog-sponsor" target="_blank" >Learn more</a> | ||
</div> | ||
|
||
<hr /> | ||
|
||
_Sponsors help make EventCatalog sustainable, want to help the project? Get in touch! Or [visit our sponsor page](https://www.eventcatalog.dev/support)._ | ||
|
||
# Enterprise support | ||
|
||
Interested in collaborating with us? Our offerings include dedicated support, priority assistance, feature development, custom integrations, and more. | ||
|
||
Find more details on our [services page](https://eventcatalog.dev/services). | ||
|
||
|
||
# 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. | ||
|
||
You can find the [contributing guidelines here](https://eventcatalog.dev/docs/contributing/overview). | ||
|
||
## Running the project locally | ||
|
||
1. Clone the repo | ||
1. Install required dependencies `pnpm i` | ||
1. Run the examples `npx tsx examples/streelights-mqtt/index.ts | ||
1. Run tests `pnpm run tests` | ||
|
||
[license-badge]: https://img.shields.io/github/license/event-catalog/eventcatalog.svg?color=yellow | ||
[license]: https://github.com/event-catalog/eventcatalog/blob/main/LICENSE | ||
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square | ||
[prs]: http://makeapullrequest.com | ||
[github-watch-badge]: https://img.shields.io/github/watchers/event-catalog/eventcatalog.svg?style=social | ||
[github-watch]: https://github.com/event-catalog/eventcatalog/watchers | ||
[github-star-badge]: https://img.shields.io/github/stars/event-catalog/eventcatalog.svg?style=social | ||
[github-star]: https://github.com/event-catalog/eventcatalog/stargazers | ||
|
||
# License | ||
|
||
TODO |
14 changes: 14 additions & 0 deletions
14
examples/streetlights-mqtt/catalog/commands/dimLight/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
id: dimlight | ||
version: 4.2.2 | ||
name: Dim light | ||
summary: Command a particular streetlight to dim the lights. | ||
badges: [] | ||
schemaPath: schema.json | ||
--- | ||
## Architecture | ||
<NodeGraph /> | ||
|
||
|
||
## Schema | ||
<SchemaViewer file="schema.json" title="Message Schema" maxHeight="500" /> |
19 changes: 19 additions & 0 deletions
19
examples/streetlights-mqtt/catalog/commands/dimLight/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"percentage": { | ||
"type": "integer", | ||
"description": "Percentage to which the light should be dimmed to.", | ||
"minimum": 0, | ||
"maximum": 100, | ||
"x-parser-schema-id": "<anonymous-schema-21>" | ||
}, | ||
"sentAt": { | ||
"type": "string", | ||
"format": "date-time", | ||
"description": "Date and time when the message was sent.", | ||
"x-parser-schema-id": "<anonymous-schema-22>" | ||
} | ||
}, | ||
"x-parser-schema-id": "<anonymous-schema-20>" | ||
} |
14 changes: 14 additions & 0 deletions
14
examples/streetlights-mqtt/catalog/commands/turnOn/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
id: turnon | ||
version: 4.2.2 | ||
name: Turn on/off | ||
summary: Command a particular streetlight to turn the lights on or off. | ||
badges: [] | ||
schemaPath: schema.json | ||
--- | ||
## Architecture | ||
<NodeGraph /> | ||
|
||
|
||
## Schema | ||
<SchemaViewer file="schema.json" title="Message Schema" maxHeight="500" /> |
21 changes: 21 additions & 0 deletions
21
examples/streetlights-mqtt/catalog/commands/turnOn/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"command": { | ||
"type": "string", | ||
"enum": [ | ||
"on", | ||
"off" | ||
], | ||
"description": "Whether to turn on or off the light.", | ||
"x-parser-schema-id": "<anonymous-schema-13>" | ||
}, | ||
"sentAt": { | ||
"type": "string", | ||
"format": "date-time", | ||
"description": "Date and time when the message was sent.", | ||
"x-parser-schema-id": "<anonymous-schema-14>" | ||
} | ||
}, | ||
"x-parser-schema-id": "<anonymous-schema-12>" | ||
} |
10 changes: 10 additions & 0 deletions
10
examples/streetlights-mqtt/catalog/domains/orders/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
id: orders | ||
name: Street | ||
version: 4.2.2 | ||
services: | ||
- id: streetlights-mqtt-api | ||
version: 4.2.2 | ||
--- | ||
## Architecture diagram | ||
<NodeGraph /> |
19 changes: 19 additions & 0 deletions
19
examples/streetlights-mqtt/catalog/events/lightMeasured/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
id: lightmeasured | ||
version: 4.2.2 | ||
name: Light measured | ||
summary: Inform about environmental lighting conditions of a particular streetlight. | ||
badges: [] | ||
schemaPath: schema.json | ||
--- | ||
## Architecture | ||
<NodeGraph /> | ||
|
||
|
||
## Schema | ||
<SchemaViewer file="schema.json" title="Message Schema" maxHeight="500" /> | ||
|
||
|
||
|
||
## External documentation | ||
- [Find more info here](https://www.asyncapi.org) |
18 changes: 18 additions & 0 deletions
18
examples/streetlights-mqtt/catalog/events/lightMeasured/schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"lumens": { | ||
"type": "integer", | ||
"minimum": 0, | ||
"description": "Light intensity measured in lumens.", | ||
"x-parser-schema-id": "<anonymous-schema-6>" | ||
}, | ||
"sentAt": { | ||
"type": "string", | ||
"format": "date-time", | ||
"description": "Date and time when the message was sent.", | ||
"x-parser-schema-id": "<anonymous-schema-7>" | ||
} | ||
}, | ||
"x-parser-schema-id": "<anonymous-schema-5>" | ||
} |
32 changes: 32 additions & 0 deletions
32
examples/streetlights-mqtt/catalog/services/Streetlights MQTT API/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
id: streetlights-mqtt-api | ||
name: Streetlights MQTT API | ||
version: 4.2.2 | ||
summary: '' | ||
badges: [] | ||
sends: | ||
- id: lightmeasured | ||
version: 4.2.2 | ||
receives: | ||
- id: turnon | ||
version: 4.2.2 | ||
- id: turnon | ||
version: 4.2.2 | ||
- id: dimlight | ||
version: 4.2.2 | ||
--- | ||
The Streetlights API allows you to remotely manage the city lights. | ||
|
||
### Check out its awesome features: | ||
|
||
* Turn a specific streetlight on/off 🌃 | ||
* Dim a specific streetlight 😎 | ||
* Receive real-time information about environmental lighting conditions 📈 | ||
|
||
|
||
## Architecture diagram | ||
<NodeGraph /> | ||
|
||
|
||
## External documentation | ||
- [Find more info here](https://www.asyncapi.org) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.