overleaf/services/chat/chat.yaml
Eric Mc Sween 814b085b44 Merge pull request #18374 from overleaf/em-chat-resolved-thread-ids
Add resolved-thread-ids endpoint to chat

GitOrigin-RevId: 211dee88707f2d7fb1c0c8805a1f6ac28dca494d
2024-05-27 10:22:15 +00:00

330 lines
8.3 KiB
YAML

openapi: 3.1.0
x-stoplight:
id: okoe8mh50pjec
info:
title: chat
version: '1.0'
servers:
- url: 'http://chat:3010'
x-exegesis-controller: messagesController
paths:
'/project/{projectId}/messages':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
get:
summary: Get Global messages
tags: []
responses:
'201':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Message'
operationId: getGlobalMessages
description: Get global messages for the project with Project ID provided
parameters:
- schema:
type: string
in: query
name: before
- schema:
type: string
in: query
name: limit
post:
summary: Send Global message
operationId: sendGlobalMessage
responses:
'201':
description: OK
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
examples:
example-1:
value:
user_id: string
content: string
description: 'UserID and Content of the message to be posted. '
description: Send global message for the project with Project ID provided
'/project/{projectId}/thread/{threadId}/messages':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: threadId
in: path
required: true
post:
summary: Send message
operationId: sendMessage
responses:
'201':
description: Created
description: Add a message to the thread with thread ID provided from the Project with Project ID provided.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Message'
description: |-
JSON object with :
- user_id: Id of the user
- content: Content of the message
'/project/{projectId}/threads':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
get:
summary: Get Threads
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/Thread'
examples: {}
'404':
description: Not Found
operationId: getThreads
description: Get the list of threads for the project with Project ID provided
'/project/{projectId}/thread/{threadId}/messages/{messageId}/edit':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: threadId
in: path
required: true
- schema:
type: string
name: messageId
in: path
required: true
post:
summary: Edit message
operationId: editMessage
responses:
'204':
description: No Content
'404':
description: Not Found
requestBody:
content:
application/json:
schema:
type: object
properties:
content:
type: string
user_id:
type: string
readOnly: true
required:
- content
examples: {}
description: |-
JSON object with :
- content: Content of the message to edit
- user_id: Id of the user (optional)
description: |
Update message with Message ID provided from the Thread ID and Project ID provided
'/project/{projectId}/thread/{threadId}/messages/{messageId}':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: threadId
in: path
required: true
- schema:
type: string
name: messageId
in: path
required: true
delete:
summary: Delete message
operationId: deleteMessage
responses:
'204':
description: No Content
description: 'Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided'
'/project/{projectId}/thread/{threadId}/resolve':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: threadId
in: path
required: true
post:
summary: Resolve Thread
operationId: resolveThread
responses:
'204':
description: No Content
requestBody:
content:
application/json:
schema:
type: object
properties:
user_id:
type: string
required:
- user_id
description: |-
JSON object with :
- user_id: Id of the user.
description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
'/project/{projectId}/thread/{threadId}/reopen':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: threadId
in: path
required: true
post:
summary: Reopen Thread
operationId: reopenThread
responses:
'204':
description: No Content
description: |-
Reopen Thread with ThreadID and ProjectID provided.
i.e unmark it as resolved.
'/project/{projectId}/thread/{threadId}':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: threadId
in: path
required: true
delete:
summary: Delete thread
operationId: deleteThread
responses:
'204':
description: No Content
description: Delete thread with ThreadID and ProjectID provided
'/project/{projectId}/resolved-thread-ids':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
get:
summary: Get resolved thread ids
operationId: getResolvedThreadIds
responses:
'200':
description: Resolved thread ids
'/project/{projectId}':
parameters:
- schema:
type: string
name: projectId
in: path
required: true
delete:
summary: Destroy project
operationId: destroyProject
responses:
'204':
description: No Content
description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
/status:
get:
summary: Check status
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: string
description: chat is alive
operationId: getStatus
description: Check that the Chat service is alive
head:
summary: Check status
tags: []
responses:
'200':
description: OK
content:
application/json:
schema:
type: string
description: chat is alive
operationId: getStatus
description: Check that the Chat service is alive
components:
schemas:
Message:
title: Message
x-stoplight:
id: ue9n1vvezlutw
type: object
examples:
- user_id: string
- content: string
properties:
user_id:
type: string
content:
type: string
required:
- user_id
- content
Thread:
title: Thread
x-stoplight:
id: 0ppt3jw4h5bua
type: array
items:
$ref: '#/components/schemas/Message'