Skip to content

Commit 7d4a982

Browse files
author
messageflow-ci-bot
committed
Sync: holydocs/messageflow-source-workflow-example @ 33ae2c0e2d39b2de6989b639dbd3f57e7e46c75d
1 parent 62b252a commit 7d4a982

File tree

9 files changed

+1899
-0
lines changed

9 files changed

+1899
-0
lines changed
Lines changed: 284 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,284 @@
1+
asyncapi: 3.0.0
2+
3+
info:
4+
title: User Service
5+
version: 1.0.0
6+
description: |
7+
A service that manages user information, profiles, and authentication.
8+
Handles user data requests, profile updates, and user lifecycle events.
9+
10+
channels:
11+
user.info.request:
12+
address: user.info.request
13+
parameters:
14+
user_id:
15+
description: ID of the user to request information for
16+
messages:
17+
UserInfoRequest:
18+
$ref: '#/components/messages/UserInfoRequest'
19+
UserInfoReply:
20+
$ref: '#/components/messages/UserInfoReply'
21+
22+
user.info.update:
23+
address: user.info.update
24+
messages:
25+
UserInfoUpdate:
26+
$ref: '#/components/messages/UserInfoUpdate'
27+
28+
user.analytics:
29+
address: user.analytics
30+
messages:
31+
UserAnalyticsEvent:
32+
$ref: '#/components/messages/UserAnalyticsEvent'
33+
34+
notification.preferences.update:
35+
address: notification.preferences.update
36+
messages:
37+
PreferencesUpdate:
38+
$ref: '#/components/messages/PreferencesUpdate'
39+
40+
operations:
41+
replyUserInfo:
42+
action: receive
43+
channel:
44+
$ref: '#/channels/user.info.request'
45+
summary: Receive user information request and reply with user data
46+
messages:
47+
- $ref: '#/channels/user.info.request/messages/UserInfoRequest'
48+
reply:
49+
channel:
50+
$ref: '#/channels/user.info.request'
51+
messages:
52+
- $ref: '#/channels/user.info.request/messages/UserInfoReply'
53+
54+
sendUserInfoUpdate:
55+
action: send
56+
channel:
57+
$ref: '#/channels/user.info.update'
58+
summary: Publish user information updates
59+
messages:
60+
- $ref: '#/channels/user.info.update/messages/UserInfoUpdate'
61+
62+
sendUserAnalytics:
63+
action: send
64+
channel:
65+
$ref: '#/channels/user.analytics'
66+
summary: Publish user analytics events
67+
messages:
68+
- $ref: '#/channels/user.analytics/messages/UserAnalyticsEvent'
69+
70+
sendNotificationPreferencesUpdate:
71+
action: send
72+
channel:
73+
$ref: '#/channels/notification.preferences.update'
74+
summary: Send notification preferences updates to notification service
75+
messages:
76+
- $ref: '#/channels/notification.preferences.update/messages/PreferencesUpdate'
77+
78+
components:
79+
messages:
80+
UserInfoRequest:
81+
name: UserInfoRequest
82+
title: User Information Request Message
83+
summary: Message for requesting user information
84+
contentType: application/json
85+
payload:
86+
type: object
87+
properties:
88+
user_id:
89+
type: string
90+
format: uuid
91+
description: ID of the user to request information for
92+
required:
93+
- user_id
94+
95+
UserInfoReply:
96+
name: UserInfoReply
97+
title: User Information Reply Message
98+
summary: Message containing requested user information
99+
contentType: application/json
100+
payload:
101+
type: object
102+
properties:
103+
user_id:
104+
type: string
105+
format: uuid
106+
description: ID of the user
107+
email:
108+
type: string
109+
format: email
110+
description: User's email address
111+
name:
112+
type: string
113+
description: User's full name
114+
language:
115+
type: string
116+
pattern: '^[a-z]{2}-[A-Z]{2}$'
117+
description: User's preferred language (e.g., en-US)
118+
timezone:
119+
type: string
120+
description: User's timezone (e.g., America/New_York)
121+
error:
122+
type: object
123+
properties:
124+
code:
125+
type: string
126+
description: Error code
127+
message:
128+
type: string
129+
description: Error message
130+
required:
131+
- user_id
132+
133+
134+
UserInfoUpdate:
135+
name: UserInfoUpdate
136+
title: User Information Update Message
137+
summary: Message for publishing user information updates
138+
contentType: application/json
139+
payload:
140+
type: object
141+
properties:
142+
user_id:
143+
type: string
144+
format: uuid
145+
description: ID of the user
146+
changes:
147+
type: object
148+
description: Object containing the changed fields and their new values
149+
updated_at:
150+
type: string
151+
format: date-time
152+
description: When the update occurred
153+
metadata:
154+
$ref: '#/components/schemas/Metadata'
155+
required:
156+
- user_id
157+
- update_type
158+
- updated_at
159+
160+
UserAnalyticsEvent:
161+
name: UserAnalyticsEvent
162+
title: User Analytics Event Message
163+
summary: Message for tracking user-related analytics
164+
contentType: application/json
165+
payload:
166+
type: object
167+
properties:
168+
event_id:
169+
type: string
170+
format: uuid
171+
description: Unique identifier for the event
172+
event_type:
173+
type: string
174+
enum: [user_registered, user_logged_in, profile_updated, preferences_changed, account_deleted]
175+
description: Type of the analytics event
176+
user_id:
177+
type: string
178+
format: uuid
179+
description: ID of the user
180+
timestamp:
181+
type: string
182+
format: date-time
183+
description: When the event occurred
184+
metadata:
185+
$ref: '#/components/schemas/Metadata'
186+
required:
187+
- event_id
188+
- event_type
189+
- user_id
190+
- timestamp
191+
192+
PreferencesUpdate:
193+
name: PreferencesUpdate
194+
title: Preferences Update Message
195+
summary: Message for updating user notification preferences
196+
contentType: application/json
197+
payload:
198+
type: object
199+
properties:
200+
user_id:
201+
type: string
202+
format: uuid
203+
description: ID of the user
204+
preferences:
205+
$ref: '#/components/schemas/NotificationPreferences'
206+
updated_at:
207+
type: string
208+
format: date-time
209+
description: When the preferences were updated
210+
required:
211+
- user_id
212+
- preferences
213+
214+
schemas:
215+
Metadata:
216+
type: object
217+
properties:
218+
source:
219+
type: string
220+
enum: [mobile, web, api]
221+
default: api
222+
platform:
223+
type: string
224+
enum: [ios, android, web]
225+
version:
226+
type: string
227+
pattern: '^\d+\.\d+\.\d+$'
228+
environment:
229+
type: string
230+
enum: [development, staging, production]
231+
default: production
232+
required:
233+
- source
234+
- environment
235+
236+
NotificationPreferences:
237+
type: object
238+
properties:
239+
email_enabled:
240+
type: boolean
241+
default: true
242+
push_enabled:
243+
type: boolean
244+
default: true
245+
sms_enabled:
246+
type: boolean
247+
default: false
248+
quiet_hours:
249+
type: object
250+
properties:
251+
enabled:
252+
type: boolean
253+
default: false
254+
start:
255+
type: string
256+
format: time
257+
description: Start time in 24-hour format (HH:mm)
258+
end:
259+
type: string
260+
format: time
261+
description: End time in 24-hour format (HH:mm)
262+
required:
263+
- enabled
264+
categories:
265+
type: object
266+
properties:
267+
marketing:
268+
type: boolean
269+
default: true
270+
updates:
271+
type: boolean
272+
default: true
273+
security:
274+
type: boolean
275+
default: true
276+
required:
277+
- marketing
278+
- updates
279+
- security
280+
required:
281+
- email_enabled
282+
- push_enabled
283+
- sms_enabled
284+
- categories

0 commit comments

Comments
 (0)