chat.yaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. get:
  274. summary: Get Thread
  275. tags: []
  276. responses:
  277. '200':
  278. description: OK
  279. content:
  280. application/json:
  281. schema:
  282. $ref: '#/components/schemas/Thread'
  283. '404':
  284. description: Thread not found
  285. operationId: getThread
  286. description: Get a thread with ThreadID and ProjectID provided
  287. delete:
  288. summary: Delete thread
  289. operationId: deleteThread
  290. responses:
  291. '204':
  292. description: No Content
  293. description: Delete thread with ThreadID and ProjectID provided
  294. '/project/{projectId}/resolved-thread-ids':
  295. parameters:
  296. - schema:
  297. type: string
  298. name: projectId
  299. in: path
  300. required: true
  301. get:
  302. summary: Get resolved thread ids
  303. operationId: getResolvedThreadIds
  304. responses:
  305. '200':
  306. description: Resolved thread ids
  307. '/project/{projectId}':
  308. parameters:
  309. - schema:
  310. type: string
  311. name: projectId
  312. in: path
  313. required: true
  314. delete:
  315. summary: Destroy project
  316. operationId: destroyProject
  317. responses:
  318. '204':
  319. description: No Content
  320. description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
  321. /status:
  322. get:
  323. summary: Check status
  324. tags: []
  325. responses:
  326. '200':
  327. description: OK
  328. content:
  329. application/json:
  330. schema:
  331. type: string
  332. description: chat is alive
  333. operationId: getStatus
  334. description: Check that the Chat service is alive
  335. head:
  336. summary: Check status
  337. tags: []
  338. responses:
  339. '200':
  340. description: OK
  341. content:
  342. application/json:
  343. schema:
  344. type: string
  345. description: chat is alive
  346. operationId: getStatus
  347. description: Check that the Chat service is alive
  348. '/project/{projectId}/duplicate-comment-threads':
  349. parameters:
  350. - schema:
  351. type: string
  352. name: projectId
  353. in: path
  354. required: true
  355. post:
  356. summary: Duplicate comment threads
  357. operationId: duplicateCommentThreads
  358. requestBody:
  359. content:
  360. application/json:
  361. schema:
  362. type: object
  363. properties:
  364. threads:
  365. type: array
  366. items:
  367. type: string
  368. responses:
  369. '200':
  370. content:
  371. application/json:
  372. schema:
  373. type: object
  374. properties:
  375. newThreads:
  376. type: object
  377. description: Mapping of old thread ids to their duplicated thread ids
  378. description: Duplicate a list of comment threads
  379. '/project/{projectId}/generate-thread-data':
  380. parameters:
  381. - schema:
  382. type: string
  383. name: projectId
  384. in: path
  385. required: true
  386. post:
  387. summary: Generate thread data to load into the frontend
  388. operationId: generateThreadData
  389. requestBody:
  390. content:
  391. application/json:
  392. schema:
  393. type: object
  394. properties:
  395. threads:
  396. type: array
  397. items:
  398. type: string
  399. responses:
  400. '200':
  401. content:
  402. application/json:
  403. schema:
  404. type: object
  405. description: Load threads and generate a json blob containing all messages in all the threads
  406. components:
  407. schemas:
  408. Message:
  409. title: Message
  410. x-stoplight:
  411. id: ue9n1vvezlutw
  412. type: object
  413. examples:
  414. - user_id: string
  415. - content: string
  416. properties:
  417. user_id:
  418. type: string
  419. content:
  420. type: string
  421. required:
  422. - user_id
  423. - content
  424. Thread:
  425. title: Thread
  426. x-stoplight:
  427. id: 0ppt3jw4h5bua
  428. type: array
  429. items:
  430. $ref: '#/components/schemas/Message'