chat.yaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. openapi: 3.1.0
  2. x-stoplight:
  3. id: okoe8mh50pjec
  4. info:
  5. title: chat
  6. version: '1.0'
  7. servers:
  8. - url: 'http://chat:3010'
  9. x-exegesis-controller: messagesController
  10. paths:
  11. '/project/{projectId}/messages':
  12. parameters:
  13. - schema:
  14. type: string
  15. name: projectId
  16. in: path
  17. required: true
  18. get:
  19. summary: Get Global messages
  20. tags: []
  21. responses:
  22. '201':
  23. description: OK
  24. content:
  25. application/json:
  26. schema:
  27. type: array
  28. items:
  29. $ref: '#/components/schemas/Message'
  30. operationId: getGlobalMessages
  31. description: Get global messages for the project with Project ID provided
  32. parameters:
  33. - schema:
  34. type: string
  35. in: query
  36. name: before
  37. - schema:
  38. type: string
  39. in: query
  40. name: limit
  41. post:
  42. summary: Send Global message
  43. operationId: sendGlobalMessage
  44. responses:
  45. '201':
  46. description: OK
  47. requestBody:
  48. content:
  49. application/json:
  50. schema:
  51. $ref: '#/components/schemas/Message'
  52. examples:
  53. example-1:
  54. value:
  55. user_id: string
  56. content: string
  57. description: 'UserID and Content of the message to be posted. '
  58. description: Send global message for the project with Project ID provided
  59. '/project/{projectId}/thread/{threadId}/messages':
  60. parameters:
  61. - schema:
  62. type: string
  63. name: projectId
  64. in: path
  65. required: true
  66. - schema:
  67. type: string
  68. name: threadId
  69. in: path
  70. required: true
  71. post:
  72. summary: Send message
  73. operationId: sendMessage
  74. responses:
  75. '201':
  76. description: Created
  77. description: Add a message to the thread with thread ID provided from the Project with Project ID provided.
  78. requestBody:
  79. content:
  80. application/json:
  81. schema:
  82. $ref: '#/components/schemas/Message'
  83. description: |-
  84. JSON object with :
  85. - user_id: Id of the user
  86. - content: Content of the message
  87. '/project/{projectId}/threads':
  88. parameters:
  89. - schema:
  90. type: string
  91. name: projectId
  92. in: path
  93. required: true
  94. get:
  95. summary: Get Threads
  96. tags: []
  97. responses:
  98. '200':
  99. description: OK
  100. content:
  101. application/json:
  102. schema:
  103. type: array
  104. items:
  105. $ref: '#/components/schemas/Thread'
  106. examples: {}
  107. '404':
  108. description: Not Found
  109. operationId: getThreads
  110. description: Get the list of threads for the project with Project ID provided
  111. '/project/{projectId}/thread/{threadId}/messages/{messageId}/edit':
  112. parameters:
  113. - schema:
  114. type: string
  115. name: projectId
  116. in: path
  117. required: true
  118. - schema:
  119. type: string
  120. name: threadId
  121. in: path
  122. required: true
  123. - schema:
  124. type: string
  125. name: messageId
  126. in: path
  127. required: true
  128. post:
  129. summary: Edit message
  130. operationId: editMessage
  131. responses:
  132. '204':
  133. description: No Content
  134. '404':
  135. description: Not Found
  136. requestBody:
  137. content:
  138. application/json:
  139. schema:
  140. type: object
  141. properties:
  142. content:
  143. type: string
  144. user_id:
  145. type: string
  146. readOnly: true
  147. required:
  148. - content
  149. examples: {}
  150. description: |-
  151. JSON object with :
  152. - content: Content of the message to edit
  153. - user_id: Id of the user (optional)
  154. description: |
  155. Update message with Message ID provided from the Thread ID and Project ID provided
  156. '/project/{projectId}/thread/{threadId}/messages/{messageId}':
  157. parameters:
  158. - schema:
  159. type: string
  160. name: projectId
  161. in: path
  162. required: true
  163. - schema:
  164. type: string
  165. name: threadId
  166. in: path
  167. required: true
  168. - schema:
  169. type: string
  170. name: messageId
  171. in: path
  172. required: true
  173. delete:
  174. summary: Delete message
  175. operationId: deleteMessage
  176. responses:
  177. '204':
  178. description: No Content
  179. description: 'Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided'
  180. '/project/{projectId}/thread/{threadId}/resolve':
  181. parameters:
  182. - schema:
  183. type: string
  184. name: projectId
  185. in: path
  186. required: true
  187. - schema:
  188. type: string
  189. name: threadId
  190. in: path
  191. required: true
  192. post:
  193. summary: Resolve Thread
  194. operationId: resolveThread
  195. responses:
  196. '204':
  197. description: No Content
  198. requestBody:
  199. content:
  200. application/json:
  201. schema:
  202. type: object
  203. properties:
  204. user_id:
  205. type: string
  206. required:
  207. - user_id
  208. description: |-
  209. JSON object with :
  210. - user_id: Id of the user.
  211. description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
  212. '/project/{projectId}/thread/{threadId}/reopen':
  213. parameters:
  214. - schema:
  215. type: string
  216. name: projectId
  217. in: path
  218. required: true
  219. - schema:
  220. type: string
  221. name: threadId
  222. in: path
  223. required: true
  224. post:
  225. summary: Reopen Thread
  226. operationId: reopenThread
  227. responses:
  228. '204':
  229. description: No Content
  230. description: |-
  231. Reopen Thread with ThreadID and ProjectID provided.
  232. i.e unmark it as resolved.
  233. '/project/{projectId}/thread/{threadId}':
  234. parameters:
  235. - schema:
  236. type: string
  237. name: projectId
  238. in: path
  239. required: true
  240. - schema:
  241. type: string
  242. name: threadId
  243. in: path
  244. required: true
  245. delete:
  246. summary: Delete thread
  247. operationId: deleteThread
  248. responses:
  249. '204':
  250. description: No Content
  251. description: Delete thread with ThreadID and ProjectID provided
  252. '/project/{projectId}':
  253. parameters:
  254. - schema:
  255. type: string
  256. name: projectId
  257. in: path
  258. required: true
  259. delete:
  260. summary: Destroy project
  261. operationId: destroyProject
  262. responses:
  263. '204':
  264. description: No Content
  265. description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
  266. /status:
  267. get:
  268. summary: Check status
  269. tags: []
  270. responses:
  271. '200':
  272. description: OK
  273. content:
  274. application/json:
  275. schema:
  276. type: string
  277. description: chat is alive
  278. operationId: getStatus
  279. description: Check that the Chat service is alive
  280. head:
  281. summary: Check status
  282. tags: []
  283. responses:
  284. '200':
  285. description: OK
  286. content:
  287. application/json:
  288. schema:
  289. type: string
  290. description: chat is alive
  291. operationId: getStatus
  292. description: Check that the Chat service is alive
  293. components:
  294. schemas:
  295. Message:
  296. title: Message
  297. x-stoplight:
  298. id: ue9n1vvezlutw
  299. type: object
  300. examples:
  301. - user_id: string
  302. - content: string
  303. properties:
  304. user_id:
  305. type: string
  306. content:
  307. type: string
  308. required:
  309. - user_id
  310. - content
  311. Thread:
  312. title: Thread
  313. x-stoplight:
  314. id: 0ppt3jw4h5bua
  315. type: array
  316. items:
  317. $ref: '#/components/schemas/Message'