-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
213 lines (209 loc) · 6.17 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
openapi: 3.1.0
info:
title: Chat App
description: |-
This is the default API for Chat App.
Some useful links:
- [sovity](https://github.com/sovity/edc-ce)
contact:
email: [email protected]
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
tags:
- name: UI
description: UI APIs
- name: Backend
description: APIs for Connector and Chat communication
paths:
/ui/connectors:
get:
tags:
- UI
summary: Get all registered Connectors for Chats
description: Get all registered Connectors for Chats
operationId: listConnectors
responses:
'200':
description: List of Connectors
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ConnectorDto'
post:
tags:
- UI
summary: Start a new chat with given Connector
description: Start a new chat with given Connector or if the connector is already present returns the existing one.
operationId: createConnector(ConnectorCreateDto createDto)
parameters:
- name: createDto
in: query
description: Necessary information of a Connector to start a chat
schema:
$ref: '#/components/schemas/ConnectorCreateDto'
responses:
'200':
description: Created DTO
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorDto'
/ui/connectors/{connectorId}/messages:
get:
tags:
- UI
summary: Get all messages for a given connector ID
description: Get all messages for a given connector ID sorted by date ascending
operationId: messagesByDateAsc(String connectorId)
parameters:
- name: connectorId
in: path
description: ID of the connector
required: true
schema:
type: string
format: uuid
responses:
'200':
description: List of Messages
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MessageDto'
post:
tags:
- UI
summary: Send a message to a given Connector
description: Send a message to a given Connector.
operationId: sendMessage(MessageSendDto sendDto)
parameters:
- name: connectorId
in: path
description: ID of the receiving connector
required: true
schema:
type: string
format: uuid
- name: sendDto
in: query
description: Message Dto to be sent to the connector
schema:
$ref: '#/components/schemas/MessageSendDto'
responses:
'200':
description: Created DTO
content:
application/json:
schema:
$ref: '#/components/schemas/MessageDto'
'404':
description: Connector not found
/edc/notifications/receive:
post:
tags:
- Backend
summary: Receive a notification from another Connector
description: Receive a notification from another Connector
operationId: receiveNotification(MessageNotificationDto notification)
parameters:
- in: header
name: Edc-Bpn
schema:
type: string
description: Participant ID of the sending connector
- name: notification
in: query
description: Notification from another Connector
schema:
$ref: '#/components/schemas/MessageNotificationDto'
responses:
'200':
description: Notification received
components:
schemas:
ConnectorDto:
type: object
properties:
uuid:
type: string
format: uuid
description: Internal object ID
participantId:
type: string
description: ID e.g. BPN of the other party
connectorEndpoint:
type: string
description: URL of other Connector's DSP endpoint
status:
type: string
description: Whether we have two contracts (provide + receive)
examples: [ONLINE]
enum:
- ONLINE
- CONNECTING
- ERROR
ConnectorCreateDto:
type: object
properties:
participantId:
type: string
description: ID e.g. BPN of the other party
connectorEndpoint:
type: string
description: URL of other Connector's DSP endpoint
MessageSendDto:
type: object
properties:
message:
type: string
description: The chat massage
MessageDto:
type: object
properties:
uuid:
type: string
format: uuid
description: Internal object ID
createdAt:
type: string
format: date-time
description: Time when chat message was created as OffsetDateTime
message:
type: string
description: The chat massage
messageDirection:
type: string
description: Incoming or outgoing message.
examples: [INCOMING]
enum:
- INCOMING
- OUTGOING
status:
type: string
description: Incoming status (notification received -> fetched) or outgoing message (notification sent -> fetched) or error if notification could not be sent or incoming messages could not be fetched.
examples: [OK]
enum:
- SENDING
- OK
- ERROR
MessageNotificationDto:
type: object
properties:
returnAssetId:
type: string
description: Asset ID for answers to the sending connector
returnConnectorEndpoint:
type: string
description: Connector Endpoint of hte sending connector
returnParticipantId:
type: string
description: Participant ID of the sending connector
message:
type: string
description: Message content