Files
overleaf-cep/services/chat/chat.yaml
Rebeka Dekany a648015db8 Centralize prettier configuration to root level (#30501)
* Merge all .prettierignore files into top-level config

* Merge all .prettierrc files into top-level config

* Replace service-specific glob patterns in package.json format scripts with `prettier .`

* Add template files with Jinja2, Go template, envsubst, and Handlebars syntax to .prettierignore

* Ignore GitHub templates

* Ignore PUG templates to format them separately with `format:pug`

* Encourage double quotes for YAML, YML files

* Move prettier for PUG source format script to the root

* Move prettier for styles source format script to the root

* Remove prettier for jenkins files from web

* Remove prettier source format script from all services

* Make .prettierrc more readable

* Update format scripts by file type

* Organise `.prettierignore`

* Add `--cache` flag to prettier scripts for faster runs

* Format all files with prettier

* Format all or format services

* Remove `format`/`format:fix` scripts from services since now it runs from root `package.json`

* Avoid conlficts with yamllint configuration

* Remove `--cache` flag from prettier scripts

* Update all service Makefiles to use root-level prettier configuration

* Update all Jenkinsfile to use root-level prettier configuration

* Ignore auto-generated files by build_scripts

* Update package-lock.json

* Update root Makefile format targets

* Update SP Jenkinsfile format target

* Update E2E Makefile format script

* Udpate `format_js` to work in both local and CI env

* Add docker-mailtrap to .prettierignore

docker-mailtrap is a third-party git-ignored directory used for testing

* Added Docker env detection to prevent nested Docker spawning

* Ignore handlebars templates

* Add cryptographic files and test output to `.prettierignore`

* Add terraform modules to `.gitignore`

* Remove prettier-plugin-groovy

* Use npx directly instead of Docker for local formatting for faster formatting

* Auto-generate Makefiles

* Revert "Remove prettier-plugin-groovy"

This reverts commit 194a33589a2e1e4d2225d10c67e9f025e4222025.

* Mount monorepo root in RUN_LINT_FORMAT for prettier config access

* Prettier ignores all `node_modules` by default regardless of location

* Show only changed files in format output

* Ignore LICENSE files

* Enable prettier on rendered build_scripts outputs

* Ignoring all the template folders by prettier

* Remove the public/minjs entry since it does not exist

* Remove all non-existent paths

* Sync `.prettierignore` with ignored files by `.gitignore` and `.dockerignore` files

* Revert "Auto-generate Makefiles"

This reverts commit c0233e490de1bc95fe437219d65e0b66e0331ec9.

* Revert "Use npx directly instead of Docker for local formatting for faster formatting"

This reverts commit 1d2b2cf1a6c6974c76885852a90dd55e84167e41.

* Ignore dashboard JSON files

* Ignore files generated by bin/update_build_scripts

* Remove unsupported file types from `.prettierignore`

* Ignore test fixture generated files

* Ignore README file types by prettier

* Ignore generate snapshots by prettier

* Allow to format generated bin/update_build_scripts by prettier

* Ensure build script outputs prettier-compatible tsconfig.json

* Fix build script output to match prettier formatting
- Fix Jinja2 whitespace in docker-compose templates
- Change YAML quotes from single to double

* Don't read cryptographic files by prettier

* Ignore google verification files by prettier

* Revert npx prettier formatting

* Ignore domain verification files

* Show only changed files in format output

* Make `.github` prettier

* Allow all files to be formatted in jobs by prettier

* Allow server-ce/server-pro files to be formatted by prettier

* Ignore more folders in clsi, filestory, git-bridge by prettier

* Update build script with `RUN_LINTING_CI_MONOREPO`

* Ignore docker-mailtrap and downloads in server-ce by prettier

* Restore prettier configs and prettierignore for V1 since it has its own prettier (an older version)

* Source format

GitOrigin-RevId: 637adc3cc422d1f20c86d6ebc8ec514d60758287
2026-02-04 09:08:22 +00:00

518 lines
13 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}/messages/{messageId}":
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: messageId
in: path
required: true
get:
summary: Get single global message
tags: []
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
"404":
description: Message not found
operationId: getGlobalMessage
description: Get a single global message by message ID for the project with Project ID provided
delete:
summary: Delete global message
operationId: deleteGlobalMessage
responses:
"204":
description: No Content
description: "Delete global message"
"/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}/messages/{messageId}/edit":
parameters:
- schema:
type: string
name: projectId
in: path
required: true
- schema:
type: string
name: messageId
in: path
required: true
post:
summary: Edit global message
operationId: editGlobalMessage
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 global message with Message ID provided from the 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
get:
summary: Get thread message
tags: []
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Message"
"404":
description: Message not found
operationId: getThreadMessage
description: Get a specific message by message ID from the thread with Thread ID and Project ID provided
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}/user/{userId}/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: userId
in: path
required: true
- schema:
type: string
name: messageId
in: path
required: true
delete:
summary: Delete message written by a given user
operationId: deleteUserMessage
responses:
"204":
description: No Content
"/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
get:
summary: Get Thread
tags: []
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Thread"
"404":
description: Thread not found
operationId: getThread
description: Get a thread with ThreadID and ProjectID provided
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
"/project/{projectId}/duplicate-comment-threads":
parameters:
- schema:
type: string
name: projectId
in: path
required: true
post:
summary: Duplicate comment threads
operationId: duplicateCommentThreads
requestBody:
content:
application/json:
schema:
type: object
properties:
threads:
type: array
items:
type: string
responses:
"200":
content:
application/json:
schema:
type: object
properties:
newThreads:
type: object
description: Mapping of old thread ids to their duplicated thread ids
description: Duplicate a list of comment threads
"/project/{projectId}/generate-thread-data":
parameters:
- schema:
type: string
name: projectId
in: path
required: true
post:
summary: Generate thread data to load into the frontend
operationId: generateThreadData
requestBody:
content:
application/json:
schema:
type: object
properties:
threads:
type: array
items:
type: string
responses:
"200":
content:
application/json:
schema:
type: object
description: Load threads and generate a json blob containing all messages in all the threads
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"