chat.yaml 13 KB

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