chat.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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}/user/{userId}/messages/{messageId}':
  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. - schema:
  193. type: string
  194. name: userId
  195. in: path
  196. required: true
  197. - schema:
  198. type: string
  199. name: messageId
  200. in: path
  201. required: true
  202. delete:
  203. summary: Delete message written by a given user
  204. operationId: deleteUserMessage
  205. responses:
  206. '204':
  207. description: No Content
  208. '/project/{projectId}/thread/{threadId}/resolve':
  209. parameters:
  210. - schema:
  211. type: string
  212. name: projectId
  213. in: path
  214. required: true
  215. - schema:
  216. type: string
  217. name: threadId
  218. in: path
  219. required: true
  220. post:
  221. summary: Resolve Thread
  222. operationId: resolveThread
  223. responses:
  224. '204':
  225. description: No Content
  226. requestBody:
  227. content:
  228. application/json:
  229. schema:
  230. type: object
  231. properties:
  232. user_id:
  233. type: string
  234. required:
  235. - user_id
  236. description: |-
  237. JSON object with :
  238. - user_id: Id of the user.
  239. description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
  240. '/project/{projectId}/thread/{threadId}/reopen':
  241. parameters:
  242. - schema:
  243. type: string
  244. name: projectId
  245. in: path
  246. required: true
  247. - schema:
  248. type: string
  249. name: threadId
  250. in: path
  251. required: true
  252. post:
  253. summary: Reopen Thread
  254. operationId: reopenThread
  255. responses:
  256. '204':
  257. description: No Content
  258. description: |-
  259. Reopen Thread with ThreadID and ProjectID provided.
  260. i.e unmark it as resolved.
  261. '/project/{projectId}/thread/{threadId}':
  262. parameters:
  263. - schema:
  264. type: string
  265. name: projectId
  266. in: path
  267. required: true
  268. - schema:
  269. type: string
  270. name: threadId
  271. in: path
  272. required: true
  273. delete:
  274. summary: Delete thread
  275. operationId: deleteThread
  276. responses:
  277. '204':
  278. description: No Content
  279. description: Delete thread with ThreadID and ProjectID provided
  280. '/project/{projectId}/resolved-thread-ids':
  281. parameters:
  282. - schema:
  283. type: string
  284. name: projectId
  285. in: path
  286. required: true
  287. get:
  288. summary: Get resolved thread ids
  289. operationId: getResolvedThreadIds
  290. responses:
  291. '200':
  292. description: Resolved thread ids
  293. '/project/{projectId}':
  294. parameters:
  295. - schema:
  296. type: string
  297. name: projectId
  298. in: path
  299. required: true
  300. delete:
  301. summary: Destroy project
  302. operationId: destroyProject
  303. responses:
  304. '204':
  305. description: No Content
  306. description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
  307. /status:
  308. get:
  309. summary: Check status
  310. tags: []
  311. responses:
  312. '200':
  313. description: OK
  314. content:
  315. application/json:
  316. schema:
  317. type: string
  318. description: chat is alive
  319. operationId: getStatus
  320. description: Check that the Chat service is alive
  321. head:
  322. summary: Check status
  323. tags: []
  324. responses:
  325. '200':
  326. description: OK
  327. content:
  328. application/json:
  329. schema:
  330. type: string
  331. description: chat is alive
  332. operationId: getStatus
  333. description: Check that the Chat service is alive
  334. '/project/{projectId}/duplicate-comment-threads':
  335. parameters:
  336. - schema:
  337. type: string
  338. name: projectId
  339. in: path
  340. required: true
  341. post:
  342. summary: Duplicate comment threads
  343. operationId: duplicateCommentThreads
  344. requestBody:
  345. content:
  346. application/json:
  347. schema:
  348. type: object
  349. properties:
  350. threads:
  351. type: array
  352. items:
  353. type: string
  354. responses:
  355. '200':
  356. content:
  357. application/json:
  358. schema:
  359. type: object
  360. properties:
  361. newThreads:
  362. type: object
  363. description: Mapping of old thread ids to their duplicated thread ids
  364. description: Duplicate a list of comment threads
  365. '/project/{projectId}/generate-thread-data':
  366. parameters:
  367. - schema:
  368. type: string
  369. name: projectId
  370. in: path
  371. required: true
  372. post:
  373. summary: Generate thread data to load into the frontend
  374. operationId: generateThreadData
  375. requestBody:
  376. content:
  377. application/json:
  378. schema:
  379. type: object
  380. properties:
  381. threads:
  382. type: array
  383. items:
  384. type: string
  385. responses:
  386. '200':
  387. content:
  388. application/json:
  389. schema:
  390. type: object
  391. description: Load threads and generate a json blob containing all messages in all the threads
  392. components:
  393. schemas:
  394. Message:
  395. title: Message
  396. x-stoplight:
  397. id: ue9n1vvezlutw
  398. type: object
  399. examples:
  400. - user_id: string
  401. - content: string
  402. properties:
  403. user_id:
  404. type: string
  405. content:
  406. type: string
  407. required:
  408. - user_id
  409. - content
  410. Thread:
  411. title: Thread
  412. x-stoplight:
  413. id: 0ppt3jw4h5bua
  414. type: array
  415. items:
  416. $ref: '#/components/schemas/Message'