@eventcatalog/create-eventcatalog 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/templates/default/domains/Orders/changelog.md +7 -0
- package/templates/default/events/Inventory/InventoryAdjusted/changelog.md +68 -0
- package/templates/default/events/Inventory/InventoryAdjusted/schema.json +15 -34
- package/templates/default/events/Inventory/InventoryAdjusted/versioned/0.0.1/changelog.md +30 -0
- package/templates/default/events/Inventory/InventoryAdjusted/versioned/0.0.3/changelog.md +26 -0
- package/templates/default/pages/index.md +28 -0
- package/templates/default/services/InventoryService/0.0.1/index.md +36 -0
- package/templates/default/services/InventoryService/changelog.md +7 -0
- package/templates/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -22490,7 +22490,8 @@ var installTemplate = async ({
|
|
|
22490
22490
|
const dependencies = [];
|
|
22491
22491
|
const devDependencies = [
|
|
22492
22492
|
"@parcel/watcher",
|
|
22493
|
-
"concurrently"
|
|
22493
|
+
"concurrently",
|
|
22494
|
+
"cross-env"
|
|
22494
22495
|
];
|
|
22495
22496
|
if (dependencies.length) {
|
|
22496
22497
|
console.log();
|
|
@@ -22653,7 +22654,7 @@ function validateNpmName(name) {
|
|
|
22653
22654
|
var package_default = {
|
|
22654
22655
|
name: "@eventcatalog/create-eventcatalog",
|
|
22655
22656
|
description: "Create EventCatalog with one command",
|
|
22656
|
-
version: "2.0.
|
|
22657
|
+
version: "2.0.7",
|
|
22657
22658
|
bin: {
|
|
22658
22659
|
"create-catalog": "./dist/index.js"
|
|
22659
22660
|
},
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2024-08-01
|
|
3
|
+
badges:
|
|
4
|
+
- content: ⭐️ JSON Schema
|
|
5
|
+
backgroundColor: purple
|
|
6
|
+
textColor: purple
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Added support for JSON Schema
|
|
10
|
+
|
|
11
|
+
InventoryAdjusted uses Avro but now also supports JSON Draft 7.
|
|
12
|
+
|
|
13
|
+
```json title="Employee JSON Draft"
|
|
14
|
+
// labeled-line-markers.jsx
|
|
15
|
+
{
|
|
16
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
17
|
+
"type": "object",
|
|
18
|
+
"title": "Employee",
|
|
19
|
+
"properties": {
|
|
20
|
+
"Name": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"Age": {
|
|
24
|
+
"type": "integer"
|
|
25
|
+
},
|
|
26
|
+
"Town": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"required": ["Name", "Age", "Town"]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Using it with our Kafka Cluster
|
|
36
|
+
|
|
37
|
+
## 1. Create a new topic
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
# Create a topic named 'employee_topic'
|
|
41
|
+
kafka-topics.sh --create --topic employee_topic --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Step 2: Prepare the JSON Message
|
|
45
|
+
|
|
46
|
+
Create a JSON file named `employee.json` with the following content:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"Name": "John Doe",
|
|
51
|
+
"Age": 30,
|
|
52
|
+
"Town": "Springfield"
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Step 3: Produce the Message to Kafka Topic
|
|
57
|
+
|
|
58
|
+
Use the Kafka producer CLI to send the JSON message:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
cat employee.json | kafka-console-producer.sh --topic employee_topic --bootstrap-server localhost:9092
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Step 4: Verify the Message (Optional)
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
kafka-console-consumer.sh --topic employee_topic --from-beginning --bootstrap-server localhost:9092
|
|
68
|
+
```
|
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The name of the employee"
|
|
10
|
-
},
|
|
11
|
-
"Age": {
|
|
12
|
-
"type": "integer",
|
|
13
|
-
"description": "The age of the employee"
|
|
14
|
-
},
|
|
15
|
-
"Department": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "The department where the employee works"
|
|
18
|
-
},
|
|
19
|
-
"Position": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The position or title of the employee within the department"
|
|
22
|
-
},
|
|
23
|
-
"Salary": {
|
|
24
|
-
"type": "number",
|
|
25
|
-
"format": "double",
|
|
26
|
-
"description": "The salary of the employee"
|
|
27
|
-
},
|
|
28
|
-
"JoinDate": {
|
|
29
|
-
"type": "string",
|
|
30
|
-
"format": "date",
|
|
31
|
-
"description": "The date when the employee joined the company"
|
|
32
|
-
}
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"title": "Employee",
|
|
5
|
+
"properties": {
|
|
6
|
+
"Name": {
|
|
7
|
+
"type": "string"
|
|
33
8
|
},
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
"Age": {
|
|
10
|
+
"type": "integer"
|
|
11
|
+
},
|
|
12
|
+
"Town": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": ["Name", "Age", "Town"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2024-07-01
|
|
3
|
+
badges:
|
|
4
|
+
- content: Breaking change
|
|
5
|
+
backgroundColor: red
|
|
6
|
+
textColor: red
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Removed fields from schema, added new owners
|
|
10
|
+
|
|
11
|
+
`Gender` property has been removed from the Schema of the event
|
|
12
|
+
|
|
13
|
+
Also added the [full stackers](/docs/teams/full-stack) team as owners of this event
|
|
14
|
+
|
|
15
|
+
```diff lang="json"
|
|
16
|
+
{
|
|
17
|
+
"type" : "record",
|
|
18
|
+
"namespace" : "Tutorialspoint",
|
|
19
|
+
"name" : "Employee",
|
|
20
|
+
"fields" : [
|
|
21
|
+
{ "name" : "Name" , "type" : "string" },
|
|
22
|
+
{ "name" : "Age" , "type" : "int" },
|
|
23
|
+
- { "name" : "Gender" , "type" : "string" },
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
createdAt: 2024-07-11
|
|
3
|
+
badges:
|
|
4
|
+
- content: New field
|
|
5
|
+
backgroundColor: green
|
|
6
|
+
textColor: green
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Added new field to schema
|
|
10
|
+
|
|
11
|
+
We added the new town property to the schema for downstream consumers.
|
|
12
|
+
|
|
13
|
+
```json ins={"New: Added new Town property to schema:":9-10}
|
|
14
|
+
// labeled-line-markers.jsx
|
|
15
|
+
{
|
|
16
|
+
"type" : "record",
|
|
17
|
+
"namespace" : "Tutorialspoint",
|
|
18
|
+
"name" : "Employee",
|
|
19
|
+
"fields" : [
|
|
20
|
+
{ "name" : "Name" , "type" : "string" },
|
|
21
|
+
{ "name" : "Age" , "type" : "int" },
|
|
22
|
+
|
|
23
|
+
{ "name" : "Town" , "type" : "string" },
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: index
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# **EventCatalog**
|
|
6
|
+
|
|
7
|
+
Welcome to [EventCatalog](https://www.eventcatalog.dev/).
|
|
8
|
+
|
|
9
|
+
This open-source project is designed to help you and your teams bring discoverability and clarity to your event-driven architectures (EDA).
|
|
10
|
+
|
|
11
|
+
To get started you can read the following guides:
|
|
12
|
+
|
|
13
|
+
* [Getting started with EventCatalog](https://eventcatalog.dev/docs/development/getting-started/introduction)
|
|
14
|
+
* [Creating domains](https://eventcatalog.dev/docs/development/guides/domains/adding-domains)
|
|
15
|
+
* [Creating services](https://eventcatalog.dev/docs/development/guides/services/adding-services)
|
|
16
|
+
* [Creating commands](https://eventcatalog.dev/docs/development/guides/messages/commands/introduction)
|
|
17
|
+
* [Creating events](https://eventcatalog.dev/docs/development/guides/messages/events/introduction)
|
|
18
|
+
* [Assigning owners to resources](https://eventcatalog.dev/docs/owners)
|
|
19
|
+
* [Using components in your pages (Schemas, OpenAPI, etc)](https://eventcatalog.dev/docs/development/components/using-components)
|
|
20
|
+
* [Deploying and hosting your EventCatalog](https://eventcatalog.dev/docs/development/deployment)
|
|
21
|
+
|
|
22
|
+
### **Join the community**
|
|
23
|
+
|
|
24
|
+
Got questions about EventCatalog? Feature requests or need support? [Join our community on Discord.](https://discord.gg/3rjaZMmrAm)
|
|
25
|
+
|
|
26
|
+
### **Enterprise support**
|
|
27
|
+
|
|
28
|
+
Using EventCatalog and needs enterprise support? Work with us, find out what we offer on our [enterprise page](https://eventcatalog.dev/enterprise).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: InventoryService
|
|
3
|
+
version: 0.0.2
|
|
4
|
+
name: Inventory Service
|
|
5
|
+
summary: |
|
|
6
|
+
Service that handles the inventory
|
|
7
|
+
owners:
|
|
8
|
+
- dboyne
|
|
9
|
+
- full-stack
|
|
10
|
+
- mobile-devs
|
|
11
|
+
receives:
|
|
12
|
+
- id: OrderConfirmed
|
|
13
|
+
version: 0.0.1
|
|
14
|
+
- id: OrderCancelled
|
|
15
|
+
version: 0.0.1
|
|
16
|
+
- id: OrderAmended
|
|
17
|
+
version: 0.0.1
|
|
18
|
+
- id: UpdateInventory
|
|
19
|
+
version: 0.0.3
|
|
20
|
+
sends:
|
|
21
|
+
- id: InventoryAdjusted
|
|
22
|
+
version: 0.0.4
|
|
23
|
+
- id: OutOfStock
|
|
24
|
+
version: 0.0.3
|
|
25
|
+
repository:
|
|
26
|
+
language: JavaScript
|
|
27
|
+
url: https://github.com/boyney123/pretend-shipping-service
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Overview
|
|
31
|
+
|
|
32
|
+
The Inventory Service is a critical component of the system responsible for managing product stock levels, tracking inventory movements, and ensuring product availability. It interacts with other services to maintain accurate inventory records and supports operations such as order fulfillment, restocking, and inventory audits.
|
|
33
|
+
|
|
34
|
+
## Architecture diagram
|
|
35
|
+
|
|
36
|
+
<NodeGraph title="Hello world" />
|