chat.yaml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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. get:
  247. summary: Get thread message
  248. tags: []
  249. responses:
  250. "200":
  251. description: OK
  252. content:
  253. application/json:
  254. schema:
  255. $ref: "#/components/schemas/Message"
  256. "404":
  257. description: Message not found
  258. operationId: getThreadMessage
  259. description: Get a specific message by message ID from the thread with Thread ID and Project ID provided
  260. delete:
  261. summary: Delete message
  262. operationId: deleteMessage
  263. responses:
  264. "204":
  265. description: No Content
  266. description: "Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided"
  267. "/project/{projectId}/thread/{threadId}/user/{userId}/messages/{messageId}":
  268. parameters:
  269. - schema:
  270. type: string
  271. name: projectId
  272. in: path
  273. required: true
  274. - schema:
  275. type: string
  276. name: threadId
  277. in: path
  278. required: true
  279. - schema:
  280. type: string
  281. name: userId
  282. in: path
  283. required: true
  284. - schema:
  285. type: string
  286. name: messageId
  287. in: path
  288. required: true
  289. delete:
  290. summary: Delete message written by a given user
  291. operationId: deleteUserMessage
  292. responses:
  293. "204":
  294. description: No Content
  295. "/project/{projectId}/thread/{threadId}/resolve":
  296. parameters:
  297. - schema:
  298. type: string
  299. name: projectId
  300. in: path
  301. required: true
  302. - schema:
  303. type: string
  304. name: threadId
  305. in: path
  306. required: true
  307. post:
  308. summary: Resolve Thread
  309. operationId: resolveThread
  310. responses:
  311. "204":
  312. description: No Content
  313. requestBody:
  314. content:
  315. application/json:
  316. schema:
  317. type: object
  318. properties:
  319. user_id:
  320. type: string
  321. required:
  322. - user_id
  323. description: |-
  324. JSON object with :
  325. - user_id: Id of the user.
  326. description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
  327. "/project/{projectId}/thread/{threadId}/reopen":
  328. parameters:
  329. - schema:
  330. type: string
  331. name: projectId
  332. in: path
  333. required: true
  334. - schema:
  335. type: string
  336. name: threadId
  337. in: path
  338. required: true
  339. post:
  340. summary: Reopen Thread
  341. operationId: reopenThread
  342. responses:
  343. "204":
  344. description: No Content
  345. description: |-
  346. Reopen Thread with ThreadID and ProjectID provided.
  347. i.e unmark it as resolved.
  348. "/project/{projectId}/thread/{threadId}":
  349. parameters:
  350. - schema:
  351. type: string
  352. name: projectId
  353. in: path
  354. required: true
  355. - schema:
  356. type: string
  357. name: threadId
  358. in: path
  359. required: true
  360. get:
  361. summary: Get Thread
  362. tags: []
  363. responses:
  364. "200":
  365. description: OK
  366. content:
  367. application/json:
  368. schema:
  369. $ref: "#/components/schemas/Thread"
  370. "404":
  371. description: Thread not found
  372. operationId: getThread
  373. description: Get a thread with ThreadID and ProjectID provided
  374. delete:
  375. summary: Delete thread
  376. operationId: deleteThread
  377. responses:
  378. "204":
  379. description: No Content
  380. description: Delete thread with ThreadID and ProjectID provided
  381. "/project/{projectId}/resolved-thread-ids":
  382. parameters:
  383. - schema:
  384. type: string
  385. name: projectId
  386. in: path
  387. required: true
  388. get:
  389. summary: Get resolved thread ids
  390. operationId: getResolvedThreadIds
  391. responses:
  392. "200":
  393. description: Resolved thread ids
  394. "/project/{projectId}":
  395. parameters:
  396. - schema:
  397. type: string
  398. name: projectId
  399. in: path
  400. required: true
  401. delete:
  402. summary: Destroy project
  403. operationId: destroyProject
  404. responses:
  405. "204":
  406. description: No Content
  407. description: "Delete all threads from Project with Project ID provided, and all messages in those threads."
  408. /status:
  409. get:
  410. summary: Check status
  411. tags: []
  412. responses:
  413. "200":
  414. description: OK
  415. content:
  416. application/json:
  417. schema:
  418. type: string
  419. description: chat is alive
  420. operationId: getStatus
  421. description: Check that the Chat service is alive
  422. head:
  423. summary: Check status
  424. tags: []
  425. responses:
  426. "200":
  427. description: OK
  428. content:
  429. application/json:
  430. schema:
  431. type: string
  432. description: chat is alive
  433. operationId: getStatus
  434. description: Check that the Chat service is alive
  435. "/project/{projectId}/duplicate-comment-threads":
  436. parameters:
  437. - schema:
  438. type: string
  439. name: projectId
  440. in: path
  441. required: true
  442. post:
  443. summary: Duplicate comment threads
  444. operationId: duplicateCommentThreads
  445. requestBody:
  446. content:
  447. application/json:
  448. schema:
  449. type: object
  450. properties:
  451. threads:
  452. type: array
  453. items:
  454. type: string
  455. responses:
  456. "200":
  457. content:
  458. application/json:
  459. schema:
  460. type: object
  461. properties:
  462. newThreads:
  463. type: object
  464. description: Mapping of old thread ids to their duplicated thread ids
  465. description: Duplicate a list of comment threads
  466. "/project/{projectId}/generate-thread-data":
  467. parameters:
  468. - schema:
  469. type: string
  470. name: projectId
  471. in: path
  472. required: true
  473. post:
  474. summary: Generate thread data to load into the frontend
  475. operationId: generateThreadData
  476. requestBody:
  477. content:
  478. application/json:
  479. schema:
  480. type: object
  481. properties:
  482. threads:
  483. type: array
  484. items:
  485. type: string
  486. responses:
  487. "200":
  488. content:
  489. application/json:
  490. schema:
  491. type: object
  492. description: Load threads and generate a json blob containing all messages in all the threads
  493. "/project/{projectId}/clone-comment-threads":
  494. parameters:
  495. - schema:
  496. type: string
  497. name: projectId
  498. in: path
  499. required: true
  500. post:
  501. summary: Clone a projects comment threads
  502. operationId: cloneCommentThreads
  503. requestBody:
  504. content:
  505. application/json:
  506. schema:
  507. type: object
  508. properties:
  509. targetProjectId:
  510. type: string
  511. responses:
  512. "204":
  513. description: OK
  514. description: Clone a projects comment threads
  515. components:
  516. schemas:
  517. Message:
  518. title: Message
  519. x-stoplight:
  520. id: ue9n1vvezlutw
  521. type: object
  522. examples:
  523. - user_id: string
  524. - content: string
  525. properties:
  526. user_id:
  527. type: string
  528. content:
  529. type: string
  530. required:
  531. - user_id
  532. - content
  533. Thread:
  534. title: Thread
  535. x-stoplight:
  536. id: 0ppt3jw4h5bua
  537. type: array
  538. items:
  539. $ref: "#/components/schemas/Message"