Merge pull request #1846 from FliegendeWurst/openapi-revive

OpenAPI documentation fixes
This commit is contained in:
Elian Doran
2025-05-04 00:24:15 +03:00
committed by GitHub
7 changed files with 55 additions and 17 deletions
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -124,14 +124,14 @@ function forceFullSync() {
* type: object
* properties:
* entityChanges:
* type: list
* type: array
* items:
* $ref: '#/components/schemas/EntityChange'
* lastEntityChangeId:
* type: integer
* description: If `outstandingPullCount > 0`, pass this as parameter in your next request to continue.
* outstandingPullCount:
* type: int
* type: integer
* example: 42
* description: Number of changes not yet returned by the remote.
* security:
@@ -247,7 +247,7 @@ const partialRequests: Record<
* type: string
* description: Local instance ID
* entities:
* type: list
* type: array
* items:
* $ref: '#/components/schemas/EntityChange'
* responses:
+3 -3
View File
@@ -152,15 +152,15 @@ function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
* type: object
* properties:
* branches:
* type: list
* type: array
* items:
* $ref: '#/components/schemas/Branch'
* notes:
* type: list
* type: array
* items:
* $ref: '#/components/schemas/Note'
* attributes:
* type: list
* type: array
* items:
* $ref: '#/components/schemas/Attribute'
* security:
+30
View File
@@ -62,6 +62,36 @@ function setPassword(req: Request, res: Response) {
res.redirect("login");
}
/**
* @swagger
* /login:
* post:
* tags:
* - auth
* summary: Log in using password
* description: This will give you a Trilium session, which is required for some other API endpoints. `totpToken` is only required if the user configured TOTP authentication.
* operationId: login-normal
* externalDocs:
* description: HMAC calculation
* url: https://github.com/TriliumNext/Notes/blob/v0.91.6/src/services/utils.ts#L62-L66
* requestBody:
* content:
* application/x-www-form-urlencoded:
* schema:
* type: object
* required:
* - password
* properties:
* password:
* type: string
* totpToken:
* type: string
* responses:
* '200':
* description: Successful operation
* '401':
* description: Password / TOTP mismatch
*/
function login(req: Request, res: Response) {
if (openID.isOpenIDEnabled()) {
res.oidc.login({