Merge branch 'master' into dev

This commit is contained in:
zadam 2023-01-13 21:11:23 +01:00
commit a110f24b05
7 changed files with 73 additions and 12 deletions

View file

@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.58.3-beta",
"version": "0.58.4",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {

View file

@ -291,6 +291,33 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Error'
/notes/{noteId}/note-revision:
parameters:
- name: noteId
in: path
required: true
schema:
$ref: '#/components/schemas/EntityId'
- name: format
in: query
required: false
schema:
enum:
- html
- markdown
default: html
post:
description: Create a note revision for the given note
operationId: createNoteRevision
responses:
'204':
description: revision has been created
default:
description: unexpected error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/branches/{branchId}:
parameters:
- name: branchId

View file

@ -8,6 +8,7 @@ const v = require("./validators");
const searchService = require("../services/search/services/search");
const SearchContext = require("../services/search/search_context");
const zipExportService = require("../services/export/zip");
const noteRevisionService = require("../services/note_revisions.js");
function register(router) {
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
@ -122,6 +123,8 @@ function register(router) {
note.setContent(req.body);
noteService.scanForLinks(note);
return res.sendStatus(204);
});
@ -143,18 +146,26 @@ function register(router) {
zipExportService.exportToZip(taskContext, branch, format, res);
});
eu.route(router, 'post' ,'/etapi/notes/:noteId/note-revision', (req, res, next) => {
const note = eu.getAndCheckNote(req.params.noteId);
note.saveNoteRevision();
return res.sendStatus(204);
});
}
function parseSearchParams(req) {
const rawSearchParams = {
'fastSearch': parseBoolean(req.query, 'fastSearch'),
'includeArchivedNotes': parseBoolean(req.query, 'includeArchivedNotes'),
'ancestorNoteId': req.query['ancestorNoteId'],
'ancestorDepth': parseInteger(req.query, 'ancestorDepth'),
'orderBy': req.query['orderBy'],
'orderDirection': parseOrderDirection(req.query, 'orderDirection'),
'limit': parseInteger(req.query, 'limit'),
'debug': parseBoolean(req.query, 'debug')
fastSearch: parseBoolean(req.query, 'fastSearch'),
includeArchivedNotes: parseBoolean(req.query, 'includeArchivedNotes'),
ancestorNoteId: req.query['ancestorNoteId'],
ancestorDepth: req.query['ancestorDepth'], // e.g. "eq5"
orderBy: req.query['orderBy'],
orderDirection: parseOrderDirection(req.query, 'orderDirection'),
limit: parseInteger(req.query, 'limit'),
debug: parseBoolean(req.query, 'debug')
};
const searchParams = {};

View file

@ -31,7 +31,7 @@ class ZoomComponent extends Component {
async setZoomFactorAndSave(zoomFactor) {
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
zoomFactor = Math.round(zoomFactor * 1000) / 1000;
zoomFactor = Math.round(zoomFactor * 10) / 10;
this.setZoomFactor(zoomFactor);

View file

@ -1 +1 @@
module.exports = { buildDate:"2023-01-04T22:36:31+01:00", buildRevision: "3a5fa2954dea0ff2ecdce9a28b3bb01f039d314d" };
module.exports = { buildDate:"2023-01-11T23:44:33+01:00", buildRevision: "bdfdc0402ddb23e9af002580f368bc52e4268b3a" };

View file

@ -0,0 +1,23 @@
POST {{triliumHost}}/etapi/create-note
Authorization: {{authToken}}
Content-Type: application/json
{
"parentNoteId": "root",
"title": "Hello",
"type": "code",
"mime": "text/plain",
"content": "Hi there!"
}
> {% client.global.set("createdNoteId", response.body.note.noteId); %}
###
POST {{triliumHost}}/etapi/notes/{{createdNoteId}}/note-revision
Authorization: {{authToken}}
Content-Type: text/plain
Changed content
> {% client.assert(response.status === 204); %}

View file

@ -20,7 +20,7 @@ Content-Type: text/plain
Changed content
> {% client.assert(response.status === 200); %}
> {% client.assert(response.status === 204); %}
###