@ioka-technologies/asyncapi-ts-client-template 0.0.33 → 0.0.34
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/example-api.yaml +221 -0
- package/package.json +2 -10
- package/dist/common/index.js +0 -3776
- package/template/helpers/security.js.dev +0 -84
- package/template/src/models.ts.js.dev +0 -21
package/example-api.yaml
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
asyncapi: 3.0.0
|
|
2
|
+
info:
|
|
3
|
+
title: Chat API
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
description: A simple chat API for real-time messaging
|
|
6
|
+
contact:
|
|
7
|
+
name: API Support
|
|
8
|
+
url: https://example.com/support
|
|
9
|
+
email: support@example.com
|
|
10
|
+
license:
|
|
11
|
+
name: Apache 2.0
|
|
12
|
+
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
|
13
|
+
|
|
14
|
+
servers:
|
|
15
|
+
websocket:
|
|
16
|
+
host: localhost:8080
|
|
17
|
+
protocol: ws
|
|
18
|
+
description: WebSocket server for real-time communication
|
|
19
|
+
http:
|
|
20
|
+
host: localhost:8080
|
|
21
|
+
protocol: http
|
|
22
|
+
description: HTTP server for REST API
|
|
23
|
+
|
|
24
|
+
channels:
|
|
25
|
+
user/profile:
|
|
26
|
+
address: user/profile
|
|
27
|
+
description: User profile operations
|
|
28
|
+
messages:
|
|
29
|
+
getUserProfile:
|
|
30
|
+
$ref: '#/components/messages/GetUserProfileRequest'
|
|
31
|
+
userProfile:
|
|
32
|
+
$ref: '#/components/messages/UserProfileResponse'
|
|
33
|
+
|
|
34
|
+
chat/message:
|
|
35
|
+
address: chat/message
|
|
36
|
+
description: Chat message operations
|
|
37
|
+
messages:
|
|
38
|
+
sendMessage:
|
|
39
|
+
$ref: '#/components/messages/SendMessageRequest'
|
|
40
|
+
messageReceived:
|
|
41
|
+
$ref: '#/components/messages/MessageReceivedEvent'
|
|
42
|
+
|
|
43
|
+
operations:
|
|
44
|
+
getUserProfile:
|
|
45
|
+
action: send
|
|
46
|
+
channel:
|
|
47
|
+
$ref: '#/channels/user~1profile'
|
|
48
|
+
messages:
|
|
49
|
+
- $ref: '#/components/messages/GetUserProfileRequest'
|
|
50
|
+
reply:
|
|
51
|
+
channel:
|
|
52
|
+
$ref: '#/channels/user~1profile'
|
|
53
|
+
messages:
|
|
54
|
+
- $ref: '#/components/messages/UserProfileResponse'
|
|
55
|
+
|
|
56
|
+
sendMessage:
|
|
57
|
+
action: send
|
|
58
|
+
channel:
|
|
59
|
+
$ref: '#/channels/chat~1message'
|
|
60
|
+
messages:
|
|
61
|
+
- $ref: '#/components/messages/SendMessageRequest'
|
|
62
|
+
|
|
63
|
+
receiveMessage:
|
|
64
|
+
action: receive
|
|
65
|
+
channel:
|
|
66
|
+
$ref: '#/channels/chat~1message'
|
|
67
|
+
messages:
|
|
68
|
+
- $ref: '#/components/messages/MessageReceivedEvent'
|
|
69
|
+
|
|
70
|
+
components:
|
|
71
|
+
messages:
|
|
72
|
+
GetUserProfileRequest:
|
|
73
|
+
name: GetUserProfileRequest
|
|
74
|
+
title: Get User Profile Request
|
|
75
|
+
payload:
|
|
76
|
+
$ref: '#/components/schemas/GetUserProfileRequest'
|
|
77
|
+
|
|
78
|
+
UserProfileResponse:
|
|
79
|
+
name: UserProfileResponse
|
|
80
|
+
title: User Profile Response
|
|
81
|
+
payload:
|
|
82
|
+
$ref: '#/components/schemas/UserProfile'
|
|
83
|
+
|
|
84
|
+
SendMessageRequest:
|
|
85
|
+
name: SendMessageRequest
|
|
86
|
+
title: Send Message Request
|
|
87
|
+
payload:
|
|
88
|
+
$ref: '#/components/schemas/SendMessageRequest'
|
|
89
|
+
|
|
90
|
+
MessageReceivedEvent:
|
|
91
|
+
name: MessageReceivedEvent
|
|
92
|
+
title: Message Received Event
|
|
93
|
+
payload:
|
|
94
|
+
$ref: '#/components/schemas/ChatMessage'
|
|
95
|
+
|
|
96
|
+
schemas:
|
|
97
|
+
GetUserProfileRequest:
|
|
98
|
+
type: object
|
|
99
|
+
required:
|
|
100
|
+
- userId
|
|
101
|
+
properties:
|
|
102
|
+
userId:
|
|
103
|
+
type: string
|
|
104
|
+
description: The ID of the user to get profile for
|
|
105
|
+
example: "12345"
|
|
106
|
+
|
|
107
|
+
UserProfile:
|
|
108
|
+
type: object
|
|
109
|
+
required:
|
|
110
|
+
- id
|
|
111
|
+
- name
|
|
112
|
+
- email
|
|
113
|
+
- createdAt
|
|
114
|
+
properties:
|
|
115
|
+
id:
|
|
116
|
+
type: string
|
|
117
|
+
description: User ID
|
|
118
|
+
example: "12345"
|
|
119
|
+
name:
|
|
120
|
+
type: string
|
|
121
|
+
description: User's full name
|
|
122
|
+
example: "John Doe"
|
|
123
|
+
email:
|
|
124
|
+
type: string
|
|
125
|
+
format: email
|
|
126
|
+
description: User's email address
|
|
127
|
+
example: "john@example.com"
|
|
128
|
+
avatar:
|
|
129
|
+
type: string
|
|
130
|
+
format: uri
|
|
131
|
+
description: URL to user's avatar image
|
|
132
|
+
example: "https://example.com/avatars/john.jpg"
|
|
133
|
+
createdAt:
|
|
134
|
+
type: string
|
|
135
|
+
format: date-time
|
|
136
|
+
description: When the user was created
|
|
137
|
+
example: "2023-01-01T00:00:00Z"
|
|
138
|
+
preferences:
|
|
139
|
+
$ref: '#/components/schemas/UserPreferences'
|
|
140
|
+
|
|
141
|
+
UserPreferences:
|
|
142
|
+
type: object
|
|
143
|
+
properties:
|
|
144
|
+
theme:
|
|
145
|
+
type: string
|
|
146
|
+
enum: [light, dark]
|
|
147
|
+
default: light
|
|
148
|
+
description: User's preferred theme
|
|
149
|
+
notifications:
|
|
150
|
+
type: boolean
|
|
151
|
+
default: true
|
|
152
|
+
description: Whether user wants to receive notifications
|
|
153
|
+
language:
|
|
154
|
+
type: string
|
|
155
|
+
default: en
|
|
156
|
+
description: User's preferred language
|
|
157
|
+
example: "en"
|
|
158
|
+
|
|
159
|
+
SendMessageRequest:
|
|
160
|
+
type: object
|
|
161
|
+
required:
|
|
162
|
+
- roomId
|
|
163
|
+
- content
|
|
164
|
+
properties:
|
|
165
|
+
roomId:
|
|
166
|
+
type: string
|
|
167
|
+
description: The ID of the chat room
|
|
168
|
+
example: "general"
|
|
169
|
+
content:
|
|
170
|
+
type: string
|
|
171
|
+
description: The message content
|
|
172
|
+
example: "Hello, world!"
|
|
173
|
+
messageType:
|
|
174
|
+
type: string
|
|
175
|
+
enum: [text, image, file]
|
|
176
|
+
default: text
|
|
177
|
+
description: Type of message being sent
|
|
178
|
+
|
|
179
|
+
ChatMessage:
|
|
180
|
+
type: object
|
|
181
|
+
required:
|
|
182
|
+
- id
|
|
183
|
+
- roomId
|
|
184
|
+
- userId
|
|
185
|
+
- content
|
|
186
|
+
- timestamp
|
|
187
|
+
properties:
|
|
188
|
+
id:
|
|
189
|
+
type: string
|
|
190
|
+
description: Unique message ID
|
|
191
|
+
example: "msg_12345"
|
|
192
|
+
roomId:
|
|
193
|
+
type: string
|
|
194
|
+
description: The ID of the chat room
|
|
195
|
+
example: "general"
|
|
196
|
+
userId:
|
|
197
|
+
type: string
|
|
198
|
+
description: ID of the user who sent the message
|
|
199
|
+
example: "user_123"
|
|
200
|
+
userName:
|
|
201
|
+
type: string
|
|
202
|
+
description: Name of the user who sent the message
|
|
203
|
+
example: "John Doe"
|
|
204
|
+
content:
|
|
205
|
+
type: string
|
|
206
|
+
description: The message content
|
|
207
|
+
example: "Hello, world!"
|
|
208
|
+
messageType:
|
|
209
|
+
type: string
|
|
210
|
+
enum: [text, image, file]
|
|
211
|
+
default: text
|
|
212
|
+
description: Type of message
|
|
213
|
+
timestamp:
|
|
214
|
+
type: string
|
|
215
|
+
format: date-time
|
|
216
|
+
description: When the message was sent
|
|
217
|
+
example: "2023-01-01T12:00:00Z"
|
|
218
|
+
edited:
|
|
219
|
+
type: boolean
|
|
220
|
+
default: false
|
|
221
|
+
description: Whether the message has been edited
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ioka-technologies/asyncapi-ts-client-template",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "TypeScript AsyncAPI client generator template compatible with rust-asyncapi patterns",
|
|
5
5
|
"main": "template/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -89,13 +89,5 @@
|
|
|
89
89
|
"LICENSE"
|
|
90
90
|
],
|
|
91
91
|
"generator": ">=1.15.0 <3.0.0"
|
|
92
|
-
}
|
|
93
|
-
"files": [
|
|
94
|
-
"template/**/*",
|
|
95
|
-
"dist/common/**/*",
|
|
96
|
-
"examples/**/*",
|
|
97
|
-
"README.md",
|
|
98
|
-
"USAGE.md",
|
|
99
|
-
"PROJECT_SUMMARY.md"
|
|
100
|
-
]
|
|
92
|
+
}
|
|
101
93
|
}
|