Compare commits

..

10 Commits

Author SHA1 Message Date
zadam
d243880099 release 0.62.4 2023-12-07 00:03:59 +01:00
zadam
2e23c521c3 electron upgrade 2023-12-06 23:54:17 +01:00
zadam
eb761b286f electron upgrade 2023-12-04 00:17:00 +01:00
zadam
d0f6ff5f98 fix erasing revisions 2023-12-04 00:11:24 +01:00
zadam
84feaabc52 release 0.62.3 2023-11-27 23:37:24 +01:00
zadam
a6036859b8 normalize strings before calculation hashes, #4435 2023-11-27 23:23:55 +01:00
zadam
93dcce2217 dragging notes from note tree will automatically insert them as images where appropriate (image, canvas, mermaid) 2023-11-27 10:38:19 +01:00
zadam
686af0c6a1 when canvas and mermaid are inserted using "include note", we insert them as images 2023-11-27 10:22:54 +01:00
zadam
d07f02b95f contrary to what I believed encodeURIComponent() is available also in node.js, #4478 2023-11-27 10:15:29 +01:00
zadam
ad74952194 fix thumbnails with chinese titles, closes #4478 2023-11-27 10:10:27 +01:00
25 changed files with 178 additions and 233 deletions

18
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "trilium",
"version": "0.62.1-beta",
"version": "0.62.3",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "trilium",
"version": "0.62.1-beta",
"version": "0.62.3",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
"dependencies": {
@@ -81,7 +81,7 @@
},
"devDependencies": {
"cross-env": "7.0.3",
"electron": "25.9.5",
"electron": "25.9.8",
"electron-builder": "24.6.4",
"electron-packager": "17.1.2",
"electron-rebuild": "3.2.9",
@@ -4366,9 +4366,9 @@
}
},
"node_modules/electron": {
"version": "25.9.5",
"resolved": "https://registry.npmjs.org/electron/-/electron-25.9.5.tgz",
"integrity": "sha512-gM7GXUSd3JVRcYbBnNOtZeNnE5MCJjtZTT8QyIxJvpQ0Dh9dz3hTuEL62dOwnMFW/l47ACQ6es/8qi01P4QGZA==",
"version": "25.9.8",
"resolved": "https://registry.npmjs.org/electron/-/electron-25.9.8.tgz",
"integrity": "sha512-PGgp6PH46QVENHuAHc2NT1Su8Q1qov7qIl2jI5tsDpTibwV2zD8539AeWBQySeBU4dhbj9onIl7+1bXQ0wefBg==",
"hasInstallScript": true,
"dependencies": {
"@electron/get": "^2.0.0",
@@ -16964,9 +16964,9 @@
}
},
"electron": {
"version": "25.9.5",
"resolved": "https://registry.npmjs.org/electron/-/electron-25.9.5.tgz",
"integrity": "sha512-gM7GXUSd3JVRcYbBnNOtZeNnE5MCJjtZTT8QyIxJvpQ0Dh9dz3hTuEL62dOwnMFW/l47ACQ6es/8qi01P4QGZA==",
"version": "25.9.8",
"resolved": "https://registry.npmjs.org/electron/-/electron-25.9.8.tgz",
"integrity": "sha512-PGgp6PH46QVENHuAHc2NT1Su8Q1qov7qIl2jI5tsDpTibwV2zD8539AeWBQySeBU4dhbj9onIl7+1bXQ0wefBg==",
"requires": {
"@electron/get": "^2.0.0",
"@types/node": "^18.11.18",

View File

@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.62.2",
"version": "0.62.4",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {
@@ -104,7 +104,7 @@
},
"devDependencies": {
"cross-env": "7.0.3",
"electron": "25.9.5",
"electron": "25.9.8",
"electron-builder": "24.6.4",
"electron-packager": "17.1.2",
"electron-rebuild": "3.2.9",

109
spec/etapi/notes.js Normal file
View File

@@ -0,0 +1,109 @@
const crypto = require('crypto');
const {
deleteEtapi,
getEtapiResponse,
describeEtapi, postEtapi,
getEtapi,
getEtapiContent,
patchEtapi, putEtapi,
putEtapiContent
} = require("../support/etapi");
describeEtapi("notes", () => {
it("create", async () => {
const {note, branch} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content',
prefix: 'Custom prefix'
});
expect(note.title).toEqual("Hello World!");
expect(branch.parentNoteId).toEqual("root");
expect(branch.prefix).toEqual("Custom prefix");
const rNote = await getEtapi(`notes/${note.noteId}`);
expect(rNote.title).toEqual("Hello World!");
const rContent = await (await getEtapiContent(`notes/${note.noteId}/content`)).text();
expect(rContent).toEqual("Content");
const rBranch = await getEtapi(`branches/${branch.branchId}`);
expect(rBranch.parentNoteId).toEqual("root");
expect(rBranch.prefix).toEqual("Custom prefix");
});
it("patch", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content'
});
await patchEtapi(`notes/${note.noteId}`, {
title: 'new title',
type: 'code',
mime: 'text/apl',
dateCreated: '2000-01-01 12:34:56.999+0200',
utcDateCreated: '2000-01-01 10:34:56.999Z',
});
const rNote = await getEtapi(`notes/${note.noteId}`);
expect(rNote.title).toEqual("new title");
expect(rNote.type).toEqual("code");
expect(rNote.mime).toEqual("text/apl");
expect(rNote.dateCreated).toEqual("2000-01-01 12:34:56.999+0200");
expect(rNote.utcDateCreated).toEqual("2000-01-01 10:34:56.999Z");
});
it("update content", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content'
});
await putEtapiContent(`notes/${note.noteId}/content`, "new content");
const rContent = await (await getEtapiContent(`notes/${note.noteId}/content`)).text();
expect(rContent).toEqual("new content");
});
it("create / update binary content", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'file',
title: 'Hello World!',
content: 'ZZZ'
});
const updatedContent = crypto.randomBytes(16);
await putEtapiContent(`notes/${note.noteId}/content`, updatedContent);
const rContent = await (await getEtapiContent(`notes/${note.noteId}/content`)).arrayBuffer();
expect(Buffer.from(new Uint8Array(rContent))).toEqual(updatedContent);
});
it("delete note", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content'
});
await deleteEtapi(`notes/${note.noteId}`);
const resp = await getEtapiResponse(`notes/${note.noteId}`);
expect(resp.status).toEqual(404);
const error = await resp.json();
expect(error.status).toEqual(404);
expect(error.code).toEqual("NOTE_NOT_FOUND");
expect(error.message).toEqual(`Note '${note.noteId}' not found.`);
});
});

View File

@@ -1,108 +1,5 @@
const crypto = require('crypto');
const {
deleteEtapi,
getEtapiResponse,
describeEtapi, postEtapi,
getEtapi,
getEtapiContent,
patchEtapi, putEtapi,
putEtapiContent
} = require("../support/etapi");
describe("Notes", () => {
it("zzz", () => {
describeEtapi("notes", () => {
it("create", async () => {
const {note, branch} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content',
prefix: 'Custom prefix'
});
expect(note.title).toEqual("Hello World!");
expect(branch.parentNoteId).toEqual("root");
const rNote = await getEtapi(`notes/${note.noteId}`);
expect(rNote.title).toEqual("Hello World!");
const rContent = await (await getEtapiContent(`notes/${note.noteId}/content`)).text();
expect(rContent).toEqual("Content");
const rBranch = await getEtapi(`branches/${branch.branchId}`);
expect(rBranch.parentNoteId).toEqual("root");
expect(rBranch.prefix).toEqual("Custom prefix");
});
it("patch", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content'
});
await patchEtapi(`notes/${note.noteId}`, {
title: 'new title',
type: 'code',
mime: 'text/apl',
dateCreated: '2000-01-01 12:34:56.999+0200',
utcDateCreated: '2000-01-01 10:34:56.999Z',
});
const rNote = await getEtapi(`notes/${note.noteId}`);
expect(rNote.title).toEqual("new title");
expect(rNote.type).toEqual("code");
expect(rNote.mime).toEqual("text/apl");
expect(rNote.dateCreated).toEqual("2000-01-01 12:34:56.999+0200");
expect(rNote.utcDateCreated).toEqual("2000-01-01 10:34:56.999Z");
});
it("update content", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content'
});
await putEtapiContent(`notes/${note.noteId}/content`, "new content");
const rContent = await (await getEtapiContent(`notes/${note.noteId}/content`)).text();
expect(rContent).toEqual("new content");
});
it("create / update binary content", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'file',
title: 'Hello World!',
content: 'ZZZ'
});
const updatedContent = crypto.randomBytes(16);
await putEtapiContent(`notes/${note.noteId}/content`, updatedContent);
const rContent = await (await getEtapiContent(`notes/${note.noteId}/content`)).arrayBuffer();
expect(Buffer.from(new Uint8Array(rContent))).toEqual(updatedContent);
});
it("delete note", async () => {
const {note} = await postEtapi('create-note', {
parentNoteId: 'root',
type: 'text',
title: 'Hello World!',
content: 'Content'
});
await deleteEtapi(`notes/${note.noteId}`);
const resp = await getEtapiResponse(`notes/${note.noteId}`);
expect(resp.status).toEqual(404);
const error = await resp.json();
expect(error.status).toEqual(404);
expect(error.code).toEqual("NOTE_NOT_FOUND");
expect(error.message).toEqual(`Note '${note.noteId}' not found.`);
});
});

View File

@@ -1,43 +0,0 @@
const crypto = require('crypto');
const {
deleteEtapi,
getEtapiResponse,
describeEtapi, postEtapi,
getEtapi,
getEtapiContent,
patchEtapi, putEtapi,
putEtapiContent
} = require("../support/etapi");
const {createTextNote} = require("../support/etapi.js");
describeEtapi("search", () => {
describe('search', () => {
let europe, america;
let austria, czechia;
let usa, canada;
beforeAll(async () => {
europe = await createTextNote(null, 'Europe');
austria = await createTextNote(europe.noteId, 'Austria');
czechia = await createTextNote(europe.noteId, 'Czechia');
america = await createTextNote(null, 'America');
usa = await createTextNote(null, 'USA');
canada = await createTextNote(null, 'Canada');
});
async function search(searchString, params) {
const keyToValues = Object.keys(params).map(key => `${key}=${params[key]}`);
const {results} = await getEtapi(`notes?search=${searchString}&${keyToValues.join('&')}`);
return results;
}
it("search", async () => {
const results = await search('Austria');
expect(results.length).toEqual(0);
});
});
});

View File

@@ -8,8 +8,6 @@ const getEtapiAuthorizationHeader = () => "Basic " + Buffer.from(`etapi:${etapiA
const PORT = '9999';
const HOST = 'http://localhost:' + PORT;
let currentTestRootNote = null;
function describeEtapi(description, specDefinitions) {
describe(description, () => {
let appProcess;
@@ -44,10 +42,6 @@ function describeEtapi(description, specDefinitions) {
})).json()).authToken;
});
beforeEach(async () => {
currentTestRootNote = await createTextNote('root', "test root");
});
afterAll(() => {
console.log("Attempting to kill the Trilium process as part of the cleanup...");
kill(appProcess.pid, 'SIGKILL', () => { console.log("Trilium process killed.") });
@@ -57,30 +51,6 @@ function describeEtapi(description, specDefinitions) {
});
}
async function createTextNote(parentNoteId = null, title = 'new note', content = '') {
if (!parentNoteId) {
parentNoteId = currentTestRootNote.noteId;
}
const {note} = await postEtapi('create-note', {
parentNoteId,
type: 'text',
title,
content
});
return note;
}
async function createLabel(noteId, name, value = '', isInheritable = false) {
return await postEtapi('attributes', {
type: 'label',
name,
value,
isInheritable
});
}
async function getEtapiResponse(url) {
return await fetch(`${HOST}/etapi/${url}`, {
method: 'GET',
@@ -202,9 +172,6 @@ function checkStatus(response) {
module.exports = {
describeEtapi,
createTextNote,
createLabel,
getCurrentTestRootNote: () => currentTestRootNote,
getEtapi,
getEtapiResponse,
getEtapiContent,

View File

@@ -117,14 +117,14 @@ async function renderCode(note, $renderedContent) {
}
function renderImage(entity, $renderedContent, options = {}) {
const sanitizedTitle = entity.title.replace(/[^a-z0-9-.]/gi, "");
const encodedTitle = encodeURIComponent(entity.title);
let url;
if (entity instanceof FNote) {
url = `api/images/${entity.noteId}/${sanitizedTitle}?${Math.random()}`;
url = `api/images/${entity.noteId}/${encodedTitle}?${Math.random()}`;
} else if (entity instanceof FAttachment) {
url = `api/attachments/${entity.attachmentId}/image/${sanitizedTitle}?${entity.utcDateModified}">`;
url = `api/attachments/${entity.attachmentId}/image/${encodedTitle}?${entity.utcDateModified}">`;
}
$renderedContent // styles needed for the zoom to work well

View File

@@ -42,6 +42,7 @@ async function createLink(notePath, options = {}) {
const showNotePath = options.showNotePath === undefined ? false : options.showNotePath;
const showNoteIcon = options.showNoteIcon === undefined ? false : options.showNoteIcon;
const referenceLink = options.referenceLink === undefined ? false : options.referenceLink;
const autoConvertToImage = options.autoConvertToImage === undefined ? false : options.autoConvertToImage;
const { noteId, parentNoteId } = treeService.getNoteIdAndParentIdFromUrl(notePath);
const viewScope = options.viewScope || {};
@@ -58,6 +59,16 @@ async function createLink(notePath, options = {}) {
}
}
const note = await froca.getNote(noteId);
if (autoConvertToImage && ['image', 'canvas', 'mermaid'].includes(note.type) && viewMode === 'default') {
const encodedTitle = encodeURIComponent(linkTitle);
return $("<img>")
.attr("src", `api/images/${noteId}/${encodedTitle}?${Math.random()}`)
.attr("alt", linkTitle);
}
const $container = $("<span>");
if (showNoteIcon) {

View File

@@ -97,7 +97,7 @@ export default class IncludeNoteDialog extends BasicWidget {
const boxSize = $("input[name='include-note-box-size']:checked").val();
if (note.type === 'image') {
if (['image', 'canvas', 'mermaid'].includes(note.type)) {
// there's no benefit to use insert note functionlity for images,
// so we'll just add an IMG tag
this.textTypeWidget.addImage(noteId);

View File

@@ -274,16 +274,16 @@ export default class RevisionsDialog extends BasicWidget {
this.$content.html($table);
} else if (revisionItem.type === 'canvas') {
const sanitizedTitle = revisionItem.title.replace(/[^a-z0-9-.]/gi, "");
const encodedTitle = encodeURIComponent(revisionItem.title);
this.$content.html($("<img>")
.attr("src", `api/revisions/${revisionItem.revisionId}/image/${sanitizedTitle}?${Math.random()}`)
.attr("src", `api/revisions/${revisionItem.revisionId}/image/${encodedTitle}?${Math.random()}`)
.css("max-width", "100%"));
} else if (revisionItem.type === 'mermaid') {
const sanitizedTitle = revisionItem.title.replace(/[^a-z0-9-.]/gi, "");
const encodedTitle = encodeURIComponent(revisionItem.title);
this.$content.html($("<img>")
.attr("src", `api/revisions/${revisionItem.revisionId}/image/${sanitizedTitle}?${Math.random()}`)
.attr("src", `api/revisions/${revisionItem.revisionId}/image/${encodedTitle}?${Math.random()}`)
.css("max-width", "100%"));
this.$content.append($("<pre>").text(fullRevision.content));

View File

@@ -402,11 +402,11 @@ export default class NoteTreeWidget extends NoteContextAwareWidget {
}));
if (notes.length === 1) {
linkService.createLink(notes[0].noteId, {referenceLink: true})
linkService.createLink(notes[0].noteId, {referenceLink: true, autoConvertToImage: true})
.then($link => data.dataTransfer.setData("text/html", $link[0].outerHTML));
}
else {
Promise.all(notes.map(note => linkService.createLink(note.noteId, {referenceLink: true}))).then(links => {
Promise.all(notes.map(note => linkService.createLink(note.noteId, {referenceLink: true, autoConvertToImage: true}))).then(links => {
const $list = $("<ul>").append(...links.map($link => $("<li>").append($link)));
data.dataTransfer.setData("text/html", $list[0].outerHTML);

View File

@@ -365,12 +365,10 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
const note = await froca.getNote(noteId);
this.watchdog.editor.model.change( writer => {
const sanitizedTitle = note.title.replace(/[^a-z0-9-.]/gi, "");
const src = `api/images/${note.noteId}/${sanitizedTitle}`;
const encodedTitle = encodeURIComponent(note.title);
const src = `api/images/${note.noteId}/${encodedTitle}`;
const imageElement = writer.createElement( 'image', { 'src': src } );
this.watchdog.editor.model.insertContent(imageElement, this.watchdog.editor.model.document.selection);
this.watchdog.editor.execute( 'insertImage', { source: src } );
} );
}

View File

@@ -153,8 +153,9 @@ function processContent(images, note, content) {
const buffer = Buffer.from(dataUrl.split(",")[1], 'base64');
const attachment = imageService.saveImageToAttachment(note.noteId, buffer, filename, true);
const sanitizedTitle = attachment.title.replace(/[^a-z0-9-.]/gi, "");
const url = `api/attachments/${attachment.attachmentId}/image/${sanitizedTitle}`;
const encodedTitle = encodeURIComponent(attachment.title);
const url = `api/attachments/${attachment.attachmentId}/image/${encodedTitle}`;
log.info(`Replacing '${imageId}' with '${url}' in note '${note.noteId}'`);

View File

@@ -8,6 +8,7 @@ const cls = require('../../services/cls');
const path = require('path');
const becca = require("../../becca/becca");
const blobService = require("../../services/blob");
const eraseService = require("../../services/erase.js");
function getRevisionBlob(req) {
const preview = req.query.preview === 'true';
@@ -88,11 +89,11 @@ function eraseAllRevisions(req) {
const revisionIdsToErase = sql.getColumn('SELECT revisionId FROM revisions WHERE noteId = ?',
[req.params.noteId]);
revisionService.eraseRevisions(revisionIdsToErase);
eraseService.eraseRevisions(revisionIdsToErase);
}
function eraseRevision(req) {
revisionService.eraseRevisions([req.params.revisionId]);
eraseService.eraseRevisions([req.params.revisionId]);
}
function restoreRevision(req) {

View File

@@ -1 +1 @@
module.exports = { buildDate:"2023-11-21T20:49:24+01:00", buildRevision: "e2b1421bf3d764ffe444a103c118e67d8c563673" };
module.exports = { buildDate:"2023-12-07T00:03:59+01:00", buildRevision: "2e23c521c356c2305124f5df0f474532fa5f34ce" };

View File

@@ -4,6 +4,7 @@ const becca = require("../becca/becca");
const cloningService = require("./cloning");
const branchService = require("./branches");
const utils = require("./utils");
const eraseService = require("./erase.js");
const ACTION_HANDLERS = {
addLabel: (action, note) => {
@@ -18,7 +19,7 @@ const ACTION_HANDLERS = {
note.deleteNote(deleteId);
},
deleteRevisions: (action, note) => {
revisionService.eraseRevisions(note.getRevisions().map(rev => rev.revisionId));
eraseService.eraseRevisions(note.getRevisions().map(rev => rev.revisionId));
},
deleteLabel: (action, note) => {
for (const label of note.getOwnedLabels(action.labelName)) {

View File

@@ -467,7 +467,7 @@ class ConsistencyChecks {
WHERE blobs.blobId IS NULL`,
({revisionId, blobId}) => {
if (this.autoFix) {
revisionService.eraseRevisions([revisionId]);
eraseService.eraseRevisions([revisionId]);
this.reloadNeeded = true;

View File

@@ -29,7 +29,7 @@ function eraseNotes(noteIdsToErase) {
const revisionIdsToErase = sql.getManyRows(`SELECT revisionId FROM revisions WHERE noteId IN (???)`, noteIdsToErase)
.map(row => row.revisionId);
revisionService.eraseRevisions(revisionIdsToErase);
eraseRevisions(revisionIdsToErase);
log.info(`Erased notes: ${JSON.stringify(noteIdsToErase)}`);
}
@@ -79,6 +79,18 @@ function eraseAttachments(attachmentIdsToErase) {
log.info(`Erased attachments: ${JSON.stringify(attachmentIdsToErase)}`);
}
function eraseRevisions(revisionIdsToErase) {
if (revisionIdsToErase.length === 0) {
return;
}
sql.executeMany(`DELETE FROM revisions WHERE revisionId IN (???)`, revisionIdsToErase);
setEntityChangesAsErased(sql.getManyRows(`SELECT * FROM entity_changes WHERE entityName = 'revisions' AND entityId IN (???)`, revisionIdsToErase));
log.info(`Removed revisions: ${JSON.stringify(revisionIdsToErase)}`);
}
function eraseUnusedBlobs() {
const unusedBlobIds = sql.getColumn(`
SELECT blobs.blobId
@@ -184,5 +196,6 @@ module.exports = {
eraseUnusedAttachmentsNow,
eraseNotesWithDeleteId,
eraseUnusedBlobs,
eraseAttachments
eraseAttachments,
eraseRevisions
};

View File

@@ -303,8 +303,8 @@ function importEnex(taskContext, file, parentNote) {
const attachment = imageService.saveImageToAttachment(noteEntity.noteId, resource.content, originalName, taskContext.data.shrinkImages);
const sanitizedTitle = attachment.title.replace(/[^a-z0-9-.]/gi, "");
const url = `api/attachments/${attachment.attachmentId}/image/${sanitizedTitle}`;
const encodedTitle = encodeURIComponent(attachment.title);
const url = `api/attachments/${attachment.attachmentId}/image/${encodedTitle}`;
const imageLink = `<img src="${url}">`;
content = content.replace(mediaRegex, imageLink);

View File

@@ -529,9 +529,9 @@ function downloadImages(noteId, content) {
const imageService = require('../services/image');
const attachment = imageService.saveImageToAttachment(noteId, imageBuffer, "inline image", true, true);
const sanitizedTitle = attachment.title.replace(/[^a-z0-9-.]/gi, "");
const encodedTitle = encodeURIComponent(attachment.title);
content = `${content.substr(0, imageMatch.index)}<img src="api/attachments/${attachment.attachmentId}/image/${sanitizedTitle}"${content.substr(imageMatch.index + imageMatch[0].length)}`;
content = `${content.substr(0, imageMatch.index)}<img src="api/attachments/${attachment.attachmentId}/image/${encodedTitle}"${content.substr(imageMatch.index + imageMatch[0].length)}`;
}
else if (!url.includes('api/images/') && !/api\/attachments\/.+\/image\/?.*/.test(url)
// this is an exception for the web clipper's "imageId"

View File

@@ -46,18 +46,6 @@ function protectRevisions(note) {
}
}
function eraseRevisions(revisionIdsToErase) {
if (revisionIdsToErase.length === 0) {
return;
}
log.info(`Removing revisions: ${JSON.stringify(revisionIdsToErase)}`);
sql.executeMany(`DELETE FROM revisions WHERE revisionId IN (???)`, revisionIdsToErase);
sql.executeMany(`UPDATE entity_changes SET isErased = 1, utcDateChanged = '${dateUtils.utcNowDateTime()}' WHERE entityName = 'revisions' AND entityId IN (???)`, revisionIdsToErase);
}
module.exports = {
protectRevisions,
eraseRevisions
protectRevisions
};

View File

@@ -63,6 +63,8 @@ function isElectron() {
}
function hash(text) {
text = text.normalize();
return crypto.createHash('sha1').update(text).digest('base64');
}