@eventcatalog/create-eventcatalog 2.0.6 → 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 CHANGED
@@ -22654,7 +22654,7 @@ function validateNpmName(name) {
22654
22654
  var package_default = {
22655
22655
  name: "@eventcatalog/create-eventcatalog",
22656
22656
  description: "Create EventCatalog with one command",
22657
- version: "2.0.6",
22657
+ version: "2.0.7",
22658
22658
  bin: {
22659
22659
  "create-catalog": "./dist/index.js"
22660
22660
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/create-eventcatalog",
3
3
  "description": "Create EventCatalog with one command",
4
- "version": "2.0.6",
4
+ "version": "2.0.7",
5
5
  "bin": {
6
6
  "create-catalog": "./dist/index.js"
7
7
  },
@@ -0,0 +1,7 @@
1
+ ---
2
+ createdAt: 2024-08-01
3
+ ---
4
+
5
+ ### Service added to domain
6
+
7
+ Added the InventoryService to the domain.
@@ -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
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Employee",
4
- "type": "object",
5
- "description": "A record representing an employee",
6
- "properties": {
7
- "Name": {
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
- "required": ["Name", "Age", "Department", "Position", "Salary", "JoinDate"]
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,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" />
@@ -0,0 +1,7 @@
1
+ ---
2
+ createdAt: 2024-08-01
3
+ ---
4
+
5
+ ### Service receives additional events
6
+
7
+ Service now receives [OrderAmended](/docs/events/OrderAmended/0.0.1) and [UpdateInventory](/docs/commands/UpdateInventory/0.0.3) events.