chat.yaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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}/messages/{messageId}':
  60. parameters:
  61. - schema:
  62. type: string
  63. name: projectId
  64. in: path
  65. required: true
  66. - schema:
  67. type: string
  68. name: messageId
  69. in: path
  70. required: true
  71. get:
  72. summary: Get single global message
  73. tags: []
  74. responses:
  75. '200':
  76. description: OK
  77. content:
  78. application/json:
  79. schema:
  80. $ref: '#/components/schemas/Message'
  81. '404':
  82. description: Message not found
  83. operationId: getGlobalMessage
  84. description: Get a single global message by message ID for the project with Project ID provided
  85. '/project/{projectId}/thread/{threadId}/messages':
  86. parameters:
  87. - schema:
  88. type: string
  89. name: projectId
  90. in: path
  91. required: true
  92. - schema:
  93. type: string
  94. name: threadId
  95. in: path
  96. required: true
  97. post:
  98. summary: Send message
  99. operationId: sendMessage
  100. responses:
  101. '201':
  102. description: Created
  103. description: Add a message to the thread with thread ID provided from the Project with Project ID provided.
  104. requestBody:
  105. content:
  106. application/json:
  107. schema:
  108. $ref: '#/components/schemas/Message'
  109. description: |-
  110. JSON object with :
  111. - user_id: Id of the user
  112. - content: Content of the message
  113. '/project/{projectId}/threads':
  114. parameters:
  115. - schema:
  116. type: string
  117. name: projectId
  118. in: path
  119. required: true
  120. get:
  121. summary: Get Threads
  122. tags: []
  123. responses:
  124. '200':
  125. description: OK
  126. content:
  127. application/json:
  128. schema:
  129. type: array
  130. items:
  131. $ref: '#/components/schemas/Thread'
  132. examples: {}
  133. '404':
  134. description: Not Found
  135. operationId: getThreads
  136. description: Get the list of threads for the project with Project ID provided
  137. '/project/{projectId}/thread/{threadId}/messages/{messageId}/edit':
  138. parameters:
  139. - schema:
  140. type: string
  141. name: projectId
  142. in: path
  143. required: true
  144. - schema:
  145. type: string
  146. name: threadId
  147. in: path
  148. required: true
  149. - schema:
  150. type: string
  151. name: messageId
  152. in: path
  153. required: true
  154. post:
  155. summary: Edit message
  156. operationId: editMessage
  157. responses:
  158. '204':
  159. description: No Content
  160. '404':
  161. description: Not Found
  162. requestBody:
  163. content:
  164. application/json:
  165. schema:
  166. type: object
  167. properties:
  168. content:
  169. type: string
  170. user_id:
  171. type: string
  172. readOnly: true
  173. required:
  174. - content
  175. examples: {}
  176. description: |-
  177. JSON object with :
  178. - content: Content of the message to edit
  179. - user_id: Id of the user (optional)
  180. description: |
  181. Update message with Message ID provided from the Thread ID and Project ID provided
  182. '/project/{projectId}/thread/{threadId}/messages/{messageId}':
  183. parameters:
  184. - schema:
  185. type: string
  186. name: projectId
  187. in: path
  188. required: true
  189. - schema:
  190. type: string
  191. name: threadId
  192. in: path
  193. required: true
  194. - schema:
  195. type: string
  196. name: messageId
  197. in: path
  198. required: true
  199. delete:
  200. summary: Delete message
  201. operationId: deleteMessage
  202. responses:
  203. '204':
  204. description: No Content
  205. description: 'Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided'
  206. '/project/{projectId}/thread/{threadId}/user/{userId}/messages/{messageId}':
  207. parameters:
  208. - schema:
  209. type: string
  210. name: projectId
  211. in: path
  212. required: true
  213. - schema:
  214. type: string
  215. name: threadId
  216. in: path
  217. required: true
  218. - schema:
  219. type: string
  220. name: userId
  221. in: path
  222. required: true
  223. - schema:
  224. type: string
  225. name: messageId
  226. in: path
  227. required: true
  228. delete:
  229. summary: Delete message written by a given user
  230. operationId: deleteUserMessage
  231. responses:
  232. '204':
  233. description: No Content
  234. '/project/{projectId}/thread/{threadId}/resolve':
  235. parameters:
  236. - schema:
  237. type: string
  238. name: projectId
  239. in: path
  240. required: true
  241. - schema:
  242. type: string
  243. name: threadId
  244. in: path
  245. required: true
  246. post:
  247. summary: Resolve Thread
  248. operationId: resolveThread
  249. responses:
  250. '204':
  251. description: No Content
  252. requestBody:
  253. content:
  254. application/json:
  255. schema:
  256. type: object
  257. properties:
  258. user_id:
  259. type: string
  260. required:
  261. - user_id
  262. description: |-
  263. JSON object with :
  264. - user_id: Id of the user.
  265. description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
  266. '/project/{projectId}/thread/{threadId}/reopen':
  267. parameters:
  268. - schema:
  269. type: string
  270. name: projectId
  271. in: path
  272. required: true
  273. - schema:
  274. type: string
  275. name: threadId
  276. in: path
  277. required: true
  278. post:
  279. summary: Reopen Thread
  280. operationId: reopenThread
  281. responses:
  282. '204':
  283. description: No Content
  284. description: |-
  285. Reopen Thread with ThreadID and ProjectID provided.
  286. i.e unmark it as resolved.
  287. '/project/{projectId}/thread/{threadId}':
  288. parameters:
  289. - schema:
  290. type: string
  291. name: projectId
  292. in: path
  293. required: true
  294. - schema:
  295. type: string
  296. name: threadId
  297. in: path
  298. required: true
  299. get:
  300. summary: Get Thread
  301. tags: []
  302. responses:
  303. '200':
  304. description: OK
  305. content:
  306. application/json:
  307. schema:
  308. $ref: '#/components/schemas/Thread'
  309. '404':
  310. description: Thread not found
  311. operationId: getThread
  312. description: Get a thread with ThreadID and ProjectID provided
  313. delete:
  314. summary: Delete thread
  315. operationId: deleteThread
  316. responses:
  317. '204':
  318. description: No Content
  319. description: Delete thread with ThreadID and ProjectID provided
  320. '/project/{projectId}/resolved-thread-ids':
  321. parameters:
  322. - schema:
  323. type: string
  324. name: projectId
  325. in: path
  326. required: true
  327. get:
  328. summary: Get resolved thread ids
  329. operationId: getResolvedThreadIds
  330. responses:
  331. '200':
  332. description: Resolved thread ids
  333. '/project/{projectId}':
  334. parameters:
  335. - schema:
  336. type: string
  337. name: projectId
  338. in: path
  339. required: true
  340. delete:
  341. summary: Destroy project
  342. operationId: destroyProject
  343. responses:
  344. '204':
  345. description: No Content
  346. description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
  347. /status:
  348. get:
  349. summary: Check status
  350. tags: []
  351. responses:
  352. '200':
  353. description: OK
  354. content:
  355. application/json:
  356. schema:
  357. type: string
  358. description: chat is alive
  359. operationId: getStatus
  360. description: Check that the Chat service is alive
  361. head:
  362. summary: Check status
  363. tags: []
  364. responses:
  365. '200':
  366. description: OK
  367. content:
  368. application/json:
  369. schema:
  370. type: string
  371. description: chat is alive
  372. operationId: getStatus
  373. description: Check that the Chat service is alive
  374. '/project/{projectId}/duplicate-comment-threads':
  375. parameters:
  376. - schema:
  377. type: string
  378. name: projectId
  379. in: path
  380. required: true
  381. post:
  382. summary: Duplicate comment threads
  383. operationId: duplicateCommentThreads
  384. requestBody:
  385. content:
  386. application/json:
  387. schema:
  388. type: object
  389. properties:
  390. threads:
  391. type: array
  392. items:
  393. type: string
  394. responses:
  395. '200':
  396. content:
  397. application/json:
  398. schema:
  399. type: object
  400. properties:
  401. newThreads:
  402. type: object
  403. description: Mapping of old thread ids to their duplicated thread ids
  404. description: Duplicate a list of comment threads
  405. '/project/{projectId}/generate-thread-data':
  406. parameters:
  407. - schema:
  408. type: string
  409. name: projectId
  410. in: path
  411. required: true
  412. post:
  413. summary: Generate thread data to load into the frontend
  414. operationId: generateThreadData
  415. requestBody:
  416. content:
  417. application/json:
  418. schema:
  419. type: object
  420. properties:
  421. threads:
  422. type: array
  423. items:
  424. type: string
  425. responses:
  426. '200':
  427. content:
  428. application/json:
  429. schema:
  430. type: object
  431. description: Load threads and generate a json blob containing all messages in all the threads
  432. components:
  433. schemas:
  434. Message:
  435. title: Message
  436. x-stoplight:
  437. id: ue9n1vvezlutw
  438. type: object
  439. examples:
  440. - user_id: string
  441. - content: string
  442. properties:
  443. user_id:
  444. type: string
  445. content:
  446. type: string
  447. required:
  448. - user_id
  449. - content
  450. Thread:
  451. title: Thread
  452. x-stoplight:
  453. id: 0ppt3jw4h5bua
  454. type: array
  455. items:
  456. $ref: '#/components/schemas/Message'