Skip to content

Build your personal knowledge base with Trilium Notes

Merge branch 'feature/typescript_backend' into feature/typescript_backend_2

Elian Dorandb2b33704f02
diff --cc db/migrations/0220__migrate_images_to_attachments.js
index 7c1076f643,a9b2bfdbf6..f88894820f
--- a/db/migrations/0220__migrate_images_to_attachments.js
+++ b/db/migrations/0220__migrate_images_to_attachments.js
@@@ -1,6 -1,6 +1,6 @@@
module.exports = () => {
- const beccaLoader = require('../../src/becca/becca_loader.js');
+ const beccaLoader = require('../../src/becca/becca_loader');
- const becca = require('../../src/becca/becca.js');
+ const becca = require('../../src/becca/becca');
const cls = require('../../src/services/cls');
const log = require('../../src/services/log');
const sql = require('../../src/services/sql');
diff --cc src/becca/entities/abstract_becca_entity.ts
index bc7d3f06be,1c775b51eb..8b30d2b647
--- a/src/becca/entities/abstract_becca_entity.ts
+++ b/src/becca/entities/abstract_becca_entity.ts
@@@ -32,12 -38,11 +38,12 @@@ abstract class AbstractBeccaEntity<T ex
protected utcDateModified?: string;
protected dateCreated?: string;
protected dateModified?: string;
- protected isSynced?: boolean;
-
- protected blobId?: string;
+
+ utcDateCreated!: string;
+
isProtected?: boolean;
+ isSynced?: boolean;
+ blobId?: string;
protected beforeSaving() {
const constructorData = (this.constructor as unknown as ConstructorData<T>);
diff --cc src/becca/entities/battachment.ts
index be703886c1,206c032865..c048c9ed6f
--- a/src/becca/entities/battachment.ts
+++ b/src/becca/entities/battachment.ts
@@@ -126,11 -127,11 +127,11 @@@ class BAttachment extends AbstractBecca
}
}
- getContent(): string | Buffer {
- return this._getContent();
+ getContent(): Buffer {
+ return this._getContent() as Buffer;
}
- setContent(content: any, opts: ContentOpts) {
+ setContent(content: string | Buffer, opts: ContentOpts) {
this._setContent(content, opts);
}
diff --cc src/becca/similarity.ts
index 4aab75ab3d,07f643a7d6..600e6dc2b8
--- a/src/becca/similarity.ts
+++ b/src/becca/similarity.ts
@@@ -33,17 -32,10 +33,17 @@@ const IGNORED_ATTR_NAMES =
"pageurl",
];
-function filterUrlValue(value) {
+interface DateLimits {
+ minDate: string;
+ minExcludedDate: string;
+ maxExcludedDate: string;
+ maxDate: string;
+}
+
+function filterUrlValue(value: string) {
return value
.replace(/https?:\/\//ig, "")
- .replace(/www\./ig, "")
+ .replace(/www.js\./ig, "")
.replace(/(\.net|\.com|\.org|\.info|\.edu)/ig, "");
}
diff --cc src/services/build.ts
index 3f2f1a762e,0000000000..b392adba08
mode 100644,000000..100644
--- a/src/services/build.ts
+++ b/src/services/build.ts
@@@ -1,1 -1,0 +1,1 @@@
- export = { buildDate:"2024-01-21T23:49:23+01:00", buildRevision: "4f8073daa7cff1b8b6737ae45792b2e87c2adf33" };
++export = { buildDate:"2024-03-28T07:11:39+01:00", buildRevision: "399458b52f250b22be22d980a78de0b3390d7521" };
diff --cc tsconfig.json
index bfe575059e,0ce95ff398..31aa526d23
--- a/tsconfig.json
+++ b/tsconfig.json
@@@ -3,12 -3,10 +3,12 @@@
"moduleResolution": "Node",
"declaration": false,
"sourceMap": true,
- "outDir": "./build",
+ "outDir": "./dist",
"strict": true,
"noImplicitAny": true,
- "lib": ["ES2022"]
+ "resolveJsonModule": true,
- "lib": ["ES2021"],
++ "lib": ["ES2022"],
+ "downlevelIteration": true
},
"include": [
"./src/**/*.js",