chat.yaml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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}/resolved-thread-ids':
  253. parameters:
  254. - schema:
  255. type: string
  256. name: projectId
  257. in: path
  258. required: true
  259. get:
  260. summary: Get resolved thread ids
  261. operationId: getResolvedThreadIds
  262. responses:
  263. '200':
  264. description: Resolved thread ids
  265. '/project/{projectId}':
  266. parameters:
  267. - schema:
  268. type: string
  269. name: projectId
  270. in: path
  271. required: true
  272. delete:
  273. summary: Destroy project
  274. operationId: destroyProject
  275. responses:
  276. '204':
  277. description: No Content
  278. description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
  279. /status:
  280. get:
  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. head:
  294. summary: Check status
  295. tags: []
  296. responses:
  297. '200':
  298. description: OK
  299. content:
  300. application/json:
  301. schema:
  302. type: string
  303. description: chat is alive
  304. operationId: getStatus
  305. description: Check that the Chat service is alive
  306. '/project/{projectId}/duplicate-comment-threads':
  307. parameters:
  308. - schema:
  309. type: string
  310. name: projectId
  311. in: path
  312. required: true
  313. post:
  314. summary: Duplicate comment threads
  315. operationId: duplicateCommentThreads
  316. requestBody:
  317. content:
  318. application/json:
  319. schema:
  320. type: object
  321. properties:
  322. threads:
  323. type: array
  324. items:
  325. type: string
  326. responses:
  327. '200':
  328. content:
  329. application/json:
  330. schema:
  331. type: object
  332. properties:
  333. newThreads:
  334. type: object
  335. description: Mapping of old thread ids to their duplicated thread ids
  336. description: Duplicate a list of comment threads
  337. '/project/{projectId}/generate-thread-data':
  338. parameters:
  339. - schema:
  340. type: string
  341. name: projectId
  342. in: path
  343. required: true
  344. post:
  345. summary: Generate thread data to load into the frontend
  346. operationId: generateThreadData
  347. requestBody:
  348. content:
  349. application/json:
  350. schema:
  351. type: object
  352. properties:
  353. threads:
  354. type: array
  355. items:
  356. type: string
  357. responses:
  358. '200':
  359. content:
  360. application/json:
  361. schema:
  362. type: object
  363. description: Load threads and generate a json blob containing all messages in all the threads
  364. components:
  365. schemas:
  366. Message:
  367. title: Message
  368. x-stoplight:
  369. id: ue9n1vvezlutw
  370. type: object
  371. examples:
  372. - user_id: string
  373. - content: string
  374. properties:
  375. user_id:
  376. type: string
  377. content:
  378. type: string
  379. required:
  380. - user_id
  381. - content
  382. Thread:
  383. title: Thread
  384. x-stoplight:
  385. id: 0ppt3jw4h5bua
  386. type: array
  387. items:
  388. $ref: '#/components/schemas/Message'