mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	Misc docs
This commit is contained in:
		
				
					committed by
					
						 FliegendeWurst
						FliegendeWurst
					
				
			
			
				
	
			
			
			
						parent
						
							9b188503db
						
					
				
				
					commit
					6467265cfd
				
			| @@ -34,6 +34,7 @@ const options = { | |||||||
|         "./src/routes/api/setup.ts", |         "./src/routes/api/setup.ts", | ||||||
|         // all other files |         // all other files | ||||||
|         "./src/routes/api/*.ts", |         "./src/routes/api/*.ts", | ||||||
|  |         "./src/routes/*.ts", | ||||||
|         "./bin/generate-openapi.ts" |         "./bin/generate-openapi.ts" | ||||||
|     ] |     ] | ||||||
| }; | }; | ||||||
| @@ -68,7 +69,7 @@ console.log("Saved to ", outputPath); | |||||||
|  *           $ref: "#/components/schemas/NoteId" |  *           $ref: "#/components/schemas/NoteId" | ||||||
|  *         type: |  *         type: | ||||||
|  *           type: string |  *           type: string | ||||||
|  *           enum: ["attribute", "relation"] |  *           enum: ["label", "relation"] | ||||||
|  *         name: |  *         name: | ||||||
|  *           type: string |  *           type: string | ||||||
|  *           example: "internalLink" |  *           example: "internalLink" | ||||||
| @@ -100,6 +101,7 @@ console.log("Saved to ", outputPath); | |||||||
|  *           $ref: "#/components/schemas/UtcDateTime" |  *           $ref: "#/components/schemas/UtcDateTime" | ||||||
|  *     Branch: |  *     Branch: | ||||||
|  *       type: object |  *       type: object | ||||||
|  |  *       required: ["branchId", "noteId", "parentNoteId", "notePosition"] | ||||||
|  *       properties: |  *       properties: | ||||||
|  *         branchId: |  *         branchId: | ||||||
|  *           $ref: "#/components/schemas/BranchId" |  *           $ref: "#/components/schemas/BranchId" | ||||||
| @@ -142,6 +144,7 @@ console.log("Saved to ", outputPath); | |||||||
|  *           description: Encoded entity data. Object has one property for each database column. |  *           description: Encoded entity data. Object has one property for each database column. | ||||||
|  *     Note: |  *     Note: | ||||||
|  *       type: object |  *       type: object | ||||||
|  |  *       required: ["noteId", "title", "isProtected", "type", "mime", "blobId"] | ||||||
|  *       properties: |  *       properties: | ||||||
|  *         noteId: |  *         noteId: | ||||||
|  *           $ref: "#/components/schemas/NoteId" |  *           $ref: "#/components/schemas/NoteId" | ||||||
|   | |||||||
| @@ -62,6 +62,36 @@ function setPassword(req: Request, res: Response) { | |||||||
|     res.redirect("login"); |     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) { | function login(req: Request, res: Response) { | ||||||
|     if (openID.isOpenIDEnabled()) { |     if (openID.isOpenIDEnabled()) { | ||||||
|         res.oidc.login({ |         res.oidc.login({ | ||||||
|   | |||||||
| @@ -1,2 +1,2 @@ | |||||||
| # attachments | # attachments | ||||||
| <figure class="table" style="width:100%;"><table class="ck-table-resized"><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Column Name</th><th>Data Type</th><th>Nullity</th><th>Default value</th><th>Description</th></tr></thead><tbody><tr><th><code>attachmentId</code></th><td>Text</td><td>Non-null</td><td> </td><td>Unique ID (e.g. <code>qhC1vzU4nwSE</code>)</td></tr><tr><th><code>ownerId</code></th><td>Text</td><td>Non-null</td><td> </td><td>The unique ID of a row in <a class="reference-link" href="notes.md">notes</a>.</td></tr><tr><th><code>role</code></th><td>Text</td><td>Non-null</td><td> </td><td>The role of the attachment: <code>image</code> for images that are attached to a note.</td></tr><tr><th><code>mime</code></th><td>Text</td><td>Non-null</td><td> </td><td>The MIME type of the attachment (e.g. <code>image/png</code>)</td></tr><tr><th><code>title</code></th><td>Text</td><td>Non-null</td><td> </td><td>The title of the attachment.</td></tr><tr><th><code>isProtected</code></th><td>Integer</td><td>Non-null</td><td>0</td><td><code>1</code> if the entity is <a href="../Protected%20entities.md">protected</a>, <code>0</code> otherwise.</td></tr><tr><th><code>position</code></th><td>Integer</td><td>Non-null</td><td>0</td><td>Not sure where the position is relevant for attachments (saw it with values of 10 and 0).</td></tr><tr><th><code>blobId</code></th><td>Text</td><td>Nullable</td><td><code>null</code></td><td>The corresponding <code>blobId</code> from the <a class="reference-link" href="blobs.md">blobs</a> table.</td></tr><tr><th><code>dateModified</code></th><td>Text</td><td>Non-null</td><td> </td><td>Localized modification date (e.g. <code>2023-11-08 18:43:44.204+0200</code>)</td></tr><tr><th><code>utcDateModified</code></th><td>Text</td><td>Non-null</td><td> </td><td>Modification date in UTC format (e.g. <code>2023-11-08 16:43:44.204Z</code>)</td></tr><tr><th><code>utcDateScheduledForErasure</code></th><td>Text</td><td>Nullable</td><td><code>null</code></td><td> </td></tr><tr><th><code>isDeleted</code></th><td>Integer</td><td>Non-null</td><td> </td><td><code>1</code> if the entity is <a href="../Deleted%20notes.md">deleted</a>, <code>0</code> otherwise.</td></tr><tr><th><code>deleteId</code></th><td>Text</td><td>Nullable</td><td><code>null</code></td><td> </td></tr></tbody></table></figure> | <figure class="table" style="width:100%;"><table class="ck-table-resized"><colgroup><col> <col> <col> <col> <col></colgroup><thead><tr><th>Column Name</th><th>Data Type</th><th>Nullity</th><th>Default value</th><th>Description</th></tr></thead><tbody><tr><th><code>attachmentId</code></th><td>Text</td><td>Non-null</td><td> </td><td>Unique ID (e.g. <code>qhC1vzU4nwSE</code>)</td></tr><tr><th><code>ownerId</code></th><td>Text</td><td>Non-null</td><td> </td><td>The unique ID of a row in <a class="reference-link" href="notes.md">notes</a>.</td></tr><tr><th><code>role</code></th><td>Text</td><td>Non-null</td><td> </td><td>The role of the attachment: <code>image</code> for images that are attached to a note, <code>file</code> for uploaded files.</td></tr><tr><th><code>mime</code></th><td>Text</td><td>Non-null</td><td> </td><td>The MIME type of the attachment (e.g. <code>image/png</code>)</td></tr><tr><th><code>title</code></th><td>Text</td><td>Non-null</td><td> </td><td>The title of the attachment.</td></tr><tr><th><code>isProtected</code></th><td>Integer</td><td>Non-null</td><td>0</td><td><code>1</code> if the entity is <a href="../Protected%20entities.md">protected</a>, <code>0</code> otherwise.</td></tr><tr><th><code>position</code></th><td>Integer</td><td>Non-null</td><td>0</td><td>Not sure where the position is relevant for attachments (saw it with values of 10 and 0).</td></tr><tr><th><code>blobId</code></th><td>Text</td><td>Nullable</td><td><code>null</code></td><td>The corresponding <code>blobId</code> from the <a class="reference-link" href="blobs.md">blobs</a> table.</td></tr><tr><th><code>dateModified</code></th><td>Text</td><td>Non-null</td><td> </td><td>Localized modification date (e.g. <code>2023-11-08 18:43:44.204+0200</code>)</td></tr><tr><th><code>utcDateModified</code></th><td>Text</td><td>Non-null</td><td> </td><td>Modification date in UTC format (e.g. <code>2023-11-08 16:43:44.204Z</code>)</td></tr><tr><th><code>utcDateScheduledForErasure</code></th><td>Text</td><td>Nullable</td><td><code>null</code></td><td> </td></tr><tr><th><code>isDeleted</code></th><td>Integer</td><td>Non-null</td><td> </td><td><code>1</code> if the entity is <a href="../Deleted%20notes.md">deleted</a>, <code>0</code> otherwise.</td></tr><tr><th><code>deleteId</code></th><td>Text</td><td>Nullable</td><td><code>null</code></td><td> </td></tr></tbody></table></figure> | ||||||
		Reference in New Issue
	
	Block a user