@eventcatalog/create-eventcatalog 2.2.1 → 2.2.3
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 +19 -4
- package/package.json +1 -1
- package/templates/asyncapi/Dockerfile +23 -0
- package/templates/asyncapi/README-template.md +1 -0
- package/templates/asyncapi/asyncapi-files/messages/user-signed-up.yml +44 -0
- package/templates/asyncapi/asyncapi-files/orders-service.yml +272 -0
- package/templates/asyncapi/asyncapi-files/payment-service.yml +245 -0
- package/templates/asyncapi/asyncapi-files/user-service.yml +23 -0
- package/templates/asyncapi/dockerignore +8 -0
- package/templates/asyncapi/eventcatalog.config.js +55 -0
- package/templates/asyncapi/eventcatalog.styles.css +1 -0
- package/templates/asyncapi/gitignore +24 -0
- package/templates/asyncapi/npmrc +1 -0
- package/templates/asyncapi/public/logo.png +0 -0
- package/templates/asyncapi/teams/order-management.md +31 -0
- package/templates/asyncapi/teams/user-management.md +18 -0
- package/templates/asyncapi/users/aSmith.md +27 -0
- package/templates/asyncapi/users/alee.md +8 -0
- package/templates/asyncapi/users/azhang.md +11 -0
- package/templates/asyncapi/users/dboyne.md +32 -0
- package/templates/asyncapi/users/dkim.md +11 -0
- package/templates/asyncapi/users/jbrown.md +11 -0
- package/templates/asyncapi/users/mSmith.md +8 -0
- package/templates/index.ts +10 -0
- package/templates/openapi/Dockerfile +23 -0
- package/templates/openapi/README-template.md +1 -0
- package/templates/openapi/dockerignore +8 -0
- package/templates/openapi/eventcatalog.config.js +60 -0
- package/templates/openapi/eventcatalog.styles.css +1 -0
- package/templates/openapi/gitignore +24 -0
- package/templates/openapi/npmrc +1 -0
- package/templates/openapi/openapi-files/cart-api.yml +107 -0
- package/templates/openapi/openapi-files/order-api.yml +148 -0
- package/templates/openapi/openapi-files/order-history.yml +93 -0
- package/templates/openapi/openapi-files/payment-api.yml +74 -0
- package/templates/openapi/openapi-files/product-api.yml +68 -0
- package/templates/openapi/public/logo.png +0 -0
- package/templates/openapi/teams/order-management.md +31 -0
- package/templates/openapi/teams/payment-management.md +18 -0
- package/templates/openapi/teams/product-management.md +18 -0
- package/templates/openapi/users/aSmith.md +27 -0
- package/templates/openapi/users/alee.md +8 -0
- package/templates/openapi/users/azhang.md +11 -0
- package/templates/openapi/users/dboyne.md +32 -0
- package/templates/openapi/users/dkim.md +11 -0
- package/templates/openapi/users/jbrown.md +11 -0
- package/templates/openapi/users/mSmith.md +8 -0
- package/templates/types.ts +1 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import url from 'url';
|
|
3
|
+
|
|
4
|
+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
5
|
+
|
|
6
|
+
/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */
|
|
7
|
+
export default {
|
|
8
|
+
title: 'EventCatalog',
|
|
9
|
+
tagline: 'Discover, Explore and Document your Event Driven Architectures',
|
|
10
|
+
organizationName: '<organizationName>',
|
|
11
|
+
homepageLink: 'https://eventcatalog.dev/',
|
|
12
|
+
editUrl: 'https://github.com/boyney123/eventcatalog-demo/edit/master',
|
|
13
|
+
// By default set to false, add true to get urls ending in /
|
|
14
|
+
trailingSlash: false,
|
|
15
|
+
// Change to make the base url of the site different, by default https://{website}.com/docs,
|
|
16
|
+
// changing to /company would be https://{website}.com/company/docs,
|
|
17
|
+
base: '/',
|
|
18
|
+
logo: {
|
|
19
|
+
alt: 'EventCatalog Logo',
|
|
20
|
+
src: '/logo.png',
|
|
21
|
+
text: 'EventCatalog',
|
|
22
|
+
},
|
|
23
|
+
generators: [
|
|
24
|
+
[
|
|
25
|
+
'@eventcatalog/generator-asyncapi',
|
|
26
|
+
{
|
|
27
|
+
services: [
|
|
28
|
+
{ path: path.join(__dirname, 'asyncapi-files', 'orders-service.yml'), owners: ['order-management'], id: 'Orders Service' },
|
|
29
|
+
],
|
|
30
|
+
domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
'@eventcatalog/generator-asyncapi',
|
|
35
|
+
{
|
|
36
|
+
services: [
|
|
37
|
+
{ path: path.join(__dirname, 'asyncapi-files', 'payment-service.yml'), owners: ['order-management'], id: 'Payment Service' },
|
|
38
|
+
],
|
|
39
|
+
domain: { id: 'payment', name: 'Payment', version: '0.0.1' },
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
'@eventcatalog/generator-asyncapi',
|
|
44
|
+
{
|
|
45
|
+
services: [
|
|
46
|
+
{ path: path.join(__dirname, 'asyncapi-files', 'user-service.yml'), owners: ['user-management'], id: 'User Service' },
|
|
47
|
+
],
|
|
48
|
+
domain: { id: 'user-domain', name: 'User Domain', version: '0.0.1' },
|
|
49
|
+
debug: true
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
],
|
|
53
|
+
// required random generated id used by eventcatalog
|
|
54
|
+
cId: '<cId>'
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Custom styling support coming soon. */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
/node_modules
|
|
3
|
+
|
|
4
|
+
# Production
|
|
5
|
+
/build
|
|
6
|
+
|
|
7
|
+
# Generated files
|
|
8
|
+
.astro
|
|
9
|
+
out
|
|
10
|
+
dist
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Misc
|
|
14
|
+
.DS_Store
|
|
15
|
+
.env.local
|
|
16
|
+
.env.development.local
|
|
17
|
+
.env.test.local
|
|
18
|
+
.env.production.local
|
|
19
|
+
|
|
20
|
+
npm-debug.log*
|
|
21
|
+
yarn-debug.log*
|
|
22
|
+
yarn-error.log*
|
|
23
|
+
|
|
24
|
+
.eventcatalog-core
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
strict-peer-dependencies=false
|
|
Binary file
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: order-management
|
|
3
|
+
name: Order Management
|
|
4
|
+
summmary: Order Management team based in London, UK
|
|
5
|
+
members:
|
|
6
|
+
- dboyne
|
|
7
|
+
- asmith
|
|
8
|
+
- msmith
|
|
9
|
+
- alee
|
|
10
|
+
- azhang
|
|
11
|
+
email: test@test.com
|
|
12
|
+
slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
The Order Management team is responsible for managing orders, inventory, shipment and payment.
|
|
18
|
+
|
|
19
|
+
## Responsibilities
|
|
20
|
+
|
|
21
|
+
- Manage orders and order processing
|
|
22
|
+
- Manage inventory and inventory processing
|
|
23
|
+
- Manage shipment and shipment processing
|
|
24
|
+
- Manage payment and payment processing
|
|
25
|
+
- Manage user and user processing
|
|
26
|
+
|
|
27
|
+
## Key Contacts
|
|
28
|
+
|
|
29
|
+
- David Boyne
|
|
30
|
+
- Alice Smith
|
|
31
|
+
- Mike Smith
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: user-management
|
|
3
|
+
name: User Management
|
|
4
|
+
members:
|
|
5
|
+
- dboyne
|
|
6
|
+
- jbrown
|
|
7
|
+
- dkim
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
The user management team is responsible for managing users and user accounts.
|
|
11
|
+
|
|
12
|
+
## Responsibilities
|
|
13
|
+
|
|
14
|
+
- Manage user and user account management
|
|
15
|
+
- Manage user and user account provisioning
|
|
16
|
+
- Manage user and user account deprovisioning
|
|
17
|
+
- Manage user and user account password management
|
|
18
|
+
- Manage user and user account role management
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: asmith
|
|
3
|
+
name: Amy Smith
|
|
4
|
+
avatarUrl: https://randomuser.me/api/portraits/women/48.jpg
|
|
5
|
+
role: Product owner
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Hello! I'm Amy Smith, the Product Owner of the innovative Full Stackers team. With a strong focus on delivering exceptional value, I specialize in connecting business objectives with technical solutions to create products that users love.
|
|
9
|
+
|
|
10
|
+
### About Me
|
|
11
|
+
|
|
12
|
+
With a comprehensive background in product management and a solid understanding of software development, I bring a unique perspective to the table. My career has been driven by a passion for understanding user needs, defining clear product visions, and leading teams to successful product deliveries.
|
|
13
|
+
|
|
14
|
+
### What I Do
|
|
15
|
+
|
|
16
|
+
As the Product Owner for Full Stackers, my role involves a wide range of responsibilities aimed at ensuring our products are both high-quality and user-centric. Key aspects of my role include:
|
|
17
|
+
|
|
18
|
+
- **Product Vision & Strategy**: Defining and communicating the long-term vision and strategy for our products, ensuring alignment with the company's objectives and market demands.
|
|
19
|
+
- **Roadmap Planning**: Developing and maintaining a product roadmap that highlights key features and milestones, prioritizing tasks based on their business value and user feedback.
|
|
20
|
+
- **Stakeholder Management**: Engaging with stakeholders across the organization to gather requirements, provide updates, and ensure everyone is aligned on the product's direction.
|
|
21
|
+
- **User-Centric Design**: Championing the end-users by conducting user research, analyzing feedback, and ensuring our products effectively solve their problems.
|
|
22
|
+
- **Agile Leadership**: Leading the development process using Agile methodologies, facilitating sprint planning, and ensuring the team has clear priorities and objectives.
|
|
23
|
+
|
|
24
|
+
My mission is to deliver products that not only meet but exceed customer expectations. I thrive on the challenge of translating complex requirements into simple, intuitive solutions.
|
|
25
|
+
|
|
26
|
+
If you’re interested in product management, user experience, or discussing the latest trends in technology, feel free to reach out!
|
|
27
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: alee
|
|
3
|
+
name: Alice Lee
|
|
4
|
+
avatarUrl: https://randomuser.me/api/portraits/women/91.jpg
|
|
5
|
+
role: Technical Writer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
As a Technical Writer on the Documentation team, I create clear, comprehensive documentation for our products and APIs. My focus is on making complex technical concepts accessible to developers and end-users alike. I collaborate with engineering teams to ensure our documentation stays current and accurate.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: azhang
|
|
3
|
+
name: Alice Zhang
|
|
4
|
+
avatarUrl: https://randomuser.me/api/portraits/women/97.jpg
|
|
5
|
+
role: Data Engineer
|
|
6
|
+
email: azhang@company.com
|
|
7
|
+
slackDirectMessageUrl: https://yourteam.slack.com/channels/azhang
|
|
8
|
+
msTeamsDirectMessageUrl: https://teams.microsoft.com/l/chat/0/0?users=azhang@company.com
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Building and maintaining data pipelines and infrastructure...
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: dboyne
|
|
3
|
+
name: David Boyne
|
|
4
|
+
avatarUrl: "https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png"
|
|
5
|
+
role: Lead developer
|
|
6
|
+
email: test@test.com
|
|
7
|
+
slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
Hello! I'm David Boyne, the Tech Lead of an amazing team called Full Stackers. With a passion for building robust and scalable systems, I specialize in designing and implementing event-driven architectures that power modern, responsive applications.
|
|
11
|
+
|
|
12
|
+
### About Me
|
|
13
|
+
|
|
14
|
+
With over a decade of experience in the tech industry, I have honed my skills in full-stack development, cloud computing, and distributed systems. My journey has taken me through various roles, from software engineer to architect, and now as a tech lead, I am committed to driving innovation and excellence within my team.
|
|
15
|
+
|
|
16
|
+
### What I Do
|
|
17
|
+
|
|
18
|
+
At Full Stackers, we focus on creating seamless and efficient event-driven architectures that enhance the performance and scalability of our applications. My role involves:
|
|
19
|
+
|
|
20
|
+
- **Architecture Design**: Crafting scalable and resilient system architectures using event-driven paradigms.
|
|
21
|
+
- **Team Leadership**: Guiding a talented team of developers, fostering a collaborative and innovative environment.
|
|
22
|
+
- **Code Reviews & Mentorship**: Ensuring code quality and sharing knowledge to help the team grow.
|
|
23
|
+
- **Stakeholder Collaboration**: Working closely with other teams and stakeholders to align our technical solutions with business goals.
|
|
24
|
+
- **Continuous Improvement**: Advocating for best practices in software development, deployment, and monitoring.
|
|
25
|
+
|
|
26
|
+
I am passionate about leveraging the power of events to build systems that are not only highly responsive but also easier to maintain and extend. In an ever-evolving tech landscape, I strive to stay ahead of the curve, continuously learning and adapting to new technologies and methodologies.
|
|
27
|
+
|
|
28
|
+
Feel free to connect with me to discuss all things tech, event-driven architectures, or to exchange ideas on building better software systems!
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
*David Boyne*
|
|
32
|
+
*Tech Lead, Full Stackers*
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: dkim
|
|
3
|
+
name: David Kim
|
|
4
|
+
avatarUrl: https://randomuser.me/api/portraits/men/96.jpg
|
|
5
|
+
role: Performance Engineer
|
|
6
|
+
email: dkim@company.com
|
|
7
|
+
slackDirectMessageUrl: https://yourteam.slack.com/channels/dkim
|
|
8
|
+
msTeamsDirectMessageUrl: https://teams.microsoft.com/l/chat/0/0?users=dkim@company.com
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Optimizing application performance and user experience...
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: jbrown
|
|
3
|
+
name: Jessica Brown
|
|
4
|
+
avatarUrl: https://randomuser.me/api/portraits/women/95.jpg
|
|
5
|
+
role: UI/UX Designer
|
|
6
|
+
email: jbrown@company.com
|
|
7
|
+
slackDirectMessageUrl: https://yourteam.slack.com/channels/jbrown
|
|
8
|
+
msTeamsDirectMessageUrl: https://teams.microsoft.com/l/chat/0/0?users=jbrown@company.com
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Creating intuitive and engaging user interfaces...
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: msmith
|
|
3
|
+
name: Martin Smith
|
|
4
|
+
avatarUrl: "https://randomuser.me/api/portraits/men/51.jpg"
|
|
5
|
+
role: Senior software engineer
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
As a Senior Mobile Developer on The Mobile Devs team, I play a key role in designing, developing, and maintaining our company’s mobile applications. My focus is on creating a seamless and intuitive user experience for our customers on both iOS and Android platforms. I work closely with cross-functional teams, including backend developers, UX/UI designers, and product managers, to deliver high-quality mobile solutions that meet business objectives and exceed user expectations.
|
package/templates/index.ts
CHANGED
|
@@ -72,6 +72,16 @@ export const installTemplate = async ({
|
|
|
72
72
|
const dependencies = [
|
|
73
73
|
"@eventcatalog/core"
|
|
74
74
|
] as any;
|
|
75
|
+
|
|
76
|
+
// if asyncapi is selected, add the asyncapi dependencies
|
|
77
|
+
if (template === "asyncapi") {
|
|
78
|
+
dependencies.push("@eventcatalog/generator-asyncapi");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (template === "openapi") {
|
|
82
|
+
dependencies.push("@eventcatalog/generator-openapi");
|
|
83
|
+
}
|
|
84
|
+
|
|
75
85
|
// "@myuser/my-package": "file:../lib"
|
|
76
86
|
const devDependencies = [] as any;
|
|
77
87
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Stage 1: Build the app
|
|
2
|
+
FROM node:lts AS build
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
# Install dependencies
|
|
7
|
+
COPY package.json package-lock.json ./
|
|
8
|
+
RUN npm install
|
|
9
|
+
|
|
10
|
+
# Copy source code
|
|
11
|
+
COPY . .
|
|
12
|
+
|
|
13
|
+
# Fix for Astro in Docker: https://github.com/withastro/astro/issues/2596
|
|
14
|
+
ENV NODE_OPTIONS=--max_old_space_size=2048
|
|
15
|
+
# Build the app
|
|
16
|
+
RUN npm run build
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Stage 2: Serve app with httpd server
|
|
20
|
+
FROM httpd:2.4
|
|
21
|
+
|
|
22
|
+
# Copy built app to serve
|
|
23
|
+
COPY --from=build /app/dist /usr/local/apache2/htdocs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# My Event Catalog
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import url from "url";
|
|
3
|
+
|
|
4
|
+
const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
|
|
5
|
+
|
|
6
|
+
/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */
|
|
7
|
+
export default {
|
|
8
|
+
title: "EventCatalog",
|
|
9
|
+
tagline: "Discover, Explore and Document your Event Driven Architectures",
|
|
10
|
+
organizationName: '<organizationName>',
|
|
11
|
+
homepageLink: "https://eventcatalog.dev/",
|
|
12
|
+
editUrl: "https://github.com/boyney123/eventcatalog-demo/edit/master",
|
|
13
|
+
// By default set to false, add true to get urls ending in /
|
|
14
|
+
trailingSlash: false,
|
|
15
|
+
// Change to make the base url of the site different, by default https://{website}.com/docs,
|
|
16
|
+
// changing to /company would be https://{website}.com/company/docs,
|
|
17
|
+
base: "/",
|
|
18
|
+
// Customize the logo, add your logo to public/ folder
|
|
19
|
+
logo: {
|
|
20
|
+
alt: "EventCatalog Logo",
|
|
21
|
+
src: "/logo.png",
|
|
22
|
+
text: "EventCatalog",
|
|
23
|
+
},
|
|
24
|
+
generators: [
|
|
25
|
+
[
|
|
26
|
+
"@eventcatalog/generator-openapi",
|
|
27
|
+
{
|
|
28
|
+
services: [
|
|
29
|
+
{ path: path.join(__dirname, "openapi-files", "product-api.yml"), id: 'product-service', owners: ['product-management'] },
|
|
30
|
+
],
|
|
31
|
+
domain: { id: "products", name: "Products", version: "0.0.1" },
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"@eventcatalog/generator-openapi",
|
|
36
|
+
{
|
|
37
|
+
services: [
|
|
38
|
+
{ path: path.join(__dirname, "openapi-files", "order-api.yml"), id: 'order-service', owners: ['order-management'] },
|
|
39
|
+
{ path: path.join(__dirname, "openapi-files", "order-history.yml"), id: 'order-history', owners: ['order-management'] },
|
|
40
|
+
],
|
|
41
|
+
domain: {
|
|
42
|
+
id: "order-management",
|
|
43
|
+
name: "Order management",
|
|
44
|
+
version: "0.0.1",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
[
|
|
49
|
+
"@eventcatalog/generator-openapi",
|
|
50
|
+
{
|
|
51
|
+
services: [
|
|
52
|
+
{ path: path.join(__dirname, "openapi-files", "payment-api.yml"), id: 'payment-service', owners: ['payment-management'] },
|
|
53
|
+
],
|
|
54
|
+
domain: { id: "payment", name: "Payment", version: "0.0.1" },
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
],
|
|
58
|
+
// required random generated id used by eventcatalog
|
|
59
|
+
cId: '<cId>'
|
|
60
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Custom styling support coming soon. */
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
/node_modules
|
|
3
|
+
|
|
4
|
+
# Production
|
|
5
|
+
/build
|
|
6
|
+
|
|
7
|
+
# Generated files
|
|
8
|
+
.astro
|
|
9
|
+
out
|
|
10
|
+
dist
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Misc
|
|
14
|
+
.DS_Store
|
|
15
|
+
.env.local
|
|
16
|
+
.env.development.local
|
|
17
|
+
.env.test.local
|
|
18
|
+
.env.production.local
|
|
19
|
+
|
|
20
|
+
npm-debug.log*
|
|
21
|
+
yarn-debug.log*
|
|
22
|
+
yarn-error.log*
|
|
23
|
+
|
|
24
|
+
.eventcatalog-core
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
strict-peer-dependencies=false
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
openapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Cart API
|
|
4
|
+
description: API for managing shopping cart operations.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
servers:
|
|
7
|
+
- url: https://api.yourshoppingapp.com/cart
|
|
8
|
+
description: Cart API Server
|
|
9
|
+
paths:
|
|
10
|
+
/:
|
|
11
|
+
get:
|
|
12
|
+
summary: Retrieve shopping cart
|
|
13
|
+
description: Get the contents of the user's shopping cart.
|
|
14
|
+
x-eventcatalog-message-type: query
|
|
15
|
+
operationId: getCart
|
|
16
|
+
responses:
|
|
17
|
+
'200':
|
|
18
|
+
description: Shopping cart details
|
|
19
|
+
content:
|
|
20
|
+
application/json:
|
|
21
|
+
schema:
|
|
22
|
+
$ref: '#/components/schemas/Cart'
|
|
23
|
+
post:
|
|
24
|
+
summary: Add item to cart
|
|
25
|
+
description: Add a product to the shopping cart.
|
|
26
|
+
x-eventcatalog-message-type: command
|
|
27
|
+
requestBody:
|
|
28
|
+
description: Product information to add to the cart.
|
|
29
|
+
required: true
|
|
30
|
+
content:
|
|
31
|
+
application/json:
|
|
32
|
+
schema:
|
|
33
|
+
$ref: '#/components/schemas/CartItem'
|
|
34
|
+
responses:
|
|
35
|
+
'201':
|
|
36
|
+
description: Product added to cart
|
|
37
|
+
content:
|
|
38
|
+
application/json:
|
|
39
|
+
schema:
|
|
40
|
+
$ref: '#/components/schemas/Cart'
|
|
41
|
+
/{productId}:
|
|
42
|
+
patch:
|
|
43
|
+
summary: Update item quantity
|
|
44
|
+
description: Update the quantity of an item in the cart.
|
|
45
|
+
x-eventcatalog-message-type: command
|
|
46
|
+
operationId: updateCartItem
|
|
47
|
+
parameters:
|
|
48
|
+
- name: productId
|
|
49
|
+
in: path
|
|
50
|
+
required: true
|
|
51
|
+
schema:
|
|
52
|
+
type: string
|
|
53
|
+
requestBody:
|
|
54
|
+
description: Updated quantity
|
|
55
|
+
required: true
|
|
56
|
+
content:
|
|
57
|
+
application/json:
|
|
58
|
+
schema:
|
|
59
|
+
type: object
|
|
60
|
+
properties:
|
|
61
|
+
quantity:
|
|
62
|
+
type: integer
|
|
63
|
+
minimum: 1
|
|
64
|
+
responses:
|
|
65
|
+
'200':
|
|
66
|
+
description: Quantity updated
|
|
67
|
+
'404':
|
|
68
|
+
description: Product not found in cart
|
|
69
|
+
delete:
|
|
70
|
+
summary: Remove item from cart
|
|
71
|
+
description: Remove a product from the shopping cart.
|
|
72
|
+
x-eventcatalog-message-type: command
|
|
73
|
+
parameters:
|
|
74
|
+
- name: productId
|
|
75
|
+
in: path
|
|
76
|
+
required: true
|
|
77
|
+
schema:
|
|
78
|
+
type: string
|
|
79
|
+
responses:
|
|
80
|
+
'204':
|
|
81
|
+
description: Product removed from cart
|
|
82
|
+
components:
|
|
83
|
+
schemas:
|
|
84
|
+
Cart:
|
|
85
|
+
type: object
|
|
86
|
+
properties:
|
|
87
|
+
items:
|
|
88
|
+
type: array
|
|
89
|
+
items:
|
|
90
|
+
$ref: '#/components/schemas/CartItem'
|
|
91
|
+
CartItem:
|
|
92
|
+
type: object
|
|
93
|
+
properties:
|
|
94
|
+
productId:
|
|
95
|
+
type: string
|
|
96
|
+
name:
|
|
97
|
+
type: string
|
|
98
|
+
quantity:
|
|
99
|
+
type: integer
|
|
100
|
+
price:
|
|
101
|
+
type: number
|
|
102
|
+
format: float
|
|
103
|
+
required:
|
|
104
|
+
- productId
|
|
105
|
+
- name
|
|
106
|
+
- quantity
|
|
107
|
+
- price
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
openapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Order API
|
|
4
|
+
description: API for managing orders in the shopping application.
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
servers:
|
|
7
|
+
- url: https://api.yourshoppingapp.com/orders
|
|
8
|
+
description: Order API Server
|
|
9
|
+
paths:
|
|
10
|
+
/:
|
|
11
|
+
get:
|
|
12
|
+
summary: Get list of orders
|
|
13
|
+
description: Retrieve a list of all orders made by the user.
|
|
14
|
+
x-eventcatalog-message-type: query
|
|
15
|
+
operationId: listOrders
|
|
16
|
+
responses:
|
|
17
|
+
'200':
|
|
18
|
+
description: A list of orders
|
|
19
|
+
content:
|
|
20
|
+
application/json:
|
|
21
|
+
schema:
|
|
22
|
+
type: array
|
|
23
|
+
items:
|
|
24
|
+
$ref: '#/components/schemas/Order'
|
|
25
|
+
'500':
|
|
26
|
+
description: Internal server error
|
|
27
|
+
content:
|
|
28
|
+
application/json:
|
|
29
|
+
schema:
|
|
30
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
31
|
+
/{orderId}:
|
|
32
|
+
get:
|
|
33
|
+
summary: Get order by ID
|
|
34
|
+
description: Retrieve details of a specific order.
|
|
35
|
+
operationId: getOrderById
|
|
36
|
+
x-eventcatalog-message-type: query
|
|
37
|
+
parameters:
|
|
38
|
+
- name: orderId
|
|
39
|
+
in: path
|
|
40
|
+
required: true
|
|
41
|
+
schema:
|
|
42
|
+
type: string
|
|
43
|
+
responses:
|
|
44
|
+
'200':
|
|
45
|
+
description: Order details
|
|
46
|
+
content:
|
|
47
|
+
application/json:
|
|
48
|
+
schema:
|
|
49
|
+
$ref: '#/components/schemas/Order'
|
|
50
|
+
'404':
|
|
51
|
+
description: Order not found
|
|
52
|
+
content:
|
|
53
|
+
application/json:
|
|
54
|
+
schema:
|
|
55
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
56
|
+
'500':
|
|
57
|
+
description: Internal server error
|
|
58
|
+
content:
|
|
59
|
+
application/json:
|
|
60
|
+
schema:
|
|
61
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
62
|
+
patch:
|
|
63
|
+
summary: Update order status
|
|
64
|
+
description: Update the status of an order (e.g., cancel).
|
|
65
|
+
x-eventcatalog-message-type: command
|
|
66
|
+
parameters:
|
|
67
|
+
- name: orderId
|
|
68
|
+
in: path
|
|
69
|
+
required: true
|
|
70
|
+
schema:
|
|
71
|
+
type: string
|
|
72
|
+
requestBody:
|
|
73
|
+
description: Updated order status
|
|
74
|
+
required: true
|
|
75
|
+
content:
|
|
76
|
+
application/json:
|
|
77
|
+
schema:
|
|
78
|
+
type: object
|
|
79
|
+
properties:
|
|
80
|
+
status:
|
|
81
|
+
type: string
|
|
82
|
+
enum: [pending, shipped, delivered, canceled]
|
|
83
|
+
responses:
|
|
84
|
+
'200':
|
|
85
|
+
description: Order status updated
|
|
86
|
+
'404':
|
|
87
|
+
description: Order not found
|
|
88
|
+
content:
|
|
89
|
+
application/json:
|
|
90
|
+
schema:
|
|
91
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
92
|
+
'500':
|
|
93
|
+
description: Internal server error
|
|
94
|
+
content:
|
|
95
|
+
application/json:
|
|
96
|
+
schema:
|
|
97
|
+
$ref: '#/components/schemas/ErrorResponse'
|
|
98
|
+
components:
|
|
99
|
+
schemas:
|
|
100
|
+
Order:
|
|
101
|
+
type: object
|
|
102
|
+
properties:
|
|
103
|
+
id:
|
|
104
|
+
type: string
|
|
105
|
+
items:
|
|
106
|
+
type: array
|
|
107
|
+
items:
|
|
108
|
+
$ref: '#/components/schemas/CartItem'
|
|
109
|
+
status:
|
|
110
|
+
type: string
|
|
111
|
+
enum: [pending, shipped, delivered, canceled]
|
|
112
|
+
totalAmount:
|
|
113
|
+
type: number
|
|
114
|
+
format: float
|
|
115
|
+
required:
|
|
116
|
+
- id
|
|
117
|
+
- items
|
|
118
|
+
- status
|
|
119
|
+
- totalAmount
|
|
120
|
+
CartItem:
|
|
121
|
+
type: object
|
|
122
|
+
properties:
|
|
123
|
+
productId:
|
|
124
|
+
type: string
|
|
125
|
+
name:
|
|
126
|
+
type: string
|
|
127
|
+
quantity:
|
|
128
|
+
type: integer
|
|
129
|
+
price:
|
|
130
|
+
type: number
|
|
131
|
+
format: float
|
|
132
|
+
required:
|
|
133
|
+
- productId
|
|
134
|
+
- name
|
|
135
|
+
- quantity
|
|
136
|
+
- price
|
|
137
|
+
ErrorResponse:
|
|
138
|
+
type: object
|
|
139
|
+
properties:
|
|
140
|
+
code:
|
|
141
|
+
type: integer
|
|
142
|
+
description: Error code representing the issue
|
|
143
|
+
message:
|
|
144
|
+
type: string
|
|
145
|
+
description: A description of the error
|
|
146
|
+
required:
|
|
147
|
+
- code
|
|
148
|
+
- message
|