mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
a110f24b05
@ -2,7 +2,7 @@
|
|||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"productName": "Trilium Notes",
|
"productName": "Trilium Notes",
|
||||||
"description": "Trilium Notes",
|
"description": "Trilium Notes",
|
||||||
"version": "0.58.3-beta",
|
"version": "0.58.4",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"main": "electron.js",
|
"main": "electron.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -291,6 +291,33 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Error'
|
$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}:
|
/branches/{branchId}:
|
||||||
parameters:
|
parameters:
|
||||||
- name: branchId
|
- name: branchId
|
||||||
|
@ -8,6 +8,7 @@ const v = require("./validators");
|
|||||||
const searchService = require("../services/search/services/search");
|
const searchService = require("../services/search/services/search");
|
||||||
const SearchContext = require("../services/search/search_context");
|
const SearchContext = require("../services/search/search_context");
|
||||||
const zipExportService = require("../services/export/zip");
|
const zipExportService = require("../services/export/zip");
|
||||||
|
const noteRevisionService = require("../services/note_revisions.js");
|
||||||
|
|
||||||
function register(router) {
|
function register(router) {
|
||||||
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
|
eu.route(router, 'get', '/etapi/notes', (req, res, next) => {
|
||||||
@ -122,6 +123,8 @@ function register(router) {
|
|||||||
|
|
||||||
note.setContent(req.body);
|
note.setContent(req.body);
|
||||||
|
|
||||||
|
noteService.scanForLinks(note);
|
||||||
|
|
||||||
return res.sendStatus(204);
|
return res.sendStatus(204);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -143,18 +146,26 @@ function register(router) {
|
|||||||
|
|
||||||
zipExportService.exportToZip(taskContext, branch, format, res);
|
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) {
|
function parseSearchParams(req) {
|
||||||
const rawSearchParams = {
|
const rawSearchParams = {
|
||||||
'fastSearch': parseBoolean(req.query, 'fastSearch'),
|
fastSearch: parseBoolean(req.query, 'fastSearch'),
|
||||||
'includeArchivedNotes': parseBoolean(req.query, 'includeArchivedNotes'),
|
includeArchivedNotes: parseBoolean(req.query, 'includeArchivedNotes'),
|
||||||
'ancestorNoteId': req.query['ancestorNoteId'],
|
ancestorNoteId: req.query['ancestorNoteId'],
|
||||||
'ancestorDepth': parseInteger(req.query, 'ancestorDepth'),
|
ancestorDepth: req.query['ancestorDepth'], // e.g. "eq5"
|
||||||
'orderBy': req.query['orderBy'],
|
orderBy: req.query['orderBy'],
|
||||||
'orderDirection': parseOrderDirection(req.query, 'orderDirection'),
|
orderDirection: parseOrderDirection(req.query, 'orderDirection'),
|
||||||
'limit': parseInteger(req.query, 'limit'),
|
limit: parseInteger(req.query, 'limit'),
|
||||||
'debug': parseBoolean(req.query, 'debug')
|
debug: parseBoolean(req.query, 'debug')
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchParams = {};
|
const searchParams = {};
|
||||||
|
@ -31,7 +31,7 @@ class ZoomComponent extends Component {
|
|||||||
|
|
||||||
async setZoomFactorAndSave(zoomFactor) {
|
async setZoomFactorAndSave(zoomFactor) {
|
||||||
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
|
if (zoomFactor >= MIN_ZOOM && zoomFactor <= MAX_ZOOM) {
|
||||||
zoomFactor = Math.round(zoomFactor * 1000) / 1000;
|
zoomFactor = Math.round(zoomFactor * 10) / 10;
|
||||||
|
|
||||||
this.setZoomFactor(zoomFactor);
|
this.setZoomFactor(zoomFactor);
|
||||||
|
|
||||||
|
@ -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" };
|
||||||
|
23
test-etapi/post-note-revision.http
Normal file
23
test-etapi/post-note-revision.http
Normal 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); %}
|
@ -20,7 +20,7 @@ Content-Type: text/plain
|
|||||||
|
|
||||||
Changed content
|
Changed content
|
||||||
|
|
||||||
> {% client.assert(response.status === 200); %}
|
> {% client.assert(response.status === 204); %}
|
||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user