Skip to content

Commit 0e5b2f1

Browse files
author
messageflow-ci-bot
committed
Sync: holydocs/messageflow-source-workflow-example @ 0df69e2dc18c7b388954e86059da874836e83fe3
1 parent 836b87a commit 0e5b2f1

19 files changed

+3309
-910
lines changed

deps/holydocs/messageflow-source-workflow-example/analytics.asyncapi.yaml

Lines changed: 564 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 359 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,359 @@
1+
asyncapi: 3.0.0
2+
3+
info:
4+
title: Notification Service
5+
version: 1.0.0
6+
description: |
7+
A service that handles user notifications, preferences, and interactions.
8+
Supports real-time notifications, user preferences management.
9+
10+
channels:
11+
notification.user.{user_id}.push:
12+
address: notification.user.{user_id}.push
13+
parameters:
14+
user_id:
15+
description: ID of the user receiving the notification
16+
messages:
17+
PushNotification:
18+
$ref: '#/components/messages/PushNotification'
19+
20+
notification.preferences.update:
21+
address: notification.preferences.update
22+
messages:
23+
PreferencesUpdate:
24+
$ref: '#/components/messages/PreferencesUpdate'
25+
26+
notification.preferences.get:
27+
address: notification.preferences.get
28+
parameters:
29+
user_id:
30+
description: ID of the user receiving the preferences
31+
messages:
32+
PreferencesRequest:
33+
$ref: '#/components/messages/PreferencesRequest'
34+
PreferencesReply:
35+
$ref: '#/components/messages/PreferencesReply'
36+
37+
user.info.request:
38+
address: user.info.request
39+
parameters:
40+
user_id:
41+
description: ID of the user to request information for
42+
messages:
43+
UserInfoRequest:
44+
$ref: '#/components/messages/UserInfoRequest'
45+
UserInfoReply:
46+
$ref: '#/components/messages/UserInfoReply'
47+
48+
notification.analytics:
49+
address: notification.analytics
50+
messages:
51+
AnalyticsEvent:
52+
$ref: '#/components/messages/AnalyticsEvent'
53+
54+
operations:
55+
receivePushNotification:
56+
action: receive
57+
channel:
58+
$ref: '#/channels/notification.user.{user_id}.push'
59+
summary: Receive a message to send a push notification to a specific user
60+
messages:
61+
- $ref: '#/channels/notification.user.{user_id}.push/messages/PushNotification'
62+
63+
receivePreferencesUpdate:
64+
action: receive
65+
channel:
66+
$ref: '#/channels/notification.preferences.update'
67+
summary: Receive user preferences updates
68+
messages:
69+
- $ref: '#/channels/notification.preferences.update/messages/PreferencesUpdate'
70+
71+
replyPreferences:
72+
action: receive
73+
channel:
74+
$ref: '#/channels/notification.preferences.get'
75+
summary: Receive user preferences updates
76+
messages:
77+
- $ref: '#/channels/notification.preferences.get/messages/PreferencesRequest'
78+
reply:
79+
channel:
80+
$ref: '#/channels/notification.preferences.get'
81+
messages:
82+
- $ref: '#/channels/notification.preferences.get/messages/PreferencesReply'
83+
84+
sendAnalytics:
85+
action: send
86+
channel:
87+
$ref: '#/channels/notification.analytics'
88+
summary: Publish analytics events
89+
messages:
90+
- $ref: '#/channels/notification.analytics/messages/AnalyticsEvent'
91+
92+
requestUserInfo:
93+
action: send
94+
channel:
95+
$ref: '#/channels/user.info.request'
96+
summary: Request user information from user service
97+
messages:
98+
- $ref: '#/channels/user.info.request/messages/UserInfoRequest'
99+
reply:
100+
channel:
101+
$ref: '#/channels/user.info.request'
102+
messages:
103+
- $ref: '#/channels/user.info.request/messages/UserInfoReply'
104+
105+
components:
106+
messages:
107+
PushNotification:
108+
name: PushNotification
109+
title: Push Notification Message
110+
summary: Message for sending push notifications to users
111+
contentType: application/json
112+
payload:
113+
type: object
114+
properties:
115+
notification_id:
116+
type: string
117+
format: uuid
118+
description: Unique identifier for the notification
119+
user_id:
120+
type: string
121+
format: uuid
122+
description: ID of the user receiving the notification
123+
title:
124+
type: string
125+
description: Notification title
126+
body:
127+
type: string
128+
description: Notification body
129+
priority:
130+
type: string
131+
enum: [low, normal, high]
132+
default: normal
133+
data:
134+
type: object
135+
description: Additional notification data
136+
created_at:
137+
type: string
138+
format: date-time
139+
description: When the notification was created
140+
required:
141+
- notification_id
142+
- user_id
143+
- title
144+
- body
145+
146+
PreferencesRequest:
147+
name: PreferencesRequest
148+
title: Preferences Request Message
149+
summary: Message for requesting user notification preferences
150+
contentType: application/json
151+
payload:
152+
type: object
153+
properties:
154+
user_id:
155+
type: string
156+
format: uuid
157+
description: ID of the user
158+
required:
159+
- user_id
160+
161+
PreferencesReply:
162+
name: PreferencesReply
163+
title: Preferences Reply Message
164+
summary: Message for replying to user notification preferences
165+
contentType: application/json
166+
payload:
167+
type: object
168+
properties:
169+
preferences:
170+
$ref: '#/components/schemas/NotificationPreferences'
171+
updated_at:
172+
type: string
173+
format: date-time
174+
description: When the preferences were updated
175+
required:
176+
- preferences
177+
178+
PreferencesUpdate:
179+
name: PreferencesUpdate
180+
title: Preferences Update Message
181+
summary: Message for updating user notification preferences
182+
contentType: application/json
183+
payload:
184+
type: object
185+
properties:
186+
user_id:
187+
type: string
188+
format: uuid
189+
description: ID of the user
190+
preferences:
191+
$ref: '#/components/schemas/NotificationPreferences'
192+
updated_at:
193+
type: string
194+
format: date-time
195+
description: When the preferences were updated
196+
required:
197+
- user_id
198+
- preferences
199+
200+
AnalyticsEvent:
201+
name: AnalyticsEvent
202+
title: Analytics Event Message
203+
summary: Message for tracking notification-related analytics
204+
contentType: application/json
205+
payload:
206+
type: object
207+
properties:
208+
event_id:
209+
type: string
210+
format: uuid
211+
description: Unique identifier for the event
212+
event_type:
213+
type: string
214+
enum: [notification_sent, notification_opened, notification_clicked]
215+
description: Type of the analytics event
216+
user_id:
217+
type: string
218+
format: uuid
219+
description: ID of the user
220+
notification_id:
221+
type: string
222+
format: uuid
223+
description: ID of the related notification
224+
timestamp:
225+
type: string
226+
format: date-time
227+
description: When the event occurred
228+
metadata:
229+
$ref: '#/components/schemas/Metadata'
230+
required:
231+
- event_id
232+
- event_type
233+
- user_id
234+
- timestamp
235+
236+
UserInfoRequest:
237+
name: UserInfoRequest
238+
title: User Information Request Message
239+
summary: Message for requesting user information from user service
240+
contentType: application/json
241+
payload:
242+
type: object
243+
properties:
244+
user_id:
245+
type: string
246+
format: uuid
247+
description: ID of the user to request information for
248+
required:
249+
- user_id
250+
251+
UserInfoReply:
252+
name: UserInfoReply
253+
title: User Information Reply Message
254+
summary: Message containing requested user information
255+
contentType: application/json
256+
payload:
257+
type: object
258+
properties:
259+
user_id:
260+
type: string
261+
format: uuid
262+
description: ID of the user
263+
email:
264+
type: string
265+
format: email
266+
description: User's email address
267+
name:
268+
type: string
269+
description: User's full name
270+
language:
271+
type: string
272+
pattern: '^[a-z]{2}-[A-Z]{2}$'
273+
description: User's preferred language (e.g., en-US)
274+
timezone:
275+
type: string
276+
description: User's timezone (e.g., America/New_York)
277+
error:
278+
type: object
279+
properties:
280+
code:
281+
type: string
282+
description: Error code
283+
message:
284+
type: string
285+
description: Error message
286+
required:
287+
- user_id
288+
289+
schemas:
290+
NotificationPreferences:
291+
type: object
292+
properties:
293+
email_enabled:
294+
type: boolean
295+
default: true
296+
push_enabled:
297+
type: boolean
298+
default: true
299+
sms_enabled:
300+
type: boolean
301+
default: false
302+
quiet_hours:
303+
type: object
304+
properties:
305+
enabled:
306+
type: boolean
307+
default: false
308+
start:
309+
type: string
310+
format: time
311+
description: Start time in 24-hour format (HH:mm)
312+
end:
313+
type: string
314+
format: time
315+
description: End time in 24-hour format (HH:mm)
316+
required:
317+
- enabled
318+
categories:
319+
type: object
320+
properties:
321+
marketing:
322+
type: boolean
323+
default: true
324+
updates:
325+
type: boolean
326+
default: true
327+
security:
328+
type: boolean
329+
default: true
330+
required:
331+
- marketing
332+
- updates
333+
- security
334+
required:
335+
- email_enabled
336+
- push_enabled
337+
- sms_enabled
338+
- categories
339+
340+
Metadata:
341+
type: object
342+
properties:
343+
source:
344+
type: string
345+
enum: [mobile, web, api]
346+
default: api
347+
platform:
348+
type: string
349+
enum: [ios, android, web]
350+
version:
351+
type: string
352+
pattern: '^\d+\.\d+\.\d+$'
353+
environment:
354+
type: string
355+
enum: [development, staging, production]
356+
default: production
357+
required:
358+
- source
359+
- environment

0 commit comments

Comments
 (0)