diff --git a/.gitignore b/.gitignore
index cf2fa89dd..ecb8c9edf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,4 +43,6 @@ apps/*/out
upload
.rollup.cache
-*.tsbuildinfo
\ No newline at end of file
+*.tsbuildinfo
+
+/result
\ No newline at end of file
diff --git a/README.md b/README.md
index ce0b930bc..f62084f7d 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ See [screenshots](https://triliumnext.github.io/Docs/Wiki/screenshot-tour) for q
* [Evernote](https://triliumnext.github.io/Docs/Wiki/evernote-import) and [Markdown import & export](https://triliumnext.github.io/Docs/Wiki/markdown)
* [Web Clipper](https://triliumnext.github.io/Docs/Wiki/web-clipper) for easy saving of web content
* Customizable UI (sidebar buttons, user-defined widgets, ...)
+* [Metrics](./docs/User%20Guide/User%20Guide/Advanced%20Usage/Metrics.md), along with a [Grafana Dashboard](./docs/User%20Guide/User%20Guide/Advanced%20Usage/Metrics/grafana-dashboard.json)
✨ Check out the following third-party resources/communities for more TriliumNext related goodies:
diff --git a/_regroup/package.json b/_regroup/package.json
index 80e210e1d..2157ad9df 100644
--- a/_regroup/package.json
+++ b/_regroup/package.json
@@ -40,8 +40,8 @@
"@types/express": "5.0.1",
"@types/node": "22.15.29",
"@types/yargs": "17.0.33",
- "@vitest/coverage-v8": "3.1.4",
- "eslint": "9.27.0",
+ "@vitest/coverage-v8": "3.2.1",
+ "eslint": "9.28.0",
"eslint-plugin-simple-import-sort": "12.1.1",
"esm": "3.2.25",
"jsdoc": "4.0.4",
diff --git a/_regroup/test-etapi/_login.http b/_regroup/test-etapi/_login.http
deleted file mode 100644
index 9976e7cd4..000000000
--- a/_regroup/test-etapi/_login.http
+++ /dev/null
@@ -1,12 +0,0 @@
-POST {{triliumHost}}/etapi/auth/login
-Content-Type: application/json
-
-{
- "password": "1234"
-}
-
-> {%
- client.assert(response.status === 201);
-
- client.global.set("authToken", response.body.authToken);
-%}
diff --git a/_regroup/test-etapi/api-metrics.http b/_regroup/test-etapi/api-metrics.http
deleted file mode 100644
index 78aee7217..000000000
--- a/_regroup/test-etapi/api-metrics.http
+++ /dev/null
@@ -1,43 +0,0 @@
-### Test regular API metrics endpoint (requires session authentication)
-
-### Get metrics from regular API (default Prometheus format)
-GET {{triliumHost}}/api/metrics
-
-> {%
-client.test("API metrics endpoint returns Prometheus format by default", function() {
- client.assert(response.status === 200, "Response status is not 200");
- client.assert(response.headers["content-type"].includes("text/plain"), "Content-Type should be text/plain");
- client.assert(response.body.includes("trilium_info"), "Should contain trilium_info metric");
- client.assert(response.body.includes("trilium_notes_total"), "Should contain trilium_notes_total metric");
- client.assert(response.body.includes("# HELP"), "Should contain HELP comments");
- client.assert(response.body.includes("# TYPE"), "Should contain TYPE comments");
-});
-%}
-
-### Get metrics in JSON format
-GET {{triliumHost}}/api/metrics?format=json
-
-> {%
-client.test("API metrics endpoint returns JSON when requested", function() {
- client.assert(response.status === 200, "Response status is not 200");
- client.assert(response.headers["content-type"].includes("application/json"), "Content-Type should be application/json");
- client.assert(response.body.version, "Version info not present");
- client.assert(response.body.database, "Database info not present");
- client.assert(response.body.timestamp, "Timestamp not present");
- client.assert(typeof response.body.database.totalNotes === 'number', "Total notes should be a number");
- client.assert(typeof response.body.database.activeNotes === 'number', "Active notes should be a number");
- client.assert(response.body.noteTypes, "Note types breakdown not present");
- client.assert(response.body.attachmentTypes, "Attachment types breakdown not present");
- client.assert(response.body.statistics, "Statistics not present");
-});
-%}
-
-### Test invalid format parameter
-GET {{triliumHost}}/api/metrics?format=xml
-
-> {%
-client.test("Invalid format parameter returns error", function() {
- client.assert(response.status === 500, "Response status should be 500");
- client.assert(response.body.message.includes("prometheus"), "Error message should mention supported formats");
-});
-%}
\ No newline at end of file
diff --git a/_regroup/test-etapi/app-info.http b/_regroup/test-etapi/app-info.http
deleted file mode 100644
index a851005c2..000000000
--- a/_regroup/test-etapi/app-info.http
+++ /dev/null
@@ -1,7 +0,0 @@
-GET {{triliumHost}}/etapi/app-info
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.clipperProtocolVersion === "1.0");
-%}
diff --git a/_regroup/test-etapi/basic-auth.http b/_regroup/test-etapi/basic-auth.http
deleted file mode 100644
index cf79c357e..000000000
--- a/_regroup/test-etapi/basic-auth.http
+++ /dev/null
@@ -1,21 +0,0 @@
-GET {{triliumHost}}/etapi/app-info
-Authorization: Basic etapi {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.clipperProtocolVersion === "1.0");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/app-info
-Authorization: Basic etapi wrong
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/app-info
-Authorization: Basic wrong {{authToken}}
-
-> {% client.assert(response.status === 401); %}
diff --git a/_regroup/test-etapi/create-backup.http b/_regroup/test-etapi/create-backup.http
deleted file mode 100644
index 59ffbebc4..000000000
--- a/_regroup/test-etapi/create-backup.http
+++ /dev/null
@@ -1,4 +0,0 @@
-PUT {{triliumHost}}/etapi/backup/etapi_test
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 201); %}
diff --git a/_regroup/test-etapi/create-entities.http b/_regroup/test-etapi/create-entities.http
deleted file mode 100644
index 98dae28b1..000000000
--- a/_regroup/test-etapi/create-entities.http
+++ /dev/null
@@ -1,158 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "forcedId{{$randomInt}}",
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!",
- "dateCreated": "2023-08-21 23:38:51.123+0200",
- "utcDateCreated": "2023-08-21 23:38:51.123Z"
-}
-
-> {%
- client.assert(response.status === 201);
- client.assert(response.body.note.noteId.startsWith("forcedId"));
- client.assert(response.body.note.title == "Hello");
- client.assert(response.body.note.dateCreated == "2023-08-21 23:38:51.123+0200");
- client.assert(response.body.note.utcDateCreated == "2023-08-21 23:38:51.123Z");
- client.assert(response.body.branch.parentNoteId == "root");
-
- client.log(`Created note ` + response.body.note.noteId + ` and branch ` + response.body.branch.branchId);
-
- client.global.set("createdNoteId", response.body.note.noteId);
- client.global.set("createdBranchId", response.body.branch.branchId);
-%}
-
-### Clone to another location
-
-POST {{triliumHost}}/etapi/branches
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{createdNoteId}}",
- "parentNoteId": "_hidden"
-}
-
-> {%
- client.assert(response.status === 201);
- client.assert(response.body.parentNoteId == "_hidden");
-
- client.global.set("clonedBranchId", response.body.branchId);
-
- client.log(`Created cloned branch ` + response.body.branchId);
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.noteId == client.global.get("createdNoteId"));
- client.assert(response.body.title == "Hello");
- // order is not defined and may fail in the future
- client.assert(response.body.parentBranchIds[0] == client.global.get("clonedBranchId"))
- client.assert(response.body.parentBranchIds[1] == client.global.get("createdBranchId"));
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body == "Hi there!");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.branchId == client.global.get("createdBranchId"));
- client.assert(response.body.parentNoteId == "root");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.branchId == client.global.get("clonedBranchId"));
- client.assert(response.body.parentNoteId == "_hidden");
-%}
-
-###
-
-POST {{triliumHost}}/etapi/attributes
-Content-Type: application/json
-Authorization: {{authToken}}
-
-{
- "attributeId": "forcedAttributeId{{$randomInt}}",
- "noteId": "{{createdNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": true
-}
-
-> {%
- client.assert(response.status === 201);
- client.assert(response.body.attributeId.startsWith("forcedAttributeId"));
-
- client.global.set("createdAttributeId", response.body.attributeId);
-%}
-
-###
-
-GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.attributeId == client.global.get("createdAttributeId"));
-%}
-
-###
-
-POST {{triliumHost}}/etapi/attachments
-Content-Type: application/json
-Authorization: {{authToken}}
-
-{
- "ownerId": "{{createdNoteId}}",
- "role": "file",
- "mime": "plain/text",
- "title": "my attachment",
- "content": "my text"
-}
-
-> {%
- client.assert(response.status === 201);
-
- client.global.set("createdAttachmentId", response.body.attachmentId);
-%}
-
-###
-
-GET {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body.attachmentId == client.global.get("createdAttachmentId"));
- client.assert(response.body.role == "file");
- client.assert(response.body.mime == "plain/text");
- client.assert(response.body.title == "my attachment");
-%}
diff --git a/_regroup/test-etapi/delete-attachment.http b/_regroup/test-etapi/delete-attachment.http
deleted file mode 100644
index d12e8de43..000000000
--- a/_regroup/test-etapi/delete-attachment.http
+++ /dev/null
@@ -1,52 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-POST {{triliumHost}}/etapi/attachments
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "ownerId": "{{createdNoteId}}",
- "role": "file",
- "mime": "text/plain",
- "title": "my attachment",
- "content": "text"
-}
-
-> {% client.global.set("createdAttachmentId", response.body.attachmentId); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-### repeat the DELETE request to test the idempotency
-
-DELETE {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-###
-
-GET {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code === "ATTACHMENT_NOT_FOUND");
-%}
diff --git a/_regroup/test-etapi/delete-attribute.http b/_regroup/test-etapi/delete-attribute.http
deleted file mode 100644
index d61b75ba2..000000000
--- a/_regroup/test-etapi/delete-attribute.http
+++ /dev/null
@@ -1,52 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-POST {{triliumHost}}/etapi/attributes
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{createdNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": true
-}
-
-> {% client.global.set("createdAttributeId", response.body.attributeId); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-### repeat the DELETE request to test the idempotency
-
-DELETE {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-###
-
-GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code === "ATTRIBUTE_NOT_FOUND");
-%}
diff --git a/_regroup/test-etapi/delete-cloned-branch.http b/_regroup/test-etapi/delete-cloned-branch.http
deleted file mode 100644
index a87a6fa4d..000000000
--- a/_regroup/test-etapi/delete-cloned-branch.http
+++ /dev/null
@@ -1,87 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
- client.global.set("createdNoteId", response.body.note.noteId);
- client.global.set("createdBranchId", response.body.branch.branchId);
-%}
-
-### Clone to another location
-
-POST {{triliumHost}}/etapi/branches
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{createdNoteId}}",
- "parentNoteId": "_hidden"
-}
-
-> {% client.global.set("clonedBranchId", response.body.branchId); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-### repeat the DELETE request to test the idempotency
-
-DELETE {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code === "BRANCH_NOT_FOUND");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
diff --git a/_regroup/test-etapi/delete-note-with-all-branches.http b/_regroup/test-etapi/delete-note-with-all-branches.http
deleted file mode 100644
index 5a50bc4a9..000000000
--- a/_regroup/test-etapi/delete-note-with-all-branches.http
+++ /dev/null
@@ -1,126 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
- client.global.set("createdNoteId", response.body.note.noteId);
- client.global.set("createdBranchId", response.body.branch.branchId);
-%}
-
-###
-
-POST {{triliumHost}}/etapi/attributes
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{createdNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": true
-}
-
-> {% client.global.set("createdAttributeId", response.body.attributeId); %}
-
-### Clone to another location
-
-POST {{triliumHost}}/etapi/branches
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{createdNoteId}}",
- "parentNoteId": "_hidden"
-}
-
-> {% client.global.set("clonedBranchId", response.body.branchId); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-### repeat the DELETE request to test the idempotency
-
-DELETE {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 204, "Response status is not 204"); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code === "BRANCH_NOT_FOUND");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{clonedBranchId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code == "BRANCH_NOT_FOUND");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code === "NOTE_NOT_FOUND");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 404, "Response status is not 404");
- client.assert(response.body.code === "ATTRIBUTE_NOT_FOUND");
-%}
diff --git a/_regroup/test-etapi/export-note-subtree.http b/_regroup/test-etapi/export-note-subtree.http
deleted file mode 100644
index 28d90a362..000000000
--- a/_regroup/test-etapi/export-note-subtree.http
+++ /dev/null
@@ -1,37 +0,0 @@
-GET {{triliumHost}}/etapi/notes/root/export
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.headers.valueOf("Content-Type") == "application/zip");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/root/export?format=html
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.headers.valueOf("Content-Type") == "application/zip");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/root/export?format=markdown
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.headers.valueOf("Content-Type") == "application/zip");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/root/export?format=wrong
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code === "UNRECOGNIZED_EXPORT_FORMAT");
-%}
diff --git a/_regroup/test-etapi/get-date-notes.http b/_regroup/test-etapi/get-date-notes.http
deleted file mode 100644
index 19f0b4fc9..000000000
--- a/_regroup/test-etapi/get-date-notes.http
+++ /dev/null
@@ -1,72 +0,0 @@
-GET {{triliumHost}}/etapi/inbox/2022-01-01
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/days/2022-01-01
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/days/2022-1
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code === "DATE_INVALID");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/weeks/2022-01-01
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/weeks/2022-1
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code === "DATE_INVALID");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/months/2022-01
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/months/2022-1
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code === "MONTH_INVALID");
-%}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/years/2022
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/years/202
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code === "YEAR_INVALID");
-%}
diff --git a/_regroup/test-etapi/get-inherited-attribute-cloned.http b/_regroup/test-etapi/get-inherited-attribute-cloned.http
deleted file mode 100644
index eaf8d91b1..000000000
--- a/_regroup/test-etapi/get-inherited-attribute-cloned.http
+++ /dev/null
@@ -1,116 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello parent",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
-client.assert(response.status === 201);
-client.global.set("parentNoteId", response.body.note.noteId);
-client.global.set("parentBranchId", response.body.branch.branchId);
-%}
-
-### Create inheritable parent attribute
-
-POST {{triliumHost}}/etapi/attributes
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{parentNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "",
- "isInheritable": true,
- "position": 10
-}
-
-> {%
-client.assert(response.status === 201);
-client.global.set("parentAttributeId", response.body.attributeId);
-%}
-
-### Create child note under root
-
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello child",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
-client.assert(response.status === 201);
-client.global.set("childNoteId", response.body.note.noteId);
-client.global.set("childBranchId", response.body.branch.branchId);
-%}
-
-### Create child attribute
-
-POST {{triliumHost}}/etapi/attributes
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{childNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": false,
- "position": 10
-}
-
-> {%
-client.assert(response.status === 201);
-client.global.set("childAttributeId", response.body.attributeId);
-%}
-
-### Clone child to parent
-
-POST {{triliumHost}}/etapi/branches
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{childNoteId}}",
- "parentNoteId": "{{parentNoteId}}"
-}
-
-> {%
-client.assert(response.status === 201);
-client.assert(response.body.parentNoteId == client.global.get("parentNoteId"));
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{childNoteId}}
-Authorization: {{authToken}}
-
-> {%
-
-function hasAttribute(list, attributeId) {
- for (let i = 0; i < list.length; i++) {
- if (list[i]["attributeId"] === attributeId) {
- return true;
- }
- }
- return false;
-}
-
-client.log(JSON.stringify(response.body.attributes));
-
-client.assert(response.status === 200);
-client.assert(response.body.noteId == client.global.get("childNoteId"));
-client.assert(response.body.attributes.length == 2);
-client.assert(hasAttribute(response.body.attributes, client.global.get("parentAttributeId")));
-client.assert(hasAttribute(response.body.attributes, client.global.get("childAttributeId")));
-%}
diff --git a/_regroup/test-etapi/get-inherited-attribute.http b/_regroup/test-etapi/get-inherited-attribute.http
deleted file mode 100644
index 26e9af854..000000000
--- a/_regroup/test-etapi/get-inherited-attribute.http
+++ /dev/null
@@ -1,61 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "GetInheritedAttributes Test Note",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
- client.assert(response.status === 201);
- client.global.set("parentNoteId", response.body.note.noteId);
-%}
-
-###
-
-POST {{triliumHost}}/etapi/attributes
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{parentNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": true
-}
-
-> {% client.global.set("createdAttributeId", response.body.attributeId); %}
-
-###
-
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "{{parentNoteId}}",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
-client.global.set("createdNoteId", response.body.note.noteId);
-client.global.set("createdBranchId", response.body.branch.branchId);
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.status === 200);
-client.assert(response.body.noteId == client.global.get("createdNoteId"));
-client.assert(response.body.attributes.length == 1);
-client.assert(response.body.attributes[0].attributeId == client.global.get("createdAttributeId"));
-%}
diff --git a/_regroup/test-etapi/get-note-content.http b/_regroup/test-etapi/get-note-content.http
deleted file mode 100644
index 50c677dd8..000000000
--- a/_regroup/test-etapi/get-note-content.http
+++ /dev/null
@@ -1,25 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
- client.global.set("createdNoteId", response.body.note.noteId);
- client.global.set("createdBranchId", response.body.branch.branchId);
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.status === 200);
- client.assert(response.body === "Hi there!");
-%}
diff --git a/_regroup/test-etapi/http-client.env.json b/_regroup/test-etapi/http-client.env.json
deleted file mode 100644
index 8ede0719c..000000000
--- a/_regroup/test-etapi/http-client.env.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "dev": {
- "triliumHost": "http://localhost:37740"
- }
-}
diff --git a/_regroup/test-etapi/import-zip.http b/_regroup/test-etapi/import-zip.http
deleted file mode 100644
index e831a050a..000000000
--- a/_regroup/test-etapi/import-zip.http
+++ /dev/null
@@ -1,12 +0,0 @@
-POST {{triliumHost}}/etapi/notes/root/import
-Authorization: {{authToken}}
-Content-Type: application/octet-stream
-Content-Transfer-Encoding: binary
-
-< ../db/demo.zip
-
-> {%
- client.assert(response.status === 201);
- client.assert(response.body.note.title == "Trilium Demo");
- client.assert(response.body.branch.parentNoteId == "root");
-%}
diff --git a/_regroup/test-etapi/logout.http b/_regroup/test-etapi/logout.http
deleted file mode 100644
index 9bd7355e0..000000000
--- a/_regroup/test-etapi/logout.http
+++ /dev/null
@@ -1,34 +0,0 @@
-POST {{triliumHost}}/etapi/auth/login
-Content-Type: application/json
-
-{
- "password": "1234"
-}
-
-> {%
- client.assert(response.status === 201);
-
- client.global.set("testAuthToken", response.body.authToken);
-%}
-
-###
-
-GET {{triliumHost}}/etapi/notes/root
-Authorization: {{testAuthToken}}
-
-> {% client.assert(response.status === 200); %}
-
-###
-
-POST {{triliumHost}}/etapi/auth/logout
-Authorization: {{testAuthToken}}
-Content-Type: application/json
-
-> {% client.assert(response.status === 204); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/root
-Authorization: {{testAuthToken}}
-
-> {% client.assert(response.status === 401); %}
diff --git a/_regroup/test-etapi/metrics.http b/_regroup/test-etapi/metrics.http
deleted file mode 100644
index 24435f954..000000000
--- a/_regroup/test-etapi/metrics.http
+++ /dev/null
@@ -1,82 +0,0 @@
-### Test ETAPI metrics endpoint
-
-# First login to get a token
-POST {{triliumHost}}/etapi/auth/login
-Content-Type: application/json
-
-{
- "password": "{{password}}"
-}
-
-> {%
-client.test("Login successful", function() {
- client.assert(response.status === 201, "Response status is not 201");
- client.assert(response.body.authToken, "Auth token not present");
- client.global.set("authToken", response.body.authToken);
-});
-%}
-
-### Get metrics with authentication (default Prometheus format)
-GET {{triliumHost}}/etapi/metrics
-Authorization: {{authToken}}
-
-> {%
-client.test("Metrics endpoint returns Prometheus format by default", function() {
- client.assert(response.status === 200, "Response status is not 200");
- client.assert(response.headers["content-type"].includes("text/plain"), "Content-Type should be text/plain");
- client.assert(response.body.includes("trilium_info"), "Should contain trilium_info metric");
- client.assert(response.body.includes("trilium_notes_total"), "Should contain trilium_notes_total metric");
- client.assert(response.body.includes("# HELP"), "Should contain HELP comments");
- client.assert(response.body.includes("# TYPE"), "Should contain TYPE comments");
-});
-%}
-
-### Get metrics in JSON format
-GET {{triliumHost}}/etapi/metrics?format=json
-Authorization: {{authToken}}
-
-> {%
-client.test("Metrics endpoint returns JSON when requested", function() {
- client.assert(response.status === 200, "Response status is not 200");
- client.assert(response.headers["content-type"].includes("application/json"), "Content-Type should be application/json");
- client.assert(response.body.version, "Version info not present");
- client.assert(response.body.database, "Database info not present");
- client.assert(response.body.timestamp, "Timestamp not present");
- client.assert(typeof response.body.database.totalNotes === 'number', "Total notes should be a number");
- client.assert(typeof response.body.database.activeNotes === 'number', "Active notes should be a number");
-});
-%}
-
-### Get metrics in Prometheus format explicitly
-GET {{triliumHost}}/etapi/metrics?format=prometheus
-Authorization: {{authToken}}
-
-> {%
-client.test("Metrics endpoint returns Prometheus format when requested", function() {
- client.assert(response.status === 200, "Response status is not 200");
- client.assert(response.headers["content-type"].includes("text/plain"), "Content-Type should be text/plain");
- client.assert(response.body.includes("trilium_info"), "Should contain trilium_info metric");
- client.assert(response.body.includes("trilium_notes_total"), "Should contain trilium_notes_total metric");
-});
-%}
-
-### Test invalid format parameter
-GET {{triliumHost}}/etapi/metrics?format=xml
-Authorization: {{authToken}}
-
-> {%
-client.test("Invalid format parameter returns error", function() {
- client.assert(response.status === 400, "Response status should be 400");
- client.assert(response.body.code === "INVALID_FORMAT", "Error code should be INVALID_FORMAT");
- client.assert(response.body.message.includes("prometheus"), "Error message should mention supported formats");
-});
-%}
-
-### Test without authentication (should fail)
-GET {{triliumHost}}/etapi/metrics
-
-> {%
-client.test("Metrics endpoint requires authentication", function() {
- client.assert(response.status === 401, "Response status should be 401");
-});
-%}
\ No newline at end of file
diff --git a/_regroup/test-etapi/no-token.http b/_regroup/test-etapi/no-token.http
deleted file mode 100644
index d8198ed2b..000000000
--- a/_regroup/test-etapi/no-token.http
+++ /dev/null
@@ -1,109 +0,0 @@
-GET {{triliumHost}}/etapi/notes?search=aaa
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/root
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-PATCH {{triliumHost}}/etapi/notes/root
-Authorization: fakeauth
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/notes/root
-Authorization: fakeauth
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/branches/root
-Authorization: fakeauth
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-PATCH {{triliumHost}}/etapi/branches/root
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/branches/root
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/attributes/000
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-PATCH {{triliumHost}}/etapi/attributes/000
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-DELETE {{triliumHost}}/etapi/attributes/000
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/inbox/2022-02-22
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/days/2022-02-22
-Authorization: fakeauth
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/weeks/2022-02-22
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/months/2022-02
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/calendar/years/2022
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-POST {{triliumHost}}/etapi/create-note
-
-> {% client.assert(response.status === 401); %}
-
-###
-
-GET {{triliumHost}}/etapi/app-info
-
-> {% client.assert(response.status === 401); %}
-
-### Fake URL will get a 404 even without token
-
-GET {{triliumHost}}/etapi/zzzzzz
-
-> {% client.assert(response.status === 404); %}
diff --git a/_regroup/test-etapi/other.http b/_regroup/test-etapi/other.http
deleted file mode 100644
index c3f92fc94..000000000
--- a/_regroup/test-etapi/other.http
+++ /dev/null
@@ -1,4 +0,0 @@
-POST {{triliumHost}}/etapi/refresh-note-ordering/root
-Authorization: {{authToken}}
-
-> {% client.assert(response.status === 200); %}
\ No newline at end of file
diff --git a/_regroup/test-etapi/patch-attachment.http b/_regroup/test-etapi/patch-attachment.http
deleted file mode 100644
index 44ffe696f..000000000
--- a/_regroup/test-etapi/patch-attachment.http
+++ /dev/null
@@ -1,79 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-POST {{triliumHost}}/etapi/attachments
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "ownerId": "{{createdNoteId}}",
- "role": "file",
- "mime": "text/plain",
- "title": "my attachment",
- "content": "text"
-}
-
-> {% client.global.set("createdAttachmentId", response.body.attachmentId); %}
-
-###
-
-PATCH {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "title": "CHANGED",
- "position": 999
-}
-
-###
-
-GET {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-
-> {%
- client.assert(response.body.title === "CHANGED");
- client.assert(response.body.position === 999);
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "ownerId": "root"
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_NOT_ALLOWED");
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "title": null
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_VALIDATION_ERROR");
-%}
diff --git a/_regroup/test-etapi/patch-attribute.http b/_regroup/test-etapi/patch-attribute.http
deleted file mode 100644
index 625c19446..000000000
--- a/_regroup/test-etapi/patch-attribute.http
+++ /dev/null
@@ -1,80 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {%
- client.global.set("createdNoteId", response.body.note.noteId);
- client.global.set("createdBranchId", response.body.branch.branchId);
-%}
-
-###
-
-POST {{triliumHost}}/etapi/attributes
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "{{createdNoteId}}",
- "type": "label",
- "name": "mylabel",
- "value": "val",
- "isInheritable": true
-}
-
-> {% client.global.set("createdAttributeId", response.body.attributeId); %}
-
-###
-
-PATCH {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "value": "CHANGED"
-}
-
-###
-
-GET {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.body.value === "CHANGED");
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "noteId": "root"
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_NOT_ALLOWED");
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/attributes/{{createdAttributeId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "value": null
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_VALIDATION_ERROR");
-%}
\ No newline at end of file
diff --git a/_regroup/test-etapi/patch-branch.http b/_regroup/test-etapi/patch-branch.http
deleted file mode 100644
index 48116120c..000000000
--- a/_regroup/test-etapi/patch-branch.http
+++ /dev/null
@@ -1,66 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "type": "text",
- "title": "Hello",
- "content": ""
-}
-
-> {% client.global.set("createdBranchId", response.body.branch.branchId); %}
-
-###
-
-PATCH {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "prefix": "pref",
- "notePosition": 666,
- "isExpanded": true
-}
-
-###
-
-GET {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.status === 200);
-client.assert(response.body.prefix === 'pref');
-client.assert(response.body.notePosition === 666);
-client.assert(response.body.isExpanded === true);
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root"
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_NOT_ALLOWED");
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/branches/{{createdBranchId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "prefix": 123
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_VALIDATION_ERROR");
-%}
\ No newline at end of file
diff --git a/_regroup/test-etapi/patch-note.http b/_regroup/test-etapi/patch-note.http
deleted file mode 100644
index 24b9251d2..000000000
--- a/_regroup/test-etapi/patch-note.http
+++ /dev/null
@@ -1,83 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "code",
- "mime": "application/json",
- "content": "{}"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.status === 200);
-client.assert(response.body.title === 'Hello');
-client.assert(response.body.type === 'code');
-client.assert(response.body.mime === 'application/json');
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "title": "Wassup",
- "type": "html",
- "mime": "text/html",
- "dateCreated": "2023-08-21 23:38:51.123+0200",
- "utcDateCreated": "2023-08-21 23:38:51.123Z"
-}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.status === 200);
-client.assert(response.body.title === 'Wassup');
-client.assert(response.body.type === 'html');
-client.assert(response.body.mime === 'text/html');
-client.assert(response.body.dateCreated == "2023-08-21 23:38:51.123+0200");
-client.assert(response.body.utcDateCreated == "2023-08-21 23:38:51.123Z");
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "isProtected": true
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_NOT_ALLOWED");
-%}
-
-###
-
-PATCH {{triliumHost}}/etapi/notes/{{createdNoteId}}
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "title": true
-}
-
-> {%
- client.assert(response.status === 400);
- client.assert(response.body.code == "PROPERTY_VALIDATION_ERROR");
-%}
diff --git a/_regroup/test-etapi/post-revision.http b/_regroup/test-etapi/post-revision.http
deleted file mode 100644
index 139397855..000000000
--- a/_regroup/test-etapi/post-revision.http
+++ /dev/null
@@ -1,23 +0,0 @@
-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}}/revision
-Authorization: {{authToken}}
-Content-Type: text/plain
-
-Changed content
-
-> {% client.assert(response.status === 204); %}
diff --git a/_regroup/test-etapi/put-attachment-content-binary.http b/_regroup/test-etapi/put-attachment-content-binary.http
deleted file mode 100644
index 6e6d6dad3..000000000
--- a/_regroup/test-etapi/put-attachment-content-binary.http
+++ /dev/null
@@ -1,39 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-POST {{triliumHost}}/etapi/attachments
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "ownerId": "{{createdNoteId}}",
- "role": "file",
- "mime": "text/plain",
- "title": "my attachment",
- "content": "text"
-}
-
-> {% client.global.set("createdAttachmentId", response.body.attachmentId); %}
-
-###
-
-PUT {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}/content
-Authorization: {{authToken}}
-Content-Type: application/octet-stream
-Content-Transfer-Encoding: binary
-
-< ../images/icon-color.png
-
-> {% client.assert(response.status === 204); %}
diff --git a/_regroup/test-etapi/put-attachment-content.http b/_regroup/test-etapi/put-attachment-content.http
deleted file mode 100644
index 57e96a4b9..000000000
--- a/_regroup/test-etapi/put-attachment-content.http
+++ /dev/null
@@ -1,45 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "text",
- "content": "Hi there!"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-POST {{triliumHost}}/etapi/attachments
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "ownerId": "{{createdNoteId}}",
- "role": "file",
- "mime": "text/plain",
- "title": "my attachment",
- "content": "text"
-}
-
-> {% client.global.set("createdAttachmentId", response.body.attachmentId); %}
-
-###
-
-PUT {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}/content
-Authorization: {{authToken}}
-Content-Type: text/plain
-
-Changed content
-
-> {% client.assert(response.status === 204); %}
-
-###
-
-GET {{triliumHost}}/etapi/attachments/{{createdAttachmentId}}/content
-Authorization: {{authToken}}
-
-> {% client.assert(response.body === "Changed content"); %}
diff --git a/_regroup/test-etapi/put-note-content-binary.http b/_regroup/test-etapi/put-note-content-binary.http
deleted file mode 100644
index 545b3c111..000000000
--- a/_regroup/test-etapi/put-note-content-binary.http
+++ /dev/null
@@ -1,25 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "Hello",
- "type": "image",
- "mime": "image/png",
- "content": ""
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-PUT {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
-Authorization: {{authToken}}
-Content-Type: application/octet-stream
-Content-Transfer-Encoding: binary
-
-< ../images/icon-color.png
-
-> {% client.assert(response.status === 204); %}
-
diff --git a/_regroup/test-etapi/put-note-content.http b/_regroup/test-etapi/put-note-content.http
deleted file mode 100644
index 670195ac2..000000000
--- a/_regroup/test-etapi/put-note-content.http
+++ /dev/null
@@ -1,30 +0,0 @@
-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); %}
-
-###
-
-PUT {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
-Authorization: {{authToken}}
-Content-Type: text/plain
-
-Changed content
-
-> {% client.assert(response.status === 204); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
-Authorization: {{authToken}}
-
-> {% client.assert(response.body === "Changed content"); %}
diff --git a/_regroup/test-etapi/search.http b/_regroup/test-etapi/search.http
deleted file mode 100644
index 4655f22e0..000000000
--- a/_regroup/test-etapi/search.http
+++ /dev/null
@@ -1,39 +0,0 @@
-POST {{triliumHost}}/etapi/create-note
-Authorization: {{authToken}}
-Content-Type: application/json
-
-{
- "parentNoteId": "root",
- "title": "title",
- "type": "text",
- "content": "{{$uuid}}"
-}
-
-> {% client.global.set("createdNoteId", response.body.note.noteId); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes/{{createdNoteId}}/content
-Authorization: {{authToken}}
-
-> {% client.global.set("content", response.body); %}
-
-###
-
-GET {{triliumHost}}/etapi/notes?search={{content}}&debug=true
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.status === 200);
-client.assert(response.body.results.length === 1);
-%}
-
-### Same but with fast search which doesn't look in the content so 0 notes should be found
-
-GET {{triliumHost}}/etapi/notes?search={{content}}&fastSearch=true
-Authorization: {{authToken}}
-
-> {%
-client.assert(response.status === 200);
-client.assert(response.body.results.length === 0);
-%}
diff --git a/apps/client/package.json b/apps/client/package.json
index a1e4c9c6a..752eca730 100644
--- a/apps/client/package.json
+++ b/apps/client/package.json
@@ -10,7 +10,7 @@
"url": "https://github.com/TriliumNext/Notes"
},
"dependencies": {
- "@eslint/js": "9.27.0",
+ "@eslint/js": "9.28.0",
"@excalidraw/excalidraw": "0.18.0",
"@fullcalendar/core": "6.1.17",
"@fullcalendar/daygrid": "6.1.17",
@@ -66,7 +66,7 @@
"@types/react": "19.1.6",
"@types/react-dom": "19.1.5",
"copy-webpack-plugin": "13.0.0",
- "happy-dom": "17.5.6",
+ "happy-dom": "17.6.3",
"script-loader": "0.7.2",
"vite-plugin-static-copy": "3.0.0"
},
diff --git a/apps/client/src/services/froca_updater.ts b/apps/client/src/services/froca_updater.ts
index 1f8eaa541..412d8d6cd 100644
--- a/apps/client/src/services/froca_updater.ts
+++ b/apps/client/src/services/froca_updater.ts
@@ -35,8 +35,8 @@ async function processEntityChanges(entityChanges: EntityChange[]) {
loadResults.addOption(attributeEntity.name);
} else if (ec.entityName === "attachments") {
processAttachment(loadResults, ec);
- } else if (ec.entityName === "blobs" || ec.entityName === "etapi_tokens") {
- // NOOP
+ } else if (ec.entityName === "blobs" || ec.entityName === "etapi_tokens" || ec.entityName === "note_embeddings") {
+ // NOOP - these entities are handled at the backend level and don't require frontend processing
} else {
throw new Error(`Unknown entityName '${ec.entityName}'`);
}
diff --git a/apps/client/src/services/link.spec.ts b/apps/client/src/services/link.spec.ts
index 60812ccf9..09eaf09e7 100644
--- a/apps/client/src/services/link.spec.ts
+++ b/apps/client/src/services/link.spec.ts
@@ -16,4 +16,24 @@ describe("Link", () => {
const output = parseNavigationStateFromUrl(`#root/WWaBNf3SSA1b/mQ2tIzLVFKHL`);
expect(output).toMatchObject({ notePath: "root/WWaBNf3SSA1b/mQ2tIzLVFKHL", noteId: "mQ2tIzLVFKHL" });
});
+
+ it("parses notePath with spaces", () => {
+ const output = parseNavigationStateFromUrl(` #root/WWaBNf3SSA1b/mQ2tIzLVFKHL`);
+ expect(output).toMatchObject({ notePath: "root/WWaBNf3SSA1b/mQ2tIzLVFKHL", noteId: "mQ2tIzLVFKHL" });
+ });
+
+ it("ignores external URL with internal hash anchor", () => {
+ const output = parseNavigationStateFromUrl(`https://en.wikipedia.org/wiki/Bearded_Collie#Health`);
+ expect(output).toMatchObject({});
+ });
+
+ it("ignores malformed but hash-containing external URL", () => {
+ const output = parseNavigationStateFromUrl("https://abc.com/#drop?searchString=firefox");
+ expect(output).toStrictEqual({});
+ });
+
+ it("ignores non-hash internal path", () => {
+ const output = parseNavigationStateFromUrl("/root/abc123");
+ expect(output).toStrictEqual({});
+ });
});
diff --git a/apps/client/src/services/link.ts b/apps/client/src/services/link.ts
index 0425652f6..5fda4fe7c 100644
--- a/apps/client/src/services/link.ts
+++ b/apps/client/src/services/link.ts
@@ -204,11 +204,17 @@ export function parseNavigationStateFromUrl(url: string | undefined) {
return {};
}
+ url = url.trim();
const hashIdx = url.indexOf("#");
if (hashIdx === -1) {
return {};
}
+ // Exclude external links that contain #
+ if (hashIdx !== 0 && !url.includes("/#root") && !url.includes("/#?searchString")) {
+ return {};
+ }
+
const hash = url.substr(hashIdx + 1); // strip also the initial '#'
let [notePath, paramString] = hash.split("?");
diff --git a/apps/client/src/services/load_results.ts b/apps/client/src/services/load_results.ts
index 11f9a1a11..59d201f2b 100644
--- a/apps/client/src/services/load_results.ts
+++ b/apps/client/src/services/load_results.ts
@@ -44,9 +44,17 @@ interface OptionRow {}
interface NoteReorderingRow {}
-interface ContentNoteIdToComponentIdRow {
+interface NoteEmbeddingRow {
+ embedId: string;
noteId: string;
- componentId: string;
+ providerId: string;
+ modelId: string;
+ dimension: number;
+ version: number;
+ dateCreated: string;
+ utcDateCreated: string;
+ dateModified: string;
+ utcDateModified: string;
}
type EntityRowMappings = {
@@ -56,6 +64,7 @@ type EntityRowMappings = {
options: OptionRow;
revisions: RevisionRow;
note_reordering: NoteReorderingRow;
+ note_embeddings: NoteEmbeddingRow;
};
export type EntityRowNames = keyof EntityRowMappings;
diff --git a/apps/client/src/services/server.ts b/apps/client/src/services/server.ts
index e15e3ba88..8207f18ff 100644
--- a/apps/client/src/services/server.ts
+++ b/apps/client/src/services/server.ts
@@ -58,8 +58,11 @@ async function getWithSilentNotFound(url: string, componentId?: string) {
return await call("GET", url, componentId, { silentNotFound: true });
}
-async function get(url: string, componentId?: string) {
- return await call("GET", url, componentId);
+/**
+ * @param raw if `true`, the value will be returned as a string instead of a JavaScript object if JSON, XMLDocument if XML, etc.
+ */
+async function get(url: string, componentId?: string, raw?: boolean) {
+ return await call("GET", url, componentId, { raw });
}
async function post(url: string, data?: unknown, componentId?: string) {
@@ -102,6 +105,8 @@ let maxKnownEntityChangeId = 0;
interface CallOptions {
data?: unknown;
silentNotFound?: boolean;
+ // If `true`, the value will be returned as a string instead of a JavaScript object if JSON, XMLDocument if XML, etc.
+ raw?: boolean;
}
async function call(method: string, url: string, componentId?: string, options: CallOptions = {}) {
@@ -132,7 +137,7 @@ async function call(method: string, url: string, componentId?: string, option
});
})) as any;
} else {
- resp = await ajax(url, method, data, headers, !!options.silentNotFound);
+ resp = await ajax(url, method, data, headers, !!options.silentNotFound, options.raw);
}
const maxEntityChangeIdStr = resp.headers["trilium-max-entity-change-id"];
@@ -144,7 +149,10 @@ async function call(method: string, url: string, componentId?: string, option
return resp.body as T;
}
-function ajax(url: string, method: string, data: unknown, headers: Headers, silentNotFound: boolean): Promise {
+/**
+ * @param raw if `true`, the value will be returned as a string instead of a JavaScript object if JSON, XMLDocument if XML, etc.
+ */
+function ajax(url: string, method: string, data: unknown, headers: Headers, silentNotFound: boolean, raw?: boolean): Promise {
return new Promise((res, rej) => {
const options: JQueryAjaxSettings = {
url: window.glob.baseApiUrl + url,
@@ -186,6 +194,10 @@ function ajax(url: string, method: string, data: unknown, headers: Headers, sile
}
};
+ if (raw) {
+ options.dataType = "text";
+ }
+
if (data) {
try {
options.data = JSON.stringify(data);
diff --git a/apps/client/src/stylesheets/theme-dark.css b/apps/client/src/stylesheets/theme-dark.css
index 3b7a8fcc2..a6aab3118 100644
--- a/apps/client/src/stylesheets/theme-dark.css
+++ b/apps/client/src/stylesheets/theme-dark.css
@@ -70,6 +70,7 @@
--scrollbar-border-color: #666;
--scrollbar-background-color: #333;
+ --selection-background-color: #3399FF70;
--tooltip-background-color: #333;
--link-color: lightskyblue;
diff --git a/apps/client/src/stylesheets/theme-light.css b/apps/client/src/stylesheets/theme-light.css
index 70e81885f..b485e8a27 100644
--- a/apps/client/src/stylesheets/theme-light.css
+++ b/apps/client/src/stylesheets/theme-light.css
@@ -74,6 +74,7 @@ html {
--scrollbar-border-color: #ddd;
--scrollbar-background-color: #ddd;
+ --selection-background-color: #3399FF70;
--tooltip-background-color: #f8f8f8;
--link-color: blue;
diff --git a/apps/client/src/stylesheets/theme-next/ribbon.css b/apps/client/src/stylesheets/theme-next/ribbon.css
index c7765865d..e21984a76 100644
--- a/apps/client/src/stylesheets/theme-next/ribbon.css
+++ b/apps/client/src/stylesheets/theme-next/ribbon.css
@@ -108,6 +108,25 @@ div.editability-dropdown a.dropdown-item {
font-size: 0.85em;
}
+/*
+ * Edited notes (for calendar notes)
+ */
+
+/* The path of the note */
+.edited-notes-list small {
+ margin-inline-start: 4px;
+ font-size: inherit;
+ color: var(--muted-text-color);
+}
+
+.edited-notes-list small::before {
+ content: "(";
+}
+
+.edited-notes-list small::after {
+ content: ")";
+}
+
/*
* Owned attributes
*/
diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css
index a77715136..5b11839e5 100644
--- a/apps/client/src/stylesheets/theme-next/shell.css
+++ b/apps/client/src/stylesheets/theme-next/shell.css
@@ -1402,6 +1402,7 @@ div.floating-buttons .show-floating-buttons-button:active {
div.floating-buttons-children .close-floating-buttons-button::before,
div.floating-buttons .show-floating-buttons-button::before {
display: block;
+ line-height: 1;
}
/* "Show buttons" button */
diff --git a/apps/client/src/types-lib.d.ts b/apps/client/src/types-lib.d.ts
index a19bffa9d..0c4474e94 100644
--- a/apps/client/src/types-lib.d.ts
+++ b/apps/client/src/types-lib.d.ts
@@ -31,3 +31,23 @@ declare module "katex/contrib/auto-render" {
}) => void;
export default renderMathInElement;
}
+
+import * as L from "leaflet";
+
+declare module "leaflet" {
+ interface GPXMarker {
+ startIcon?: DivIcon | Icon | string | undefined;
+ endIcon?: DivIcon | Icon | string | undefined;
+ wptIcons?: {
+ [key: string]: DivIcon | Icon | string;
+ };
+ wptTypeIcons?: {
+ [key: string]: DivIcon | Icon | string;
+ };
+ pointMatchers?: Array<{ regex: RegExp; icon: DivIcon | Icon | string}>;
+ }
+
+ interface GPXOptions {
+ markers?: GPXMarker | undefined;
+ }
+}
diff --git a/apps/client/src/widgets/llm_chat/communication.ts b/apps/client/src/widgets/llm_chat/communication.ts
index bb58a47b2..614add7ad 100644
--- a/apps/client/src/widgets/llm_chat/communication.ts
+++ b/apps/client/src/widgets/llm_chat/communication.ts
@@ -6,8 +6,10 @@ import type { SessionResponse } from "./types.js";
/**
* Create a new chat session
+ * @param currentNoteId - Optional current note ID for context
+ * @returns The noteId of the created chat note
*/
-export async function createChatSession(currentNoteId?: string): Promise<{chatNoteId: string | null, noteId: string | null}> {
+export async function createChatSession(currentNoteId?: string): Promise {
try {
const resp = await server.post('llm/chat', {
title: 'Note Chat',
@@ -15,48 +17,42 @@ export async function createChatSession(currentNoteId?: string): Promise<{chatNo
});
if (resp && resp.id) {
- // The backend might provide the noteId separately from the chatNoteId
- // If noteId is provided, use it; otherwise, we'll need to query for it separately
- return {
- chatNoteId: resp.id,
- noteId: resp.noteId || null
- };
+ // Backend returns the chat note ID as 'id'
+ return resp.id;
}
} catch (error) {
console.error('Failed to create chat session:', error);
}
- return {
- chatNoteId: null,
- noteId: null
- };
+ return null;
}
/**
- * Check if a session exists
+ * Check if a chat note exists
+ * @param noteId - The ID of the chat note
*/
-export async function checkSessionExists(chatNoteId: string): Promise {
+export async function checkSessionExists(noteId: string): Promise {
try {
- // Validate that we have a proper note ID format, not a session ID
- // Note IDs in Trilium are typically longer or in a different format
- if (chatNoteId && chatNoteId.length === 16 && /^[A-Za-z0-9]+$/.test(chatNoteId)) {
- console.warn(`Invalid note ID format detected: ${chatNoteId} appears to be a legacy session ID`);
- return false;
- }
-
- const sessionCheck = await server.getWithSilentNotFound(`llm/chat/${chatNoteId}`);
+ const sessionCheck = await server.getWithSilentNotFound(`llm/chat/${noteId}`);
return !!(sessionCheck && sessionCheck.id);
} catch (error: any) {
- console.log(`Error checking chat note ${chatNoteId}:`, error);
+ console.log(`Error checking chat note ${noteId}:`, error);
return false;
}
}
/**
* Set up streaming response via WebSocket
+ * @param noteId - The ID of the chat note
+ * @param messageParams - Message parameters
+ * @param onContentUpdate - Callback for content updates
+ * @param onThinkingUpdate - Callback for thinking updates
+ * @param onToolExecution - Callback for tool execution
+ * @param onComplete - Callback for completion
+ * @param onError - Callback for errors
*/
export async function setupStreamingResponse(
- chatNoteId: string,
+ noteId: string,
messageParams: any,
onContentUpdate: (content: string, isDone?: boolean) => void,
onThinkingUpdate: (thinking: string) => void,
@@ -64,35 +60,24 @@ export async function setupStreamingResponse(
onComplete: () => void,
onError: (error: Error) => void
): Promise {
- // Validate that we have a proper note ID format, not a session ID
- if (chatNoteId && chatNoteId.length === 16 && /^[A-Za-z0-9]+$/.test(chatNoteId)) {
- console.error(`Invalid note ID format: ${chatNoteId} appears to be a legacy session ID`);
- onError(new Error("Invalid note ID format - using a legacy session ID"));
- return;
- }
-
return new Promise((resolve, reject) => {
let assistantResponse = '';
- let postToolResponse = ''; // Separate accumulator for post-tool execution content
let receivedAnyContent = false;
- let receivedPostToolContent = false; // Track if we've started receiving post-tool content
let timeoutId: number | null = null;
let initialTimeoutId: number | null = null;
let cleanupTimeoutId: number | null = null;
let receivedAnyMessage = false;
- let toolsExecuted = false; // Flag to track if tools were executed in this session
- let toolExecutionCompleted = false; // Flag to track if tool execution is completed
let eventListener: ((event: Event) => void) | null = null;
let lastMessageTimestamp = 0;
// Create a unique identifier for this response process
const responseId = `llm-stream-${Date.now()}-${Math.floor(Math.random() * 1000)}`;
- console.log(`[${responseId}] Setting up WebSocket streaming for chat note ${chatNoteId}`);
+ console.log(`[${responseId}] Setting up WebSocket streaming for chat note ${noteId}`);
// Send the initial request to initiate streaming
(async () => {
try {
- const streamResponse = await server.post(`llm/chat/${chatNoteId}/messages/stream`, {
+ const streamResponse = await server.post(`llm/chat/${noteId}/messages/stream`, {
content: messageParams.content,
useAdvancedContext: messageParams.useAdvancedContext,
showThinking: messageParams.showThinking,
@@ -129,28 +114,14 @@ export async function setupStreamingResponse(
resolve();
};
- // Function to schedule cleanup with ability to cancel
- const scheduleCleanup = (delay: number) => {
- // Clear any existing cleanup timeout
- if (cleanupTimeoutId) {
- window.clearTimeout(cleanupTimeoutId);
+ // Set initial timeout to catch cases where no message is received at all
+ initialTimeoutId = window.setTimeout(() => {
+ if (!receivedAnyMessage) {
+ console.error(`[${responseId}] No initial message received within timeout`);
+ performCleanup();
+ reject(new Error('No response received from server'));
}
-
- console.log(`[${responseId}] Scheduling listener cleanup in ${delay}ms`);
-
- // Set new cleanup timeout
- cleanupTimeoutId = window.setTimeout(() => {
- // Only clean up if no messages received recently (in last 2 seconds)
- const timeSinceLastMessage = Date.now() - lastMessageTimestamp;
- if (timeSinceLastMessage > 2000) {
- performCleanup();
- } else {
- console.log(`[${responseId}] Received message recently, delaying cleanup`);
- // Reschedule cleanup
- scheduleCleanup(2000);
- }
- }, delay);
- };
+ }, 10000);
// Create a message handler for CustomEvents
eventListener = (event: Event) => {
@@ -158,7 +129,7 @@ export async function setupStreamingResponse(
const message = customEvent.detail;
// Only process messages for our chat note
- if (!message || message.chatNoteId !== chatNoteId) {
+ if (!message || message.chatNoteId !== noteId) {
return;
}
@@ -172,12 +143,12 @@ export async function setupStreamingResponse(
cleanupTimeoutId = null;
}
- console.log(`[${responseId}] LLM Stream message received via CustomEvent: chatNoteId=${chatNoteId}, content=${!!message.content}, contentLength=${message.content?.length || 0}, thinking=${!!message.thinking}, toolExecution=${!!message.toolExecution}, done=${!!message.done}, type=${message.type || 'llm-stream'}`);
+ console.log(`[${responseId}] LLM Stream message received: content=${!!message.content}, contentLength=${message.content?.length || 0}, thinking=${!!message.thinking}, toolExecution=${!!message.toolExecution}, done=${!!message.done}`);
// Mark first message received
if (!receivedAnyMessage) {
receivedAnyMessage = true;
- console.log(`[${responseId}] First message received for chat note ${chatNoteId}`);
+ console.log(`[${responseId}] First message received for chat note ${noteId}`);
// Clear the initial timeout since we've received a message
if (initialTimeoutId !== null) {
@@ -186,109 +157,33 @@ export async function setupStreamingResponse(
}
}
- // Handle specific message types
- if (message.type === 'tool_execution_start') {
- toolsExecuted = true; // Mark that tools were executed
- onThinkingUpdate('Executing tools...');
- // Also trigger tool execution UI with a specific format
- onToolExecution({
- action: 'start',
- tool: 'tools',
- result: 'Executing tools...'
- });
- return; // Skip accumulating content from this message
+ // Handle error
+ if (message.error) {
+ console.error(`[${responseId}] Stream error: ${message.error}`);
+ performCleanup();
+ reject(new Error(message.error));
+ return;
}
- if (message.type === 'tool_result' && message.toolExecution) {
- toolsExecuted = true; // Mark that tools were executed
- console.log(`[${responseId}] Processing tool result: ${JSON.stringify(message.toolExecution)}`);
+ // Handle thinking updates - only show if showThinking is enabled
+ if (message.thinking && messageParams.showThinking) {
+ console.log(`[${responseId}] Received thinking: ${message.thinking.substring(0, 100)}...`);
+ onThinkingUpdate(message.thinking);
+ }
- // If tool execution doesn't have an action, add 'result' as the default
- if (!message.toolExecution.action) {
- message.toolExecution.action = 'result';
- }
-
- // First send a 'start' action to ensure the container is created
- onToolExecution({
- action: 'start',
- tool: 'tools',
- result: 'Tool execution initialized'
- });
-
- // Then send the actual tool execution data
+ // Handle tool execution updates
+ if (message.toolExecution) {
+ console.log(`[${responseId}] Tool execution update:`, message.toolExecution);
onToolExecution(message.toolExecution);
-
- // Mark tool execution as completed if this is a result or error
- if (message.toolExecution.action === 'result' || message.toolExecution.action === 'complete' || message.toolExecution.action === 'error') {
- toolExecutionCompleted = true;
- console.log(`[${responseId}] Tool execution completed`);
- }
-
- return; // Skip accumulating content from this message
- }
-
- if (message.type === 'tool_execution_error' && message.toolExecution) {
- toolsExecuted = true; // Mark that tools were executed
- toolExecutionCompleted = true; // Mark tool execution as completed
- onToolExecution({
- ...message.toolExecution,
- action: 'error',
- error: message.toolExecution.error || 'Unknown error during tool execution'
- });
- return; // Skip accumulating content from this message
- }
-
- if (message.type === 'tool_completion_processing') {
- toolsExecuted = true; // Mark that tools were executed
- toolExecutionCompleted = true; // Tools are done, now processing the result
- onThinkingUpdate('Generating response with tool results...');
- // Also trigger tool execution UI with a specific format
- onToolExecution({
- action: 'generating',
- tool: 'tools',
- result: 'Generating response with tool results...'
- });
- return; // Skip accumulating content from this message
}
// Handle content updates
if (message.content) {
- console.log(`[${responseId}] Received content chunk of length ${message.content.length}, preview: "${message.content.substring(0, 50)}${message.content.length > 50 ? '...' : ''}"`);
-
- // If tools were executed and completed, and we're now getting new content,
- // this is likely the final response after tool execution from Anthropic
- if (toolsExecuted && toolExecutionCompleted && message.content) {
- console.log(`[${responseId}] Post-tool execution content detected`);
-
- // If this is the first post-tool chunk, indicate we're starting a new response
- if (!receivedPostToolContent) {
- receivedPostToolContent = true;
- postToolResponse = ''; // Clear any previous post-tool response
- console.log(`[${responseId}] First post-tool content chunk, starting fresh accumulation`);
- }
-
- // Accumulate post-tool execution content
- postToolResponse += message.content;
- console.log(`[${responseId}] Accumulated post-tool content, now ${postToolResponse.length} chars`);
-
- // Update the UI with the accumulated post-tool content
- // This replaces the pre-tool content with our accumulated post-tool content
- onContentUpdate(postToolResponse, message.done || false);
- } else {
- // Standard content handling for non-tool cases or initial tool response
-
- // Check if this is a duplicated message containing the same content we already have
- if (message.done && assistantResponse.includes(message.content)) {
- console.log(`[${responseId}] Ignoring duplicated content in done message`);
- } else {
- // Add to our accumulated response
- assistantResponse += message.content;
- }
-
- // Update the UI immediately with each chunk
- onContentUpdate(assistantResponse, message.done || false);
- }
+ // Simply append the new content - no complex deduplication
+ assistantResponse += message.content;
+ // Update the UI immediately with each chunk
+ onContentUpdate(assistantResponse, message.done || false);
receivedAnyContent = true;
// Reset timeout since we got content
@@ -298,151 +193,33 @@ export async function setupStreamingResponse(
// Set new timeout
timeoutId = window.setTimeout(() => {
- console.warn(`[${responseId}] Stream timeout for chat note ${chatNoteId}`);
-
- // Clean up
+ console.warn(`[${responseId}] Stream timeout for chat note ${noteId}`);
performCleanup();
reject(new Error('Stream timeout'));
}, 30000);
}
- // Handle tool execution updates (legacy format and standard format with llm-stream type)
- if (message.toolExecution) {
- // Only process if we haven't already handled this message via specific message types
- if (message.type === 'llm-stream' || !message.type) {
- console.log(`[${responseId}] Received tool execution update: action=${message.toolExecution.action || 'unknown'}`);
- toolsExecuted = true; // Mark that tools were executed
-
- // Mark tool execution as completed if this is a result or error
- if (message.toolExecution.action === 'result' ||
- message.toolExecution.action === 'complete' ||
- message.toolExecution.action === 'error') {
- toolExecutionCompleted = true;
- console.log(`[${responseId}] Tool execution completed via toolExecution message`);
- }
-
- onToolExecution(message.toolExecution);
- }
- }
-
- // Handle tool calls from the raw data or direct in message (OpenAI format)
- const toolCalls = message.tool_calls || (message.raw && message.raw.tool_calls);
- if (toolCalls && Array.isArray(toolCalls)) {
- console.log(`[${responseId}] Received tool calls: ${toolCalls.length} tools`);
- toolsExecuted = true; // Mark that tools were executed
-
- // First send a 'start' action to ensure the container is created
- onToolExecution({
- action: 'start',
- tool: 'tools',
- result: 'Tool execution initialized'
- });
-
- // Then process each tool call
- for (const toolCall of toolCalls) {
- let args = toolCall.function?.arguments || {};
-
- // Try to parse arguments if they're a string
- if (typeof args === 'string') {
- try {
- args = JSON.parse(args);
- } catch (e) {
- console.log(`[${responseId}] Could not parse tool arguments as JSON: ${e}`);
- args = { raw: args };
- }
- }
-
- onToolExecution({
- action: 'executing',
- tool: toolCall.function?.name || 'unknown',
- toolCallId: toolCall.id,
- args: args
- });
- }
- }
-
- // Handle thinking state updates
- if (message.thinking) {
- console.log(`[${responseId}] Received thinking update: ${message.thinking.substring(0, 50)}...`);
- onThinkingUpdate(message.thinking);
- }
-
// Handle completion
if (message.done) {
- console.log(`[${responseId}] Stream completed for chat note ${chatNoteId}, has content: ${!!message.content}, content length: ${message.content?.length || 0}, current response: ${assistantResponse.length} chars`);
+ console.log(`[${responseId}] Stream completed for chat note ${noteId}, final response: ${assistantResponse.length} chars`);
- // Dump message content to console for debugging
- if (message.content) {
- console.log(`[${responseId}] CONTENT IN DONE MESSAGE (first 200 chars): "${message.content.substring(0, 200)}..."`);
-
- // Check if the done message contains the exact same content as our accumulated response
- // We normalize by removing whitespace to avoid false negatives due to spacing differences
- const normalizedMessage = message.content.trim();
- const normalizedResponse = assistantResponse.trim();
-
- if (normalizedMessage === normalizedResponse) {
- console.log(`[${responseId}] Final message is identical to accumulated response, no need to update`);
- }
- // If the done message is longer but contains our accumulated response, use the done message
- else if (normalizedMessage.includes(normalizedResponse) && normalizedMessage.length > normalizedResponse.length) {
- console.log(`[${responseId}] Final message is more complete than accumulated response, using it`);
- assistantResponse = message.content;
- }
- // If the done message is different and not already included, append it to avoid duplication
- else if (!normalizedResponse.includes(normalizedMessage) && normalizedMessage.length > 0) {
- console.log(`[${responseId}] Final message has unique content, using it`);
- assistantResponse = message.content;
- }
- // Otherwise, we already have the content accumulated, so no need to update
- else {
- console.log(`[${responseId}] Already have this content accumulated, not updating`);
- }
- }
-
- // Clear timeout if set
+ // Clear all timeouts
if (timeoutId !== null) {
window.clearTimeout(timeoutId);
timeoutId = null;
}
- // Always mark as done when we receive the done flag
- onContentUpdate(assistantResponse, true);
-
- // Set a longer delay before cleanup to allow for post-tool execution messages
- // Especially important for Anthropic which may send final message after tool execution
- const cleanupDelay = toolsExecuted ? 15000 : 1000; // 15 seconds if tools were used, otherwise 1 second
- console.log(`[${responseId}] Setting cleanup delay of ${cleanupDelay}ms since toolsExecuted=${toolsExecuted}`);
- scheduleCleanup(cleanupDelay);
+ // Schedule cleanup after a brief delay to ensure all processing is complete
+ cleanupTimeoutId = window.setTimeout(() => {
+ performCleanup();
+ }, 100);
}
};
- // Register event listener for the custom event
- try {
- window.addEventListener('llm-stream-message', eventListener);
- console.log(`[${responseId}] Event listener added for llm-stream-message events`);
- } catch (err) {
- console.error(`[${responseId}] Error setting up event listener:`, err);
- reject(err);
- return;
- }
+ // Register the event listener for WebSocket messages
+ window.addEventListener('llm-stream-message', eventListener);
- // Set initial timeout for receiving any message
- initialTimeoutId = window.setTimeout(() => {
- console.warn(`[${responseId}] No messages received for initial period in chat note ${chatNoteId}`);
- if (!receivedAnyMessage) {
- console.error(`[${responseId}] WebSocket connection not established for chat note ${chatNoteId}`);
-
- if (timeoutId !== null) {
- window.clearTimeout(timeoutId);
- }
-
- // Clean up
- cleanupEventListener(eventListener);
-
- // Show error message to user
- reject(new Error('WebSocket connection not established'));
- }
- }, 10000);
+ console.log(`[${responseId}] Event listener registered, waiting for messages...`);
});
}
@@ -463,15 +240,9 @@ function cleanupEventListener(listener: ((event: Event) => void) | null): void {
/**
* Get a direct response from the server without streaming
*/
-export async function getDirectResponse(chatNoteId: string, messageParams: any): Promise {
+export async function getDirectResponse(noteId: string, messageParams: any): Promise {
try {
- // Validate that we have a proper note ID format, not a session ID
- if (chatNoteId && chatNoteId.length === 16 && /^[A-Za-z0-9]+$/.test(chatNoteId)) {
- console.error(`Invalid note ID format: ${chatNoteId} appears to be a legacy session ID`);
- throw new Error("Invalid note ID format - using a legacy session ID");
- }
-
- const postResponse = await server.post(`llm/chat/${chatNoteId}/messages`, {
+ const postResponse = await server.post(`llm/chat/${noteId}/messages`, {
message: messageParams.content,
includeContext: messageParams.useAdvancedContext,
options: {
diff --git a/apps/client/src/widgets/llm_chat/llm_chat_panel.ts b/apps/client/src/widgets/llm_chat/llm_chat_panel.ts
index 32ffab50d..4565c0db2 100644
--- a/apps/client/src/widgets/llm_chat/llm_chat_panel.ts
+++ b/apps/client/src/widgets/llm_chat/llm_chat_panel.ts
@@ -37,9 +37,10 @@ export default class LlmChatPanel extends BasicWidget {
private thinkingBubble!: HTMLElement;
private thinkingText!: HTMLElement;
private thinkingToggle!: HTMLElement;
- private chatNoteId: string | null = null;
- private noteId: string | null = null; // The actual noteId for the Chat Note
- private currentNoteId: string | null = null;
+
+ // Simplified to just use noteId - this represents the AI Chat note we're working with
+ private noteId: string | null = null;
+ private currentNoteId: string | null = null; // The note providing context (for regular notes)
private _messageHandlerId: number | null = null;
private _messageHandler: any = null;
@@ -68,7 +69,6 @@ export default class LlmChatPanel extends BasicWidget {
totalTokens?: number;
};
} = {
- model: 'default',
temperature: 0.7,
toolExecutions: []
};
@@ -90,12 +90,21 @@ export default class LlmChatPanel extends BasicWidget {
this.messages = messages;
}
- public getChatNoteId(): string | null {
- return this.chatNoteId;
+ public getNoteId(): string | null {
+ return this.noteId;
}
- public setChatNoteId(chatNoteId: string | null): void {
- this.chatNoteId = chatNoteId;
+ public setNoteId(noteId: string | null): void {
+ this.noteId = noteId;
+ }
+
+ // Deprecated - keeping for backward compatibility but mapping to noteId
+ public getChatNoteId(): string | null {
+ return this.noteId;
+ }
+
+ public setChatNoteId(noteId: string | null): void {
+ this.noteId = noteId;
}
public getNoteContextChatMessages(): HTMLElement {
@@ -307,16 +316,22 @@ export default class LlmChatPanel extends BasicWidget {
}
}
- const dataToSave: ChatData = {
+ // Only save if we have a valid note ID
+ if (!this.noteId) {
+ console.warn('Cannot save chat data: no noteId available');
+ return;
+ }
+
+ const dataToSave = {
messages: this.messages,
- chatNoteId: this.chatNoteId,
noteId: this.noteId,
+ chatNoteId: this.noteId, // For backward compatibility
toolSteps: toolSteps,
// Add sources if we have them
sources: this.sources || [],
// Add metadata
metadata: {
- model: this.metadata?.model || 'default',
+ model: this.metadata?.model || undefined,
provider: this.metadata?.provider || undefined,
temperature: this.metadata?.temperature || 0.7,
lastUpdated: new Date().toISOString(),
@@ -325,7 +340,7 @@ export default class LlmChatPanel extends BasicWidget {
}
};
- console.log(`Saving chat data with chatNoteId: ${this.chatNoteId}, noteId: ${this.noteId}, ${toolSteps.length} tool steps, ${this.sources?.length || 0} sources, ${toolExecutions.length} tool executions`);
+ console.log(`Saving chat data with noteId: ${this.noteId}, ${toolSteps.length} tool steps, ${this.sources?.length || 0} sources, ${toolExecutions.length} tool executions`);
// Save the data to the note attribute via the callback
// This is the ONLY place we should save data, letting the container widget handle persistence
@@ -347,16 +362,52 @@ export default class LlmChatPanel extends BasicWidget {
const savedData = await this.onGetData() as ChatData;
if (savedData?.messages?.length > 0) {
+ // Check if we actually have new content to avoid unnecessary UI rebuilds
+ const currentMessageCount = this.messages.length;
+ const savedMessageCount = savedData.messages.length;
+
+ // If message counts are the same, check if content is different
+ const hasNewContent = savedMessageCount > currentMessageCount ||
+ JSON.stringify(this.messages) !== JSON.stringify(savedData.messages);
+
+ if (!hasNewContent) {
+ console.log("No new content detected, skipping UI rebuild");
+ return true;
+ }
+
+ console.log(`Loading saved data: ${currentMessageCount} -> ${savedMessageCount} messages`);
+
+ // Store current scroll position if we need to preserve it
+ const shouldPreserveScroll = savedMessageCount > currentMessageCount && currentMessageCount > 0;
+ const currentScrollTop = shouldPreserveScroll ? this.chatContainer.scrollTop : 0;
+ const currentScrollHeight = shouldPreserveScroll ? this.chatContainer.scrollHeight : 0;
+
// Load messages
+ const oldMessages = [...this.messages];
this.messages = savedData.messages;
- // Clear and rebuild the chat UI
- this.noteContextChatMessages.innerHTML = '';
+ // Only rebuild UI if we have significantly different content
+ if (savedMessageCount > currentMessageCount) {
+ // We have new messages - just add the new ones instead of rebuilding everything
+ const newMessages = savedData.messages.slice(currentMessageCount);
+ console.log(`Adding ${newMessages.length} new messages to UI`);
- this.messages.forEach(message => {
- const role = message.role as 'user' | 'assistant';
- this.addMessageToChat(role, message.content);
- });
+ newMessages.forEach(message => {
+ const role = message.role as 'user' | 'assistant';
+ this.addMessageToChat(role, message.content);
+ });
+ } else {
+ // Content changed but count is same - need to rebuild
+ console.log("Message content changed, rebuilding UI");
+
+ // Clear and rebuild the chat UI
+ this.noteContextChatMessages.innerHTML = '';
+
+ this.messages.forEach(message => {
+ const role = message.role as 'user' | 'assistant';
+ this.addMessageToChat(role, message.content);
+ });
+ }
// Restore tool execution steps if they exist
if (savedData.toolSteps && Array.isArray(savedData.toolSteps) && savedData.toolSteps.length > 0) {
@@ -400,13 +451,33 @@ export default class LlmChatPanel extends BasicWidget {
// Load Chat Note ID if available
if (savedData.noteId) {
console.log(`Using noteId as Chat Note ID: ${savedData.noteId}`);
- this.chatNoteId = savedData.noteId;
this.noteId = savedData.noteId;
} else {
console.log(`No noteId found in saved data, cannot load chat session`);
return false;
}
+ // Restore scroll position if we were preserving it
+ if (shouldPreserveScroll) {
+ // Calculate the new scroll position to maintain relative position
+ const newScrollHeight = this.chatContainer.scrollHeight;
+ const scrollDifference = newScrollHeight - currentScrollHeight;
+ const newScrollTop = currentScrollTop + scrollDifference;
+
+ // Only scroll down if we're near the bottom, otherwise preserve exact position
+ const wasNearBottom = (currentScrollTop + this.chatContainer.clientHeight) >= (currentScrollHeight - 50);
+
+ if (wasNearBottom) {
+ // User was at bottom, scroll to new bottom
+ this.chatContainer.scrollTop = newScrollHeight;
+ console.log("User was at bottom, scrolling to new bottom");
+ } else {
+ // User was not at bottom, try to preserve their position
+ this.chatContainer.scrollTop = newScrollTop;
+ console.log(`Preserving scroll position: ${currentScrollTop} -> ${newScrollTop}`);
+ }
+ }
+
return true;
}
} catch (error) {
@@ -550,6 +621,15 @@ export default class LlmChatPanel extends BasicWidget {
// Get current note context if needed
const currentActiveNoteId = appContext.tabManager.getActiveContext()?.note?.noteId || null;
+ // For AI Chat notes, the note itself IS the chat session
+ // So currentNoteId and noteId should be the same
+ if (this.noteId && currentActiveNoteId === this.noteId) {
+ // We're in an AI Chat note - don't reset, just load saved data
+ console.log(`Refreshing AI Chat note ${this.noteId} - loading saved data`);
+ await this.loadSavedData();
+ return;
+ }
+
// If we're switching to a different note, we need to reset
if (this.currentNoteId !== currentActiveNoteId) {
console.log(`Note ID changed from ${this.currentNoteId} to ${currentActiveNoteId}, resetting chat panel`);
@@ -557,7 +637,6 @@ export default class LlmChatPanel extends BasicWidget {
// Reset the UI and data
this.noteContextChatMessages.innerHTML = '';
this.messages = [];
- this.chatNoteId = null;
this.noteId = null; // Also reset the chat note ID
this.hideSources(); // Hide any sources from previous note
@@ -569,7 +648,7 @@ export default class LlmChatPanel extends BasicWidget {
const hasSavedData = await this.loadSavedData();
// Only create a new session if we don't have a session or saved data
- if (!this.chatNoteId || !this.noteId || !hasSavedData) {
+ if (!this.noteId || !hasSavedData) {
// Create a new chat session
await this.createChatSession();
}
@@ -580,19 +659,15 @@ export default class LlmChatPanel extends BasicWidget {
*/
private async createChatSession() {
try {
- // Create a new chat session, passing the current note ID if it exists
- const { chatNoteId, noteId } = await createChatSession(
- this.currentNoteId ? this.currentNoteId : undefined
- );
+ // If we already have a noteId (for AI Chat notes), use it
+ const contextNoteId = this.noteId || this.currentNoteId;
- if (chatNoteId) {
- // If we got back an ID from the API, use it
- this.chatNoteId = chatNoteId;
-
- // For new sessions, the noteId should equal the chatNoteId
- // This ensures we're using the note ID consistently
- this.noteId = noteId || chatNoteId;
+ // Create a new chat session, passing the context note ID
+ const noteId = await createChatSession(contextNoteId ? contextNoteId : undefined);
+ if (noteId) {
+ // Set the note ID for this chat
+ this.noteId = noteId;
console.log(`Created new chat session with noteId: ${this.noteId}`);
} else {
throw new Error("Failed to create chat session - no ID returned");
@@ -645,7 +720,7 @@ export default class LlmChatPanel extends BasicWidget {
const showThinking = this.showThinkingCheckbox.checked;
// Add logging to verify parameters
- console.log(`Sending message with: useAdvancedContext=${useAdvancedContext}, showThinking=${showThinking}, noteId=${this.currentNoteId}, sessionId=${this.chatNoteId}`);
+ console.log(`Sending message with: useAdvancedContext=${useAdvancedContext}, showThinking=${showThinking}, noteId=${this.currentNoteId}, sessionId=${this.noteId}`);
// Create the message parameters
const messageParams = {
@@ -695,11 +770,11 @@ export default class LlmChatPanel extends BasicWidget {
await validateEmbeddingProviders(this.validationWarning);
// Make sure we have a valid session
- if (!this.chatNoteId) {
+ if (!this.noteId) {
// If no session ID, create a new session
await this.createChatSession();
- if (!this.chatNoteId) {
+ if (!this.noteId) {
// If still no session ID, show error and return
console.error("Failed to create chat session");
toastService.showError("Failed to create chat session");
@@ -730,7 +805,7 @@ export default class LlmChatPanel extends BasicWidget {
await this.saveCurrentData();
// Add logging to verify parameters
- console.log(`Sending message with: useAdvancedContext=${useAdvancedContext}, showThinking=${showThinking}, noteId=${this.currentNoteId}, sessionId=${this.chatNoteId}`);
+ console.log(`Sending message with: useAdvancedContext=${useAdvancedContext}, showThinking=${showThinking}, noteId=${this.currentNoteId}, sessionId=${this.noteId}`);
// Create the message parameters
const messageParams = {
@@ -767,12 +842,12 @@ export default class LlmChatPanel extends BasicWidget {
*/
private async handleDirectResponse(messageParams: any): Promise {
try {
- if (!this.chatNoteId) return false;
+ if (!this.noteId) return false;
- console.log(`Getting direct response using sessionId: ${this.chatNoteId} (noteId: ${this.noteId})`);
+ console.log(`Getting direct response using sessionId: ${this.noteId} (noteId: ${this.noteId})`);
// Get a direct response from the server
- const postResponse = await getDirectResponse(this.chatNoteId, messageParams);
+ const postResponse = await getDirectResponse(this.noteId, messageParams);
// If the POST request returned content directly, display it
if (postResponse && postResponse.content) {
@@ -845,11 +920,11 @@ export default class LlmChatPanel extends BasicWidget {
* Set up streaming response via WebSocket
*/
private async setupStreamingResponse(messageParams: any): Promise {
- if (!this.chatNoteId) {
+ if (!this.noteId) {
throw new Error("No session ID available");
}
- console.log(`Setting up streaming response using sessionId: ${this.chatNoteId} (noteId: ${this.noteId})`);
+ console.log(`Setting up streaming response using sessionId: ${this.noteId} (noteId: ${this.noteId})`);
// Store tool executions captured during streaming
const toolExecutionsCache: Array<{
@@ -862,7 +937,7 @@ export default class LlmChatPanel extends BasicWidget {
}> = [];
return setupStreamingResponse(
- this.chatNoteId,
+ this.noteId,
messageParams,
// Content update handler
(content: string, isDone: boolean = false) => {
@@ -898,7 +973,7 @@ export default class LlmChatPanel extends BasicWidget {
similarity?: number;
content?: string;
}>;
- }>(`llm/chat/${this.chatNoteId}`)
+ }>(`llm/chat/${this.noteId}`)
.then((sessionData) => {
console.log("Got updated session data:", sessionData);
@@ -933,9 +1008,9 @@ export default class LlmChatPanel extends BasicWidget {
}
}
- // Save the updated data to the note
- this.saveCurrentData()
- .catch(err => console.error("Failed to save data after streaming completed:", err));
+ // DON'T save here - let the server handle saving the complete conversation
+ // to avoid race conditions between client and server saves
+ console.log("Updated metadata after streaming completion, server should save");
})
.catch(err => console.error("Error fetching session data after streaming:", err));
}
@@ -973,11 +1048,9 @@ export default class LlmChatPanel extends BasicWidget {
console.log(`Cached tool execution for ${toolData.tool} to be saved later`);
- // Save immediately after receiving a tool execution
- // This ensures we don't lose tool execution data if streaming fails
- this.saveCurrentData().catch(err => {
- console.error("Failed to save tool execution data:", err);
- });
+ // DON'T save immediately during streaming - let the server handle saving
+ // to avoid race conditions between client and server saves
+ console.log(`Tool execution cached, will be saved by server`);
}
},
// Complete handler
@@ -995,23 +1068,19 @@ export default class LlmChatPanel extends BasicWidget {
* Update the UI with streaming content
*/
private updateStreamingUI(assistantResponse: string, isDone: boolean = false) {
- // Parse and handle thinking content if present
- if (!isDone) {
- const thinkingContent = this.parseThinkingContent(assistantResponse);
- if (thinkingContent) {
- this.updateThinkingText(thinkingContent);
- // Don't display the raw response with think tags in the chat
- return;
- }
- }
-
- // Get the existing assistant message or create a new one
- let assistantMessageEl = this.noteContextChatMessages.querySelector('.assistant-message:last-child');
-
- if (!assistantMessageEl) {
- // If no assistant message yet, create one
+ // Track if we have a streaming message in progress
+ const hasStreamingMessage = !!this.noteContextChatMessages.querySelector('.assistant-message.streaming');
+
+ // Create a new message element or use the existing streaming one
+ let assistantMessageEl: HTMLElement;
+
+ if (hasStreamingMessage) {
+ // Use the existing streaming message
+ assistantMessageEl = this.noteContextChatMessages.querySelector('.assistant-message.streaming')!;
+ } else {
+ // Create a new message element
assistantMessageEl = document.createElement('div');
- assistantMessageEl.className = 'assistant-message message mb-3';
+ assistantMessageEl.className = 'assistant-message message mb-3 streaming';
this.noteContextChatMessages.appendChild(assistantMessageEl);
// Add assistant profile icon
@@ -1026,60 +1095,37 @@ export default class LlmChatPanel extends BasicWidget {
assistantMessageEl.appendChild(messageContent);
}
- // Clean the response to remove thinking tags before displaying
- const cleanedResponse = this.removeThinkingTags(assistantResponse);
-
- // Update the content
+ // Update the content with the current response
const messageContent = assistantMessageEl.querySelector('.message-content') as HTMLElement;
- messageContent.innerHTML = formatMarkdown(cleanedResponse);
+ messageContent.innerHTML = formatMarkdown(assistantResponse);
- // Apply syntax highlighting if this is the final update
+ // When the response is complete
if (isDone) {
+ // Remove the streaming class to mark this message as complete
+ assistantMessageEl.classList.remove('streaming');
+
+ // Apply syntax highlighting
formatCodeBlocks($(assistantMessageEl as HTMLElement));
// Hide the thinking display when response is complete
this.hideThinkingDisplay();
- // Update message in the data model for storage
- // Find the last assistant message to update, or add a new one if none exists
- const assistantMessages = this.messages.filter(msg => msg.role === 'assistant');
- const lastAssistantMsgIndex = assistantMessages.length > 0 ?
- this.messages.lastIndexOf(assistantMessages[assistantMessages.length - 1]) : -1;
-
- if (lastAssistantMsgIndex >= 0) {
- // Update existing message with cleaned content
- this.messages[lastAssistantMsgIndex].content = cleanedResponse;
- } else {
- // Add new message with cleaned content
- this.messages.push({
- role: 'assistant',
- content: cleanedResponse
- });
- }
-
- // Hide loading indicator
- hideLoadingIndicator(this.loadingIndicator);
-
- // Save the final state to the Chat Note
- this.saveCurrentData().catch(err => {
- console.error("Failed to save assistant response to note:", err);
+ // Always add a new message to the data model
+ // This ensures we preserve all distinct assistant messages
+ this.messages.push({
+ role: 'assistant',
+ content: assistantResponse,
+ timestamp: new Date()
});
+
+ // Save the updated message list
+ this.saveCurrentData();
}
// Scroll to bottom
this.chatContainer.scrollTop = this.chatContainer.scrollHeight;
}
- /**
- * Remove thinking tags from response content
- */
- private removeThinkingTags(content: string): string {
- if (!content) return content;
-
- // Remove ... blocks from the content
- return content.replace(/[\s\S]*?<\/think>/gi, '').trim();
- }
-
/**
* Handle general errors in the send message flow
*/
diff --git a/apps/client/src/widgets/llm_chat/types.ts b/apps/client/src/widgets/llm_chat/types.ts
index 300a7856a..7181651d0 100644
--- a/apps/client/src/widgets/llm_chat/types.ts
+++ b/apps/client/src/widgets/llm_chat/types.ts
@@ -11,7 +11,7 @@ export interface ChatResponse {
export interface SessionResponse {
id: string;
title: string;
- noteId?: string;
+ noteId: string; // The ID of the chat note
}
export interface ToolExecutionStep {
@@ -33,8 +33,8 @@ export interface MessageData {
export interface ChatData {
messages: MessageData[];
- chatNoteId: string | null;
- noteId?: string | null;
+ noteId: string; // The ID of the chat note
+ chatNoteId?: string; // Deprecated - kept for backward compatibility, should equal noteId
toolSteps: ToolExecutionStep[];
sources?: Array<{
noteId: string;
diff --git a/apps/client/src/widgets/ribbon_widgets/edited_notes.ts b/apps/client/src/widgets/ribbon_widgets/edited_notes.ts
index 4c8d79abe..2967b5f6f 100644
--- a/apps/client/src/widgets/ribbon_widgets/edited_notes.ts
+++ b/apps/client/src/widgets/ribbon_widgets/edited_notes.ts
@@ -19,7 +19,7 @@ const TPL = /*html*/`
${t("edited_notes.no_edited_notes_found")}
-
+
`;
diff --git a/apps/client/src/widgets/type_widgets/ai_chat.ts b/apps/client/src/widgets/type_widgets/ai_chat.ts
index e96cf5f20..f733b499b 100644
--- a/apps/client/src/widgets/type_widgets/ai_chat.ts
+++ b/apps/client/src/widgets/type_widgets/ai_chat.ts
@@ -94,6 +94,11 @@ export default class AiChatTypeWidget extends TypeWidget {
this.llmChatPanel.clearNoteContextChatMessages();
this.llmChatPanel.setMessages([]);
+ // Set the note ID for the chat panel
+ if (note) {
+ this.llmChatPanel.setNoteId(note.noteId);
+ }
+
// This will load saved data via the getData callback
await this.llmChatPanel.refresh();
this.isInitialized = true;
@@ -130,7 +135,7 @@ export default class AiChatTypeWidget extends TypeWidget {
// Reset the chat panel UI
this.llmChatPanel.clearNoteContextChatMessages();
this.llmChatPanel.setMessages([]);
- this.llmChatPanel.setChatNoteId(null);
+ this.llmChatPanel.setNoteId(this.note.noteId);
}
// Call the parent method to refresh
@@ -152,6 +157,7 @@ export default class AiChatTypeWidget extends TypeWidget {
// Make sure the chat panel has the current note ID
if (this.note) {
this.llmChatPanel.setCurrentNoteId(this.note.noteId);
+ this.llmChatPanel.setNoteId(this.note.noteId);
}
this.initPromise = (async () => {
@@ -186,7 +192,7 @@ export default class AiChatTypeWidget extends TypeWidget {
// Format the data properly - this is the canonical format of the data
const formattedData = {
messages: data.messages || [],
- chatNoteId: data.chatNoteId || this.note.noteId,
+ noteId: this.note.noteId, // Always use the note's own ID
toolSteps: data.toolSteps || [],
sources: data.sources || [],
metadata: {
diff --git a/apps/client/src/widgets/type_widgets/geo_map.ts b/apps/client/src/widgets/type_widgets/geo_map.ts
index 320fb7c9a..7f2b3e52a 100644
--- a/apps/client/src/widgets/type_widgets/geo_map.ts
+++ b/apps/client/src/widgets/type_widgets/geo_map.ts
@@ -224,11 +224,26 @@ export default class GeoMapTypeWidget extends TypeWidget {
this.gpxLoaded = true;
}
- // TODO: This is not very efficient as it's probably a string response that is parsed and then converted back to string and parsed again.
- const xmlResponse = await server.get(`notes/${note.noteId}/open`);
- const stringResponse = new XMLSerializer().serializeToString(xmlResponse);
+ const xmlResponse = await server.get(`notes/${note.noteId}/open`, undefined, true);
+ let stringResponse: string;
+ if (xmlResponse instanceof Uint8Array) {
+ stringResponse = new TextDecoder().decode(xmlResponse);
+ } else {
+ stringResponse = xmlResponse;
+ }
- const track = new this.L.GPX(stringResponse, {});
+ const track = new this.L.GPX(stringResponse, {
+ markers: {
+ startIcon: this.#buildIcon(note.getIcon(), note.getColorClass(), note.title),
+ endIcon: this.#buildIcon("bxs-flag-checkered"),
+ wptIcons: {
+ "": this.#buildIcon("bx bx-pin")
+ }
+ },
+ polyline_options: {
+ color: note.getLabelValue("color") ?? "blue"
+ }
+ });
track.addTo(this.geoMapWidget.map);
this.currentTrackData[note.noteId] = track;
}
@@ -276,13 +291,13 @@ export default class GeoMapTypeWidget extends TypeWidget {
this.currentMarkerData[note.noteId] = marker;
}
- #buildIcon(bxIconClass: string, colorClass: string, title: string) {
+ #buildIcon(bxIconClass: string, colorClass?: string, title?: string) {
return this.L.divIcon({
html: /*html*/`\
-
- ${title} `,
+
+ ${title ?? ""} `,
iconSize: [25, 41],
iconAnchor: [12, 41]
});
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 024d7d3a9..7c9813963 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -31,7 +31,6 @@
"config": {
"forge": "./electron-forge/forge.config.cjs"
},
- "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
"scripts": {
"start-prod": "nx build desktop && cross-env TRILIUM_DATA_DIR=data TRILIUM_RESOURCE_DIR=dist TRILIUM_PORT=37841 electron dist/main.js"
},
diff --git a/apps/dump-db/package.json b/apps/dump-db/package.json
index a63105b9c..3fd75f86f 100644
--- a/apps/dump-db/package.json
+++ b/apps/dump-db/package.json
@@ -12,7 +12,7 @@
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.11",
- "@types/mime-types": "^2.1.4",
+ "@types/mime-types": "^3.0.0",
"@types/yargs": "^17.0.33"
},
"nx": {
diff --git a/apps/server/package.json b/apps/server/package.json
index 2b8836251..89a19b068 100644
--- a/apps/server/package.json
+++ b/apps/server/package.json
@@ -23,7 +23,7 @@
"@types/ini": "4.1.1",
"@types/js-yaml": "4.0.9",
"@types/jsdom": "21.1.7",
- "@types/mime-types": "2.1.4",
+ "@types/mime-types": "3.0.0",
"@types/multer": "1.4.12",
"@types/safe-compare": "1.1.2",
"@types/sanitize-html": "2.16.0",
@@ -85,10 +85,10 @@
"jsdom": "26.1.0",
"marked": "15.0.12",
"mime-types": "3.0.1",
- "multer": "2.0.0",
+ "multer": "2.0.1",
"normalize-strings": "1.1.1",
"ollama": "0.5.16",
- "openai": "4.104.0",
+ "openai": "5.1.0",
"rand-token": "1.0.1",
"safe-compare": "1.1.4",
"sanitize-filename": "1.6.3",
diff --git a/apps/server/spec/etapi/api-metrics.spec.ts b/apps/server/spec/etapi/api-metrics.spec.ts
new file mode 100644
index 000000000..a9c98df87
--- /dev/null
+++ b/apps/server/spec/etapi/api-metrics.spec.ts
@@ -0,0 +1,48 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import buildApp from "../../src/app.js";
+import supertest from "supertest";
+
+let app: Application;
+let token: string;
+
+// TODO: This is an API test, not ETAPI.
+
+describe("api/metrics", () => {
+ beforeAll(async () => {
+ app = await buildApp();
+ });
+
+ it("returns Prometheus format by default", async () => {
+ const response = await supertest(app)
+ .get("/api/metrics")
+ .expect(200);
+ expect(response.headers["content-type"]).toContain("text/plain");
+ expect(response.text).toContain("trilium_info");
+ expect(response.text).toContain("trilium_notes_total");
+ expect(response.text).toContain("# HELP");
+ expect(response.text).toContain("# TYPE");
+ });
+
+ it("returns JSON when requested", async() => {
+ const response = await supertest(app)
+ .get("/api/metrics?format=json")
+ .expect(200);
+ expect(response.headers["content-type"]).toContain("application/json");
+ expect(response.body.version).toBeTruthy();
+ expect(response.body.database).toBeTruthy();
+ expect(response.body.timestamp).toBeTruthy();
+ expect(response.body.database.totalNotes).toBeTypeOf("number");
+ expect(response.body.database.activeNotes).toBeTypeOf("number");
+ expect(response.body.noteTypes).toBeTruthy();
+ expect(response.body.attachmentTypes).toBeTruthy();
+ expect(response.body.statistics).toBeTruthy();
+ });
+
+ it("returns error on invalid format", async() => {
+ const response = await supertest(app)
+ .get("/api/metrics?format=xml")
+ .expect(500);
+ expect(response.body.message).toContain("prometheus");
+ });
+});
diff --git a/apps/server/spec/etapi/app-info.spec.ts b/apps/server/spec/etapi/app-info.spec.ts
new file mode 100644
index 000000000..03a5a389b
--- /dev/null
+++ b/apps/server/spec/etapi/app-info.spec.ts
@@ -0,0 +1,20 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import buildApp from "../../src/app.js";
+import supertest from "supertest";
+
+let app: Application;
+let token: string;
+
+describe("etapi/app-info", () => {
+ beforeAll(async () => {
+ app = await buildApp();
+ });
+
+ it("retrieves correct app info", async () => {
+ const response = await supertest(app)
+ .get("/etapi/app-info")
+ .expect(200);
+ expect(response.body.clipperProtocolVersion).toBe("1.0");
+ });
+});
diff --git a/apps/server/spec/etapi/attachment-content.spec.ts b/apps/server/spec/etapi/attachment-content.spec.ts
new file mode 100644
index 000000000..12c90c155
--- /dev/null
+++ b/apps/server/spec/etapi/attachment-content.spec.ts
@@ -0,0 +1,64 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdNoteId: string;
+let createdAttachmentId: string;
+
+describe("etapi/attachment-content", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ createdNoteId = await createNote(app, token);
+
+ // Create an attachment
+ const response = await supertest(app)
+ .post(`/etapi/attachments`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "ownerId": createdNoteId,
+ "role": "file",
+ "mime": "text/plain",
+ "title": "my attachment",
+ "content": "text"
+ });
+ createdAttachmentId = response.body.attachmentId;
+ expect(createdAttachmentId).toBeTruthy();
+ });
+
+ it("changes attachment content", async () => {
+ const text = "Changed content";
+ await supertest(app)
+ .put(`/etapi/attachments/${createdAttachmentId}/content`)
+ .auth(USER, token, { "type": "basic"})
+ .set("Content-Type", "text/plain")
+ .send(text)
+ .expect(204);
+
+ // Ensure it got changed.
+ const response = await supertest(app)
+ .get(`/etapi/attachments/${createdAttachmentId}/content`)
+ .auth(USER, token, { "type": "basic"});
+ expect(response.text).toStrictEqual(text);
+ });
+
+ it("supports binary content", async() => {
+ await supertest(app)
+ .put(`/etapi/attachments/${createdAttachmentId}/content`)
+ .auth(USER, token, { "type": "basic"})
+ .set("Content-Type", "application/octet-stream")
+ .set("Content-Transfer-Encoding", "binary")
+ .send(Buffer.from("Hello world"))
+ .expect(204);
+ });
+
+});
diff --git a/apps/server/spec/etapi/basic-auth.spec.ts b/apps/server/spec/etapi/basic-auth.spec.ts
new file mode 100644
index 000000000..6518c7a12
--- /dev/null
+++ b/apps/server/spec/etapi/basic-auth.spec.ts
@@ -0,0 +1,54 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+const URL = "/etapi/notes/root";
+
+describe("basic-auth", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("auth token works", async () => {
+ const response = await supertest(app)
+ .get(URL)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ });
+
+ it("rejects wrong password", async () => {
+ const response = await supertest(app)
+ .get(URL)
+ .auth(USER, "wrong", { "type": "basic"})
+ .expect(401);
+ });
+
+ it("rejects wrong user", async () => {
+ const response = await supertest(app)
+ .get(URL)
+ .auth("wrong", token, { "type": "basic"})
+ .expect(401);
+ });
+
+ it("logs out", async () => {
+ await supertest(app)
+ .post("/etapi/auth/logout")
+ .auth(USER, token, { "type": "basic"})
+ .expect(204);
+
+ // Ensure we can't access it anymore
+ await supertest(app)
+ .get("/etapi/notes/root")
+ .auth(USER, token, { "type": "basic"})
+ .expect(401);
+ });
+});
diff --git a/apps/server/spec/etapi/create-backup.spec.ts b/apps/server/spec/etapi/create-backup.spec.ts
new file mode 100644
index 000000000..00c8751aa
--- /dev/null
+++ b/apps/server/spec/etapi/create-backup.spec.ts
@@ -0,0 +1,26 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+
+describe("etapi/backup", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("backup works", async () => {
+ const response = await supertest(app)
+ .put("/etapi/backup/etapi_test")
+ .auth(USER, token, { "type": "basic"})
+ .expect(204);
+ });
+});
diff --git a/apps/server/spec/etapi/create-entities.spec.ts b/apps/server/spec/etapi/create-entities.spec.ts
new file mode 100644
index 000000000..25dab1d45
--- /dev/null
+++ b/apps/server/spec/etapi/create-entities.spec.ts
@@ -0,0 +1,178 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+import { randomInt } from "crypto";
+
+let app: Application;
+let token: string;
+let createdNoteId: string;
+let createdBranchId: string;
+let clonedBranchId: string;
+let createdAttributeId: string;
+let createdAttachmentId: string;
+
+const USER = "etapi";
+
+describe("etapi/create-entities", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ ({ createdNoteId, createdBranchId } = await createNote());
+ clonedBranchId = await createClone();
+ createdAttributeId = await createAttribute();
+ createdAttachmentId = await createAttachment();
+ });
+
+ it("returns note info", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/notes/${createdNoteId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ noteId: createdNoteId,
+ parentNoteId: "_hidden"
+ })
+ .expect(200);
+ expect(response.body).toMatchObject({
+ noteId: createdNoteId,
+ title: "Hello"
+ });
+ expect(new Set(response.body.parentBranchIds))
+ .toStrictEqual(new Set([ clonedBranchId, createdBranchId ]));
+ });
+
+ it("obtains note content", async () => {
+ await supertest(app)
+ .get(`/etapi/notes/${createdNoteId}/content`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200)
+ .expect("Hi there!");
+ });
+
+ it("obtains created branch information", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/branches/${createdBranchId}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.body).toMatchObject({
+ branchId: createdBranchId,
+ parentNoteId: "root"
+ });
+ });
+
+ it("obtains cloned branch information", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/branches/${clonedBranchId}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.body).toMatchObject({
+ branchId: clonedBranchId,
+ parentNoteId: "_hidden"
+ });
+ });
+
+ it("obtains attribute information", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/attributes/${createdAttributeId}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.body.attributeId).toStrictEqual(createdAttributeId);
+ });
+
+ it("obtains attachment information", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/attachments/${createdAttachmentId}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.body.attachmentId).toStrictEqual(createdAttachmentId);
+ expect(response.body).toMatchObject({
+ role: "file",
+ mime: "plain/text",
+ title: "my attachment"
+ });
+ });
+});
+
+async function createNote() {
+ const noteId = `forcedId${randomInt(1000)}`;
+ const response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "noteId": noteId,
+ "parentNoteId": "root",
+ "title": "Hello",
+ "type": "text",
+ "content": "Hi there!",
+ "dateCreated": "2023-08-21 23:38:51.123+0200",
+ "utcDateCreated": "2023-08-21 23:38:51.123Z"
+ })
+ .expect(201);
+ expect(response.body.note.noteId).toStrictEqual(noteId);
+ expect(response.body).toMatchObject({
+ note: {
+ noteId,
+ title: "Hello",
+ dateCreated: "2023-08-21 23:38:51.123+0200",
+ utcDateCreated: "2023-08-21 23:38:51.123Z"
+ },
+ branch: {
+ parentNoteId: "root"
+ }
+ });
+
+ return {
+ createdNoteId: response.body.note.noteId,
+ createdBranchId: response.body.branch.branchId
+ };
+}
+
+async function createClone() {
+ const response = await supertest(app)
+ .post("/etapi/branches")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ noteId: createdNoteId,
+ parentNoteId: "_hidden"
+ })
+ .expect(201);
+ expect(response.body.parentNoteId).toStrictEqual("_hidden");
+ return response.body.branchId;
+}
+
+async function createAttribute() {
+ const attributeId = `forcedId${randomInt(1000)}`;
+ const response = await supertest(app)
+ .post("/etapi/attributes")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "attributeId": attributeId,
+ "noteId": createdNoteId,
+ "type": "label",
+ "name": "mylabel",
+ "value": "val",
+ "isInheritable": true
+ })
+ .expect(201);
+ expect(response.body.attributeId).toStrictEqual(attributeId);
+ return response.body.attributeId;
+}
+
+async function createAttachment() {
+ const response = await supertest(app)
+ .post("/etapi/attachments")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "ownerId": createdNoteId,
+ "role": "file",
+ "mime": "plain/text",
+ "title": "my attachment",
+ "content": "my text"
+ })
+ .expect(201);
+ return response.body.attachmentId;
+}
diff --git a/apps/server/spec/etapi/delete-entities.spec.ts b/apps/server/spec/etapi/delete-entities.spec.ts
new file mode 100644
index 000000000..581b1e693
--- /dev/null
+++ b/apps/server/spec/etapi/delete-entities.spec.ts
@@ -0,0 +1,172 @@
+import { Application } from "express";
+import { beforeAll, beforeEach, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+import { randomInt } from "crypto";
+
+let app: Application;
+let token: string;
+let createdNoteId: string;
+let createdBranchId: string;
+
+const USER = "etapi";
+
+type EntityType = "attachments" | "attributes" | "branches" | "notes";
+
+describe("etapi/delete-entities", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ beforeEach(async () => {
+ ({ createdNoteId, createdBranchId } = await createNote());
+ });
+
+ it("deletes attachment", async () => {
+ const attachmentId = await createAttachment();
+ await deleteEntity("attachments", attachmentId);
+ await expectNotFound("attachments", attachmentId);
+ });
+
+ it("deletes attribute", async () => {
+ const attributeId = await createAttribute();
+ await deleteEntity("attributes", attributeId);
+ await expectNotFound("attributes", attributeId);
+ });
+
+ it("deletes cloned branch", async () => {
+ const clonedBranchId = await createClone();
+
+ await expectFound("branches", createdBranchId);
+ await expectFound("branches", clonedBranchId);
+
+ await deleteEntity("branches", createdBranchId);
+ await expectNotFound("branches", createdBranchId);
+
+ await expectFound("branches", clonedBranchId);
+ await expectFound("notes", createdNoteId);
+ });
+
+ it("deletes note with all branches", async () => {
+ const attributeId = await createAttribute();
+
+ const clonedBranchId = await createClone();
+
+ await expectFound("notes", createdNoteId);
+ await expectFound("branches", createdBranchId);
+ await expectFound("branches", clonedBranchId);
+ await expectFound("attributes", attributeId);
+ await deleteEntity("notes", createdNoteId);
+
+ await expectNotFound("branches", createdBranchId);
+ await expectNotFound("branches", clonedBranchId);
+ await expectNotFound("notes", createdNoteId);
+ await expectNotFound("attributes", attributeId);
+ });
+});
+
+async function createNote() {
+ const noteId = `forcedId${randomInt(1000)}`;
+ const response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "noteId": noteId,
+ "parentNoteId": "root",
+ "title": "Hello",
+ "type": "text",
+ "content": "Hi there!",
+ "dateCreated": "2023-08-21 23:38:51.123+0200",
+ "utcDateCreated": "2023-08-21 23:38:51.123Z"
+ })
+ .expect(201);
+ expect(response.body.note.noteId).toStrictEqual(noteId);
+
+ return {
+ createdNoteId: response.body.note.noteId,
+ createdBranchId: response.body.branch.branchId
+ };
+}
+
+async function createClone() {
+ const response = await supertest(app)
+ .post("/etapi/branches")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ noteId: createdNoteId,
+ parentNoteId: "_hidden"
+ })
+ .expect(201);
+ expect(response.body.parentNoteId).toStrictEqual("_hidden");
+ return response.body.branchId;
+}
+
+async function createAttribute() {
+ const attributeId = `forcedId${randomInt(1000)}`;
+ const response = await supertest(app)
+ .post("/etapi/attributes")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "attributeId": attributeId,
+ "noteId": createdNoteId,
+ "type": "label",
+ "name": "mylabel",
+ "value": "val",
+ "isInheritable": true
+ })
+ .expect(201);
+ expect(response.body.attributeId).toStrictEqual(attributeId);
+ return response.body.attributeId;
+}
+
+async function createAttachment() {
+ const response = await supertest(app)
+ .post("/etapi/attachments")
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "ownerId": createdNoteId,
+ "role": "file",
+ "mime": "plain/text",
+ "title": "my attachment",
+ "content": "my text"
+ })
+ .expect(201);
+ return response.body.attachmentId;
+}
+
+async function deleteEntity(entity: EntityType, id: string) {
+ // Delete twice to test idempotency.
+ for (let i=0; i < 2; i++) {
+ await supertest(app)
+ .delete(`/etapi/${entity}/${id}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(204);
+ }
+}
+
+const MISSING_ENTITY_ERROR_CODES: Record = {
+ attachments: "ATTACHMENT_NOT_FOUND",
+ attributes: "ATTRIBUTE_NOT_FOUND",
+ branches: "BRANCH_NOT_FOUND",
+ notes: "NOTE_NOT_FOUND"
+}
+
+async function expectNotFound(entity: EntityType, id: string) {
+ const response = await supertest(app)
+ .get(`/etapi/${entity}/${id}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(404);
+
+ expect(response.body.code).toStrictEqual(MISSING_ENTITY_ERROR_CODES[entity]);
+}
+
+async function expectFound(entity: EntityType, id: string) {
+ await supertest(app)
+ .get(`/etapi/${entity}/${id}`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+}
diff --git a/apps/server/spec/etapi/etapi-metrics.spec.ts b/apps/server/spec/etapi/etapi-metrics.spec.ts
new file mode 100644
index 000000000..7b7d3a184
--- /dev/null
+++ b/apps/server/spec/etapi/etapi-metrics.spec.ts
@@ -0,0 +1,71 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+
+describe("etapi/metrics", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("returns Prometheus format by default", async () => {
+ const response = await supertest(app)
+ .get("/etapi/metrics")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.headers["content-type"]).toContain("text/plain");
+ expect(response.text).toContain("trilium_info");
+ expect(response.text).toContain("trilium_notes_total");
+ expect(response.text).toContain("# HELP");
+ expect(response.text).toContain("# TYPE");
+ });
+
+ it("returns JSON when requested", async() => {
+ const response = await supertest(app)
+ .get("/etapi/metrics?format=json")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.headers["content-type"]).toContain("application/json");
+ expect(response.body.version).toBeTruthy();
+ expect(response.body.database).toBeTruthy();
+ expect(response.body.timestamp).toBeTruthy();
+ expect(response.body.database.totalNotes).toBeTypeOf("number");
+ expect(response.body.database.activeNotes).toBeTypeOf("number");
+ expect(response.body.noteTypes).toBeTruthy();
+ expect(response.body.attachmentTypes).toBeTruthy();
+ expect(response.body.statistics).toBeTruthy();
+ });
+
+ it("returns Prometheus format explicitly", async () => {
+ const response = await supertest(app)
+ .get("/etapi/metrics?format=prometheus")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.headers["content-type"]).toContain("text/plain");
+ expect(response.text).toContain("trilium_info");
+ expect(response.text).toContain("trilium_notes_total");
+ });
+
+ it("returns error on invalid format", async() => {
+ const response = await supertest(app)
+ .get("/etapi/metrics?format=xml")
+ .auth(USER, token, { "type": "basic"})
+ .expect(500);
+ expect(response.body.message).toContain("prometheus");
+ });
+
+ it("should fail without authentication", async() => {
+ await supertest(app)
+ .get("/etapi/metrics")
+ .expect(401);
+ });
+});
diff --git a/apps/server/spec/etapi/export-note-subtree.spec.ts b/apps/server/spec/etapi/export-note-subtree.spec.ts
new file mode 100644
index 000000000..f5f09b532
--- /dev/null
+++ b/apps/server/spec/etapi/export-note-subtree.spec.ts
@@ -0,0 +1,51 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+
+describe("etapi/export-note-subtree", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("export works", async () => {
+ await supertest(app)
+ .get("/etapi/notes/root/export")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200)
+ .expect("Content-Type", "application/zip");
+ });
+
+ it("HTML export works", async () => {
+ await supertest(app)
+ .get("/etapi/notes/root/export?format=html")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200)
+ .expect("Content-Type", "application/zip");
+ });
+
+ it("Markdown export works", async () => {
+ await supertest(app)
+ .get("/etapi/notes/root/export?format=markdown")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200)
+ .expect("Content-Type", "application/zip");
+ });
+
+ it("reports wrong format", async () => {
+ const response = await supertest(app)
+ .get("/etapi/notes/root/export?format=wrong")
+ .auth(USER, token, { "type": "basic"})
+ .expect(400);
+ expect(response.body.code).toStrictEqual("UNRECOGNIZED_EXPORT_FORMAT");
+ });
+});
diff --git a/apps/server/spec/etapi/get-date-notes.spec.ts b/apps/server/spec/etapi/get-date-notes.spec.ts
new file mode 100644
index 000000000..e1f67fec6
--- /dev/null
+++ b/apps/server/spec/etapi/get-date-notes.spec.ts
@@ -0,0 +1,103 @@
+import { beforeAll, describe, expect, it } from "vitest";
+import config from "../../src/services/config.js";
+import { login } from "./utils.js";
+import { Application } from "express";
+import supertest from "supertest";
+import date_notes from "../../src/services/date_notes.js";
+import cls from "../../src/services/cls.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+
+describe("etapi/get-date-notes", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("obtains inbox", async () => {
+ await supertest(app)
+ .get("/etapi/inbox/2022-01-01")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ });
+
+ describe("days", () => {
+ it("obtains day from calendar", async () => {
+ await supertest(app)
+ .get("/etapi/calendar/days/2022-01-01")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ });
+
+ it("detects invalid date", async () => {
+ const response = await supertest(app)
+ .get("/etapi/calendar/days/2022-1")
+ .auth(USER, token, { "type": "basic"})
+ .expect(400);
+ expect(response.body.code).toStrictEqual("DATE_INVALID");
+ });
+ });
+
+ describe("weeks", () => {
+ beforeAll(() => {
+ cls.init(() => {
+ const rootCalendarNote = date_notes.getRootCalendarNote();
+ rootCalendarNote.setLabel("enableWeekNote");
+ });
+ });
+
+ it("obtains week calendar", async () => {
+ await supertest(app)
+ .get("/etapi/calendar/weeks/2022-W01")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ });
+
+ it("detects invalid date", async () => {
+ const response = await supertest(app)
+ .get("/etapi/calendar/weeks/2022-1")
+ .auth(USER, token, { "type": "basic"})
+ .expect(400);
+ expect(response.body.code).toStrictEqual("WEEK_INVALID");
+ });
+ });
+
+ describe("months", () => {
+ it("obtains month calendar", async () => {
+ await supertest(app)
+ .get("/etapi/calendar/months/2022-01")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ });
+
+ it("detects invalid month", async () => {
+ const response = await supertest(app)
+ .get("/etapi/calendar/months/2022-1")
+ .auth(USER, token, { "type": "basic"})
+ .expect(400);
+ expect(response.body.code).toStrictEqual("MONTH_INVALID");
+ });
+ });
+
+ describe("years", () => {
+ it("obtains year calendar", async () => {
+ await supertest(app)
+ .get("/etapi/calendar/years/2022")
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ });
+
+ it("detects invalid year", async () => {
+ const response = await supertest(app)
+ .get("/etapi/calendar/years/202")
+ .auth(USER, token, { "type": "basic"})
+ .expect(400);
+ expect(response.body.code).toStrictEqual("YEAR_INVALID");
+ });
+ });
+});
diff --git a/apps/server/spec/etapi/get-inherited-attribute-cloned.spec.ts b/apps/server/spec/etapi/get-inherited-attribute-cloned.spec.ts
new file mode 100644
index 000000000..5d882746f
--- /dev/null
+++ b/apps/server/spec/etapi/get-inherited-attribute-cloned.spec.ts
@@ -0,0 +1,98 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+let parentNoteId: string;
+
+describe("etapi/get-inherited-attribute-cloned", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ parentNoteId = await createNote(app, token);
+ });
+
+ it("gets inherited attribute", async () => {
+ // Create an inheritable attribute on the parent note.
+ let response = await supertest(app)
+ .post("/etapi/attributes")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "noteId": parentNoteId,
+ "type": "label",
+ "name": "mylabel",
+ "value": "val",
+ "isInheritable": true,
+ "position": 10
+ })
+ .expect(201);
+ const parentAttributeId = response.body.attributeId;
+ expect(parentAttributeId).toBeTruthy();
+
+ // Create a subnote.
+ response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "parentNoteId": parentNoteId,
+ "title": "Hello",
+ "type": "text",
+ "content": "Hi there!"
+ })
+ .expect(201);
+ const childNoteId = response.body.note.noteId;
+
+ // Create child attribute
+ response = await supertest(app)
+ .post("/etapi/attributes")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "noteId": childNoteId,
+ "type": "label",
+ "name": "mylabel",
+ "value": "val",
+ "isInheritable": false,
+ "position": 10
+ })
+ .expect(201);
+ const childAttributeId = response.body.attributeId;
+ expect(parentAttributeId).toBeTruthy();
+
+ // Clone child to parent
+ response = await supertest(app)
+ .post("/etapi/branches")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ noteId: childNoteId,
+ parentNoteId: parentNoteId
+ })
+ .expect(200);
+ parentNoteId = response.body.parentNoteId;
+
+ // Check attribute IDs
+ response = await supertest(app)
+ .get(`/etapi/notes/${childNoteId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .expect(200);
+ expect(response.body.noteId).toStrictEqual(childNoteId);
+ expect(response.body.attributes).toHaveLength(2);
+ expect(hasAttribute(response.body.attributes, parentAttributeId));
+ expect(hasAttribute(response.body.attributes, childAttributeId));
+ });
+
+ function hasAttribute(list: object[], attributeId: string) {
+ for (let i = 0; i < list.length; i++) {
+ if (list[i]["attributeId"] === attributeId) {
+ return true;
+ }
+ }
+ return false;
+ }
+});
diff --git a/apps/server/spec/etapi/get-inherited-attribute.spec.ts b/apps/server/spec/etapi/get-inherited-attribute.spec.ts
new file mode 100644
index 000000000..c0e92dde1
--- /dev/null
+++ b/apps/server/spec/etapi/get-inherited-attribute.spec.ts
@@ -0,0 +1,60 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+let parentNoteId: string;
+
+describe("etapi/get-inherited-attribute", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ parentNoteId = await createNote(app, token);
+ });
+
+ it("gets inherited attribute", async () => {
+ // Create an inheritable attribute on the parent note.
+ let response = await supertest(app)
+ .post("/etapi/attributes")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "noteId": parentNoteId,
+ "type": "label",
+ "name": "mylabel",
+ "value": "val",
+ "isInheritable": true
+ })
+ .expect(201);
+ const createdAttributeId = response.body.attributeId;
+ expect(createdAttributeId).toBeTruthy();
+
+ // Create a subnote.
+ response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "parentNoteId": parentNoteId,
+ "title": "Hello",
+ "type": "text",
+ "content": "Hi there!"
+ })
+ .expect(201);
+ const createdNoteId = response.body.note.noteId;
+
+ // Check the attribute is inherited.
+ response = await supertest(app)
+ .get(`/etapi/notes/${createdNoteId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .expect(200);
+ expect(response.body.noteId).toStrictEqual(createdNoteId);
+ expect(response.body.attributes).toHaveLength(1);
+ expect(response.body.attributes[0].attributeId === createdAttributeId);
+ });
+});
diff --git a/apps/server/spec/etapi/import-zip.spec.ts b/apps/server/spec/etapi/import-zip.spec.ts
new file mode 100644
index 000000000..c42623b76
--- /dev/null
+++ b/apps/server/spec/etapi/import-zip.spec.ts
@@ -0,0 +1,34 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+import { readFileSync } from "fs";
+import { join } from "path";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+
+describe("etapi/import", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("demo zip can be imported", async () => {
+ const buffer = readFileSync(join(__dirname, "../../src/assets/db/demo.zip"));
+ const response = await supertest(app)
+ .post("/etapi/notes/root/import")
+ .auth(USER, token, { "type": "basic"})
+ .set("Content-Type", "application/octet-stream")
+ .set("Content-Transfer-Encoding", "binary")
+ .send(buffer)
+ .expect(201);
+ expect(response.body.note.title).toStrictEqual("Journal");
+ expect(response.body.branch.parentNoteId).toStrictEqual("root");
+ });
+});
diff --git a/apps/server/spec/etapi/no-token.spec.ts b/apps/server/spec/etapi/no-token.spec.ts
new file mode 100644
index 000000000..d4a7a2f9f
--- /dev/null
+++ b/apps/server/spec/etapi/no-token.spec.ts
@@ -0,0 +1,54 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+import type TestAgent from "supertest/lib/agent.js";
+
+let app: Application;
+
+const USER = "etapi";
+
+const routes = [
+ "GET /etapi/notes?search=aaa",
+ "GET /etapi/notes/root",
+ "PATCH /etapi/notes/root",
+ "DELETE /etapi/notes/root",
+ "GET /etapi/branches/root",
+ "PATCH /etapi/branches/root",
+ "DELETE /etapi/branches/root",
+ "GET /etapi/attributes/000",
+ "PATCH /etapi/attributes/000",
+ "DELETE /etapi/attributes/000",
+ "GET /etapi/inbox/2022-02-22",
+ "GET /etapi/calendar/days/2022-02-22",
+ "GET /etapi/calendar/weeks/2022-02-22",
+ "GET /etapi/calendar/months/2022-02",
+ "GET /etapi/calendar/years/2022",
+ "POST /etapi/create-note",
+ "GET /etapi/app-info",
+]
+
+describe("no-token", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ });
+
+ for (const route of routes) {
+ const [ method, url ] = route.split(" ", 2);
+
+ it(`rejects access to ${method} ${url}`, () => {
+ (supertest(app)[method.toLowerCase()](url) as TestAgent)
+ .auth(USER, "fakeauth", { "type": "basic"})
+ .expect(401)
+ });
+ }
+
+ it("responds with 404 even without token", () => {
+ supertest(app)
+ .get("/etapi/zzzzzz")
+ .expect(404);
+ });
+});
diff --git a/apps/server/spec/etapi/note-content.spec.ts b/apps/server/spec/etapi/note-content.spec.ts
new file mode 100644
index 000000000..5b7fdcba8
--- /dev/null
+++ b/apps/server/spec/etapi/note-content.spec.ts
@@ -0,0 +1,72 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdNoteId: string;
+
+describe("etapi/note-content", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ createdNoteId = await createNote(app, token);
+ });
+
+ it("get content", async () => {
+ const response = await getContentResponse();
+ expect(response.text).toStrictEqual("Hi there!");
+ });
+
+ it("put note content", async () => {
+ const text = "Changed content";
+ await supertest(app)
+ .put(`/etapi/notes/${createdNoteId}/content`)
+ .auth(USER, token, { "type": "basic"})
+ .set("Content-Type", "text/plain")
+ .send(text)
+ .expect(204);
+
+ const response = await getContentResponse();
+ expect(response.text).toStrictEqual(text);
+ });
+
+ it("put note content binary", async () => {
+ // First, create a binary note
+ const response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "parentNoteId": "root",
+ "title": "Hello",
+ "mime": "image/png",
+ "type": "image",
+ "content": ""
+ })
+ .expect(201);
+ const createdNoteId = response.body.note.noteId;
+
+ // Put binary content
+ await supertest(app)
+ .put(`/etapi/notes/${createdNoteId}/content`)
+ .auth(USER, token, { "type": "basic"})
+ .set("Content-Type", "application/octet-stream")
+ .set("Content-Transfer-Encoding", "binary")
+ .send(Buffer.from("Hello world"))
+ .expect(204);
+ });
+
+ function getContentResponse() {
+ return supertest(app)
+ .get(`/etapi/notes/${createdNoteId}/content`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ }
+});
diff --git a/apps/server/spec/etapi/other.spec.ts b/apps/server/spec/etapi/other.spec.ts
new file mode 100644
index 000000000..d7c1d38b3
--- /dev/null
+++ b/apps/server/spec/etapi/other.spec.ts
@@ -0,0 +1,26 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+
+describe("etapi/refresh-note-ordering/root", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ });
+
+ it("refreshes note ordering", async () => {
+ await supertest(app)
+ .post("/etapi/refresh-note-ordering/root")
+ .auth(USER, token, { "type": "basic"})
+ .expect(204);
+ });
+});
diff --git a/apps/server/spec/etapi/patch-attachment.spec.ts b/apps/server/spec/etapi/patch-attachment.spec.ts
new file mode 100644
index 000000000..706ac7fbb
--- /dev/null
+++ b/apps/server/spec/etapi/patch-attachment.spec.ts
@@ -0,0 +1,78 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdNoteId: string;
+let createdAttachmentId: string;
+
+describe("etapi/attachment-content", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ createdNoteId = await createNote(app, token);
+
+ // Create an attachment
+ const response = await supertest(app)
+ .post(`/etapi/attachments`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "ownerId": createdNoteId,
+ "role": "file",
+ "mime": "text/plain",
+ "title": "my attachment",
+ "content": "text"
+ });
+ createdAttachmentId = response.body.attachmentId;
+ expect(createdAttachmentId).toBeTruthy();
+ });
+
+ it("changes title and position", async () => {
+ const state = {
+ title: "CHANGED",
+ position: 999
+ }
+ await supertest(app)
+ .patch(`/etapi/attachments/${createdAttachmentId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send(state)
+ .expect(200);
+
+ // Ensure it got changed.
+ const response = await supertest(app)
+ .get(`/etapi/attachments/${createdAttachmentId}`)
+ .auth(USER, token, { "type": "basic"});
+ expect(response.body).toMatchObject(state);
+ });
+
+ it("forbids changing owner", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/attachments/${createdAttachmentId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ ownerId: "root"
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_NOT_ALLOWED");
+ });
+
+ it("handles validation error", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/attachments/${createdAttachmentId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ title: null
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_VALIDATION_ERROR");
+ });
+
+});
diff --git a/apps/server/spec/etapi/patch-attribute.spec.ts b/apps/server/spec/etapi/patch-attribute.spec.ts
new file mode 100644
index 000000000..821a4e3db
--- /dev/null
+++ b/apps/server/spec/etapi/patch-attribute.spec.ts
@@ -0,0 +1,77 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdNoteId: string;
+let createdAttributeId: string;
+
+describe("etapi/patch-attribute", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ createdNoteId = await createNote(app, token);
+
+ // Create an attribute
+ const response = await supertest(app)
+ .post(`/etapi/attributes`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ "noteId": createdNoteId,
+ "type": "label",
+ "name": "mylabel",
+ "value": "val",
+ "isInheritable": true
+ });
+ createdAttributeId = response.body.attributeId;
+ expect(createdAttributeId).toBeTruthy();
+ });
+
+ it("changes name and value", async () => {
+ const state = {
+ value: "CHANGED"
+ };
+ await supertest(app)
+ .patch(`/etapi/attributes/${createdAttributeId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send(state)
+ .expect(200);
+
+ // Ensure it got changed.
+ const response = await supertest(app)
+ .get(`/etapi/attributes/${createdAttributeId}`)
+ .auth(USER, token, { "type": "basic"});
+ expect(response.body).toMatchObject(state);
+ });
+
+ it("forbids setting disallowed property", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/attributes/${createdAttributeId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ noteId: "root"
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_NOT_ALLOWED");
+ });
+
+ it("forbids setting wrong data type", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/attributes/${createdAttributeId}`)
+ .auth(USER, token, { "type": "basic"})
+ .send({
+ value: null
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_VALIDATION_ERROR");
+ });
+
+});
diff --git a/apps/server/spec/etapi/patch-branch.spec.ts b/apps/server/spec/etapi/patch-branch.spec.ts
new file mode 100644
index 000000000..ecca59b2d
--- /dev/null
+++ b/apps/server/spec/etapi/patch-branch.spec.ts
@@ -0,0 +1,77 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdBranchId: string;
+
+describe("etapi/attachment-content", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ // Create a note and a branch.
+ const response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "parentNoteId": "root",
+ "title": "Hello",
+ "type": "text",
+ "content": "",
+ })
+ .expect(201);
+
+ createdBranchId = response.body.branch.branchId;
+ });
+
+ it("can patch branch info", async () => {
+ const state = {
+ prefix: "pref",
+ notePosition: 666,
+ isExpanded: true
+ };
+
+ await supertest(app)
+ .patch(`/etapi/branches/${createdBranchId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .send(state)
+ .expect(200);
+
+ const response = await supertest(app)
+ .get(`/etapi/branches/${createdBranchId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .expect(200);
+ expect(response.body).toMatchObject(state);
+ });
+
+ it("rejects not allowed property", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/branches/${createdBranchId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ parentNoteId: "root"
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_NOT_ALLOWED");
+ });
+
+ it("rejects invalid property value", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/branches/${createdBranchId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ prefix: 123
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_VALIDATION_ERROR");
+ });
+
+});
diff --git a/apps/server/spec/etapi/patch-note.spec.ts b/apps/server/spec/etapi/patch-note.spec.ts
new file mode 100644
index 000000000..178808762
--- /dev/null
+++ b/apps/server/spec/etapi/patch-note.spec.ts
@@ -0,0 +1,89 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdNoteId: string;
+
+describe("etapi/patch-note", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ const response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "parentNoteId": "root",
+ "title": "Hello",
+ "type": "code",
+ "mime": "application/json",
+ "content": "{}"
+ })
+ .expect(201);
+
+ const createdNoteId = response.body.note.noteId as string;
+ expect(createdNoteId).toBeTruthy();
+ });
+
+ it("obtains correct note information", async () => {
+ await expectNoteToMatch({
+ title: "Hello",
+ type: "code",
+ mime: "application/json"
+ });
+ });
+
+ it("patches type, mime and creation dates", async () => {
+ const changes = {
+ "title": "Wassup",
+ "type": "html",
+ "mime": "text/html",
+ "dateCreated": "2023-08-21 23:38:51.123+0200",
+ "utcDateCreated": "2023-08-21 23:38:51.123Z"
+ };
+ await supertest(app)
+ .patch(`/etapi/notes/${createdNoteId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .send(changes)
+ .expect(200);
+ await expectNoteToMatch(changes);
+ });
+
+ it("refuses setting protection", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/notes/${createdNoteId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ isProtected: true
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_NOT_ALLOWED");
+ });
+
+ it("refuses incorrect type", async () => {
+ const response = await supertest(app)
+ .patch(`/etapi/notes/${createdNoteId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ title: true
+ })
+ .expect(400);
+ expect(response.body.code).toStrictEqual("PROPERTY_VALIDATION_ERROR");
+ });
+
+ async function expectNoteToMatch(state: object) {
+ const response = await supertest(app)
+ .get(`/etapi/notes/${createdNoteId}`)
+ .auth("etapi", token, { "type": "basic"})
+ .expect(200);
+ expect(response.body).toMatchObject(state);
+ }
+});
diff --git a/apps/server/spec/etapi/post-revision.spec.ts b/apps/server/spec/etapi/post-revision.spec.ts
new file mode 100644
index 000000000..20b4d15dd
--- /dev/null
+++ b/apps/server/spec/etapi/post-revision.spec.ts
@@ -0,0 +1,29 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let createdNoteId: string;
+
+describe("etapi/post-revision", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+ createdNoteId = await createNote(app, token);
+ });
+
+ it("posts note revision", async () => {
+ await supertest(app)
+ .post(`/etapi/notes/${createdNoteId}/revision`)
+ .auth(USER, token, { "type": "basic"})
+ .send("Changed content")
+ .expect(204);
+ });
+});
diff --git a/apps/server/spec/etapi/search.spec.ts b/apps/server/spec/etapi/search.spec.ts
new file mode 100644
index 000000000..bfd14e740
--- /dev/null
+++ b/apps/server/spec/etapi/search.spec.ts
@@ -0,0 +1,40 @@
+import { Application } from "express";
+import { beforeAll, describe, expect, it } from "vitest";
+import supertest from "supertest";
+import { createNote, login } from "./utils.js";
+import config from "../../src/services/config.js";
+import { randomUUID } from "crypto";
+
+let app: Application;
+let token: string;
+
+const USER = "etapi";
+let content: string;
+
+describe("etapi/search", () => {
+ beforeAll(async () => {
+ config.General.noAuthentication = false;
+ const buildApp = (await (import("../../src/app.js"))).default;
+ app = await buildApp();
+ token = await login(app);
+
+ content = randomUUID();
+ await createNote(app, token, content);
+ });
+
+ it("finds by content", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/notes?search=${content}&debug=true`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.body.results).toHaveLength(1);
+ });
+
+ it("does not find by content when fast search is on", async () => {
+ const response = await supertest(app)
+ .get(`/etapi/notes?search=${content}&debug=true&fastSearch=true`)
+ .auth(USER, token, { "type": "basic"})
+ .expect(200);
+ expect(response.body.results).toHaveLength(0);
+ });
+});
diff --git a/apps/server/spec/etapi/utils.ts b/apps/server/spec/etapi/utils.ts
new file mode 100644
index 000000000..140c6820d
--- /dev/null
+++ b/apps/server/spec/etapi/utils.ts
@@ -0,0 +1,33 @@
+import type { Application } from "express";
+import supertest from "supertest";
+import { expect } from "vitest";
+
+export async function login(app: Application) {
+ // Obtain auth token.
+ const response = await supertest(app)
+ .post("/etapi/auth/login")
+ .send({
+ "password": "demo1234"
+ })
+ .expect(201);
+ const token = response.body.authToken;
+ expect(token).toBeTruthy();
+ return token;
+}
+
+export async function createNote(app: Application, token: string, content?: string) {
+ const response = await supertest(app)
+ .post("/etapi/create-note")
+ .auth("etapi", token, { "type": "basic"})
+ .send({
+ "parentNoteId": "root",
+ "title": "Hello",
+ "type": "text",
+ "content": content ?? "Hi there!",
+ })
+ .expect(201);
+
+ const noteId = response.body.note.noteId as string;
+ expect(noteId).toStrictEqual(noteId);
+ return noteId;
+}
diff --git a/apps/server/spec/setup.ts b/apps/server/spec/setup.ts
index 2fae6e73c..74e7ff746 100644
--- a/apps/server/spec/setup.ts
+++ b/apps/server/spec/setup.ts
@@ -3,6 +3,13 @@ import i18next from "i18next";
import { join } from "path";
import dayjs from "dayjs";
+// Initialize environment variables.
+process.env.TRILIUM_DATA_DIR = join(__dirname, "db");
+process.env.TRILIUM_RESOURCE_DIR = join(__dirname, "../src");
+process.env.TRILIUM_INTEGRATION_TEST = "memory";
+process.env.TRILIUM_ENV = "dev";
+process.env.TRILIUM_PUBLIC_SERVER = "http://localhost:4200";
+
beforeAll(async () => {
// Initialize the translations manually to avoid any side effects.
const Backend = (await import("i18next-fs-backend")).default;
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json b/apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json
index f5f7da775..a6eecd810 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json
+++ b/apps/server/src/assets/doc_notes/en/User Guide/!!!meta.json
@@ -1 +1 @@
-[{"id":"_help_Otzi9La2YAUX","title":"Installation & Setup","type":"book","attributes":[{"name":"iconClass","value":"bx bx-cog","type":"label"}],"children":[{"id":"_help_poXkQfguuA0U","title":"Desktop Installation","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Desktop Installation"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WOcw2SLH6tbX","title":"Server Installation","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_Dgg7bR3b6K9j","title":"1. Installing the server","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_3tW6mORuTHnB","title":"Packaged version for Linux","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux"},{"name":"iconClass","value":"bx bxl-tux","type":"label"}]},{"id":"_help_rWX5eY045zbE","title":"Using Docker","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker"},{"name":"iconClass","value":"bx bxl-docker","type":"label"}]},{"id":"_help_moVgBcoxE3EK","title":"On NixOS","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/On NixOS"},{"name":"iconClass","value":"bx bxl-tux","type":"label"}]},{"id":"_help_J1Bb6lVlwU5T","title":"Manually","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manually"},{"name":"iconClass","value":"bx bx-code-alt","type":"label"}]},{"id":"_help_DCmT6e7clMoP","title":"Using Kubernetes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Kubernetes"},{"name":"iconClass","value":"bx bxl-kubernetes","type":"label"}]},{"id":"_help_klCWNks3ReaQ","title":"Multiple server instances","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Multiple server instances"},{"name":"iconClass","value":"bx bxs-user-account","type":"label"}]}]},{"id":"_help_vcjrb3VVYPZI","title":"2. Reverse proxy","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_ud6MShXL4WpO","title":"Nginx","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_fDLvzOx29Pfg","title":"Apache","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Apache"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_l2VkvOwUNfZj","title":"TLS Configuration","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_cbkrhQjrkKrh","title":"Synchronization","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Synchronization"},{"name":"iconClass","value":"bx bx-sync","type":"label"}]},{"id":"_help_RDslemsQ6gCp","title":"Mobile Frontend","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Mobile Frontend"},{"name":"iconClass","value":"bx bx-mobile-alt","type":"label"}]},{"id":"_help_MtPxeAWVAzMg","title":"Web Clipper","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Web Clipper"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_n1lujUxCwipy","title":"Upgrading TriliumNext","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Upgrading TriliumNext"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_ODY7qQn5m2FT","title":"Backup","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Backup"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_tAassRL4RSQL","title":"Data directory","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Data directory"},{"name":"iconClass","value":"bx bx-folder-open","type":"label"}]}]},{"id":"_help_gh7bpGYxajRS","title":"Basic Concepts and Features","type":"book","attributes":[{"name":"iconClass","value":"bx bx-help-circle","type":"label"}],"children":[{"id":"_help_Vc8PjrjAGuOp","title":"UI Elements","type":"book","attributes":[{"name":"iconClass","value":"bx bx-window-alt","type":"label"}],"children":[{"id":"_help_x0JgW8UqGXvq","title":"Vertical and horizontal layout","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Vertical and horizontal layout"},{"name":"iconClass","value":"bx bxs-layout","type":"label"}]},{"id":"_help_x3i7MxGccDuM","title":"Global menu","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu"},{"name":"iconClass","value":"bx bx-menu","type":"label"}]},{"id":"_help_oPVyFC7WL2Lp","title":"Note Tree","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree"},{"name":"iconClass","value":"bx bxs-tree-alt","type":"label"}],"children":[{"id":"_help_YtSN43OrfzaA","title":"Note tree contextual menu","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu"},{"name":"iconClass","value":"bx bx-menu","type":"label"}]},{"id":"_help_yTjUdsOi4CIE","title":"Multiple selection","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection"},{"name":"iconClass","value":"bx bx-list-plus","type":"label"}]}]},{"id":"_help_BlN9DFI679QC","title":"Ribbon","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon"},{"name":"iconClass","value":"bx bx-dots-horizontal","type":"label"}]},{"id":"_help_3seOhtN8uLIY","title":"Tabs","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs"},{"name":"iconClass","value":"bx bx-dock-top","type":"label"}]},{"id":"_help_xYmIYSP6wE3F","title":"Launch Bar","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar"},{"name":"iconClass","value":"bx bx-sidebar","type":"label"}]},{"id":"_help_8YBEPzcpUgxw","title":"Note buttons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note buttons"},{"name":"iconClass","value":"bx bx-dots-vertical-rounded","type":"label"}]},{"id":"_help_4TIF1oA4VQRO","title":"Options","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Options"},{"name":"iconClass","value":"bx bx-cog","type":"label"}]},{"id":"_help_luNhaphA37EO","title":"Split View","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Split View"},{"name":"iconClass","value":"bx bx-dock-right","type":"label"}]},{"id":"_help_XpOYSgsLkTJy","title":"Floating buttons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons"},{"name":"iconClass","value":"bx bx-rectangle","type":"label"}]},{"id":"_help_RnaPdbciOfeq","title":"Right Sidebar","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar"},{"name":"iconClass","value":"bx bxs-dock-right","type":"label"}]},{"id":"_help_r5JGHN99bVKn","title":"Recent Changes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Recent Changes"},{"name":"iconClass","value":"bx bx-history","type":"label"}]},{"id":"_help_ny318J39E5Z0","title":"Zoom","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Zoom"},{"name":"iconClass","value":"bx bx-zoom-in","type":"label"}]}]},{"id":"_help_BFs8mudNFgCS","title":"Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes"},{"name":"iconClass","value":"bx bx-notepad","type":"label"}],"children":[{"id":"_help_p9kXRFAkwN4o","title":"Note Icons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons"},{"name":"iconClass","value":"bx bxs-grid","type":"label"}]},{"id":"_help_0vhv7lsOLy82","title":"Attachments","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Attachments"},{"name":"iconClass","value":"bx bx-paperclip","type":"label"}]},{"id":"_help_IakOLONlIfGI","title":"Cloning Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes"},{"name":"iconClass","value":"bx bx-duplicate","type":"label"}],"children":[{"id":"_help_TBwsyfadTA18","title":"Branch prefix","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes/Branch prefix"},{"name":"iconClass","value":"bx bx-rename","type":"label"}]}]},{"id":"_help_bwg0e8ewQMak","title":"Protected Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes"},{"name":"iconClass","value":"bx bx-lock-alt","type":"label"}]},{"id":"_help_MKmLg5x6xkor","title":"Archived Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes"},{"name":"iconClass","value":"bx bx-box","type":"label"}]},{"id":"_help_vZWERwf8U3nx","title":"Note Revisions","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note Revisions"},{"name":"iconClass","value":"bx bx-history","type":"label"}]},{"id":"_help_aGlEvb9hyDhS","title":"Sorting Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes"},{"name":"iconClass","value":"bx bx-sort-up","type":"label"}]},{"id":"_help_NRnIZmSMc5sj","title":"Export as PDF","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Export as PDF"},{"name":"iconClass","value":"bx bxs-file-pdf","type":"label"}]},{"id":"_help_CoFPLs3dRlXc","title":"Read-Only Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Read-Only Notes"},{"name":"iconClass","value":"bx bx-edit-alt","type":"label"}]},{"id":"_help_0ESUbbAxVnoK","title":"Note List","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note List"},{"name":"iconClass","value":"bx bxs-grid","type":"label"}],"children":[{"id":"_help_xWbu3jpNWapp","title":"Calendar View","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note List/Calendar View"},{"name":"iconClass","value":"bx bx-calendar","type":"label"}]}]}]},{"id":"_help_wArbEsdSae6g","title":"Navigation","type":"book","attributes":[{"name":"iconClass","value":"bx bx-navigation","type":"label"}],"children":[{"id":"_help_kBrnXNG3Hplm","title":"Tree Concepts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Tree Concepts"},{"name":"iconClass","value":"bx bx-pyramid","type":"label"}]},{"id":"_help_MMiBEQljMQh2","title":"Note Navigation","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation"},{"name":"iconClass","value":"bx bxs-navigation","type":"label"}]},{"id":"_help_Ms1nauBra7gq","title":"Quick search","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search"},{"name":"iconClass","value":"bx bx-search-alt-2","type":"label"}]},{"id":"_help_F1r9QtzQLZqm","title":"Jump to Note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Jump to Note"},{"name":"iconClass","value":"bx bx-send","type":"label"}]},{"id":"_help_eIg8jdvaoNNd","title":"Search","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Search"},{"name":"iconClass","value":"bx bx-search-alt-2","type":"label"}]},{"id":"_help_u3YFHC9tQlpm","title":"Bookmarks","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks"},{"name":"iconClass","value":"bx bx-bookmarks","type":"label"}]},{"id":"_help_OR8WJ7Iz9K4U","title":"Note Hoisting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting"},{"name":"iconClass","value":"bx bxs-chevrons-up","type":"label"}]},{"id":"_help_9sRHySam5fXb","title":"Workspaces","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces"},{"name":"iconClass","value":"bx bx-door-open","type":"label"}]},{"id":"_help_xWtq5NUHOwql","title":"Similar Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes"},{"name":"iconClass","value":"bx bx-bar-chart","type":"label"}]},{"id":"_help_McngOG2jbUWX","title":"Search in note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note"},{"name":"iconClass","value":"bx bx-search-alt-2","type":"label"}]}]},{"id":"_help_A9Oc6YKKc65v","title":"Keyboard Shortcuts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts"},{"name":"iconClass","value":"bx bxs-keyboard","type":"label"}]},{"id":"_help_Wy267RK4M69c","title":"Themes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Themes"},{"name":"iconClass","value":"bx bx-palette","type":"label"}],"children":[{"id":"_help_VbjZvtUek0Ln","title":"Theme Gallery","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Themes/Theme Gallery"},{"name":"iconClass","value":"bx bx-book-reader","type":"label"}]}]},{"id":"_help_mHbBMPDPkVV5","title":"Import & Export","type":"book","attributes":[{"name":"iconClass","value":"bx bx-import","type":"label"}],"children":[{"id":"_help_Oau6X9rCuegd","title":"Markdown","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown"},{"name":"iconClass","value":"bx bxl-markdown","type":"label"}]},{"id":"_help_syuSEKf2rUGr","title":"Evernote","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Import & Export/Evernote"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_GnhlmrATVqcH","title":"OneNote","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Import & Export/OneNote"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_rC3pL2aptaRE","title":"Zen mode","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Zen mode"},{"name":"iconClass","value":"bx bxs-yin-yang","type":"label"}]}]},{"id":"_help_s3YCWHBfmYuM","title":"Quick Start","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Quick Start"},{"name":"iconClass","value":"bx bx-run","type":"label"}]},{"id":"_help_i6dbnitykE5D","title":"FAQ","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/FAQ"},{"name":"iconClass","value":"bx bx-question-mark","type":"label"}]},{"id":"_help_KSZ04uQ2D1St","title":"Note Types","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types"},{"name":"iconClass","value":"bx bx-edit","type":"label"}],"children":[{"id":"_help_iPIMuisry3hd","title":"Text","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text"},{"name":"iconClass","value":"bx bx-note","type":"label"}],"children":[{"id":"_help_NwBbFdNZ9h7O","title":"Block quotes & admonitions","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Block quotes & admonitions"},{"name":"iconClass","value":"bx bx-info-circle","type":"label"}]},{"id":"_help_oSuaNgyyKnhu","title":"Bookmarks","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Bookmarks"},{"name":"iconClass","value":"bx bx-bookmark","type":"label"}]},{"id":"_help_veGu4faJErEM","title":"Content language & Right-to-left support","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Content language & Right-to-le"},{"name":"iconClass","value":"bx bx-align-right","type":"label"}]},{"id":"_help_2x0ZAX9ePtzV","title":"Cut to subnote","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Cut to subnote"},{"name":"iconClass","value":"bx bx-cut","type":"label"}]},{"id":"_help_UYuUB1ZekNQU","title":"Developer-specific formatting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Developer-specific formatting"},{"name":"iconClass","value":"bx bx-code-alt","type":"label"}],"children":[{"id":"_help_QxEyIjRBizuC","title":"Code blocks","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Developer-specific formatting/Code blocks"},{"name":"iconClass","value":"bx bx-code","type":"label"}]}]},{"id":"_help_AgjCISero73a","title":"Footnotes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Footnotes"},{"name":"iconClass","value":"bx bx-bracket","type":"label"}]},{"id":"_help_nRhnJkTT8cPs","title":"Formatting toolbar","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Formatting toolbar"},{"name":"iconClass","value":"bx bx-text","type":"label"}]},{"id":"_help_Gr6xFaF6ioJ5","title":"General formatting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/General formatting"},{"name":"iconClass","value":"bx bx-bold","type":"label"}]},{"id":"_help_AxshuNRegLAv","title":"Highlights list","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Highlights list"},{"name":"iconClass","value":"bx bx-highlight","type":"label"}]},{"id":"_help_mT0HEkOsz6i1","title":"Images","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Images"},{"name":"iconClass","value":"bx bx-image-alt","type":"label"}],"children":[{"id":"_help_0Ofbk1aSuVRu","title":"Image references","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Images/Image references"},{"name":"iconClass","value":"bx bxs-file-image","type":"label"}]}]},{"id":"_help_nBAXQFj20hS1","title":"Include Note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Include Note"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_CohkqWQC1iBv","title":"Insert buttons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Insert buttons"},{"name":"iconClass","value":"bx bx-plus","type":"label"}]},{"id":"_help_oiVPnW8QfnvS","title":"Keyboard shortcuts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Keyboard shortcuts"},{"name":"iconClass","value":"bx bxs-keyboard","type":"label"}]},{"id":"_help_QEAPj01N5f7w","title":"Links","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Links"},{"name":"iconClass","value":"bx bx-link-alt","type":"label"}]},{"id":"_help_S6Xx8QIWTV66","title":"Lists","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Lists"},{"name":"iconClass","value":"bx bx-list-ul","type":"label"}]},{"id":"_help_QrtTYPmdd1qq","title":"Markdown-like formatting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Markdown-like formatting"},{"name":"iconClass","value":"bx bxl-markdown","type":"label"}]},{"id":"_help_YfYAtQBcfo5V","title":"Math Equations","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Math Equations"},{"name":"iconClass","value":"bx bx-math","type":"label"}]},{"id":"_help_dEHYtoWWi8ct","title":"Other features","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Other features"},{"name":"iconClass","value":"bx bxs-grid","type":"label"}]},{"id":"_help_BFvAtE74rbP6","title":"Table of contents","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Table of contents"},{"name":"iconClass","value":"bx bx-heading","type":"label"}]},{"id":"_help_NdowYOC1GFKS","title":"Tables","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Tables"},{"name":"iconClass","value":"bx bx-table","type":"label"}]}]},{"id":"_help_6f9hih2hXXZk","title":"Code","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Code"},{"name":"iconClass","value":"bx bx-code","type":"label"}]},{"id":"_help_m523cpzocqaD","title":"Saved Search","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Saved Search"},{"name":"iconClass","value":"bx bx-file-find","type":"label"}]},{"id":"_help_iRwzGnHPzonm","title":"Relation Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Relation Map"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]},{"id":"_help_bdUJEHsAPYQR","title":"Note Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Note Map"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]},{"id":"_help_HcABDtFCkbFN","title":"Render Note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Render Note"},{"name":"iconClass","value":"bx bx-extension","type":"label"}]},{"id":"_help_GTwFsgaA0lCt","title":"Book","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Book"},{"name":"iconClass","value":"bx bx-book","type":"label"}]},{"id":"_help_s1aBHPd79XYj","title":"Mermaid Diagrams","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Mermaid Diagrams"},{"name":"iconClass","value":"bx bx-selection","type":"label"}],"children":[{"id":"_help_RH6yLjjWJHof","title":"ELK layout","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]}]},{"id":"_help_grjYqerjn243","title":"Canvas","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Canvas"},{"name":"iconClass","value":"bx bx-pen","type":"label"}]},{"id":"_help_1vHRoWCEjj0L","title":"Web View","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Web View"},{"name":"iconClass","value":"bx bx-globe-alt","type":"label"}]},{"id":"_help_gBbsAeiuUxI5","title":"Mind Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Mind Map"},{"name":"iconClass","value":"bx bx-sitemap","type":"label"}]},{"id":"_help_81SGnPGMk7Xc","title":"Geo Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Geo Map"},{"name":"iconClass","value":"bx bx-map-alt","type":"label"}]},{"id":"_help_W8vYD3Q1zjCR","title":"File","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/File"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_BgmBlOIl72jZ","title":"Troubleshooting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting"},{"name":"iconClass","value":"bx bx-bug","type":"label"}],"children":[{"id":"_help_wy8So3yZZlH9","title":"Reporting issues","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Reporting issues"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_x59R8J8KV5Bp","title":"Anonymized Database","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Anonymized Database"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_qzNzp9LYQyPT","title":"Error logs","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Error logs"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_vdlYGAcpXAgc","title":"Synchronization fails with 504 Gateway Timeout","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Synchronization fails with 504"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_s8alTXmpFR61","title":"Refreshing the application","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Refreshing the application"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_pKK96zzmvBGf","title":"Theme development","type":"book","attributes":[{"name":"iconClass","value":"bx bx-palette","type":"label"}],"children":[{"id":"_help_7NfNr5pZpVKV","title":"Creating a custom theme","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Creating a custom theme"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WFGzWeUK6arS","title":"Customize the Next theme","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Customize the Next theme"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WN5z4M8ASACJ","title":"Reference","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Reference"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_AlhDUqhENtH7","title":"Custom app-wide CSS","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Custom app-wide CSS"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_tC7s2alapj8V","title":"Advanced Usage","type":"book","attributes":[{"name":"iconClass","value":"bx bx-rocket","type":"label"}],"children":[{"id":"_help_zEY4DaJG4YT5","title":"Attributes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes"},{"name":"iconClass","value":"bx bx-list-check","type":"label"}],"children":[{"id":"_help_HI6GBBIduIgv","title":"Labels","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Labels"},{"name":"iconClass","value":"bx bx-hash","type":"label"}]},{"id":"_help_Cq5X6iKQop6R","title":"Relations","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Relations"},{"name":"iconClass","value":"bx bx-transfer","type":"label"}]},{"id":"_help_bwZpz2ajCEwO","title":"Attribute Inheritance","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance"},{"name":"iconClass","value":"bx bx-list-plus","type":"label"}]},{"id":"_help_OFXdgB2nNk1F","title":"Promoted Attributes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes"},{"name":"iconClass","value":"bx bx-table","type":"label"}]}]},{"id":"_help_KC1HB96bqqHX","title":"Templates","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Templates"},{"name":"iconClass","value":"bx bx-copy","type":"label"}]},{"id":"_help_BCkXAVs63Ttv","title":"Note Map (Link map, Tree map)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map)"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]},{"id":"_help_R9pX4DGra2Vt","title":"Sharing","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Sharing"},{"name":"iconClass","value":"bx bx-share-alt","type":"label"}],"children":[{"id":"_help_Qjt68inQ2bRj","title":"Serving directly the content of a note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content o"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_5668rwcirq1t","title":"Advanced Showcases","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_l0tKav7yLHGF","title":"Day Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes"},{"name":"iconClass","value":"bx bx-calendar","type":"label"}]},{"id":"_help_R7abl2fc6Mxi","title":"Weight Tracker","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_xYjQUYhpbUEW","title":"Task Manager","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager"},{"name":"iconClass","value":"bx bx-calendar-check","type":"label"}]}]},{"id":"_help_J5Ex1ZrMbyJ6","title":"Custom Request Handler","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Custom Request Handler"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_d3fAXQ2diepH","title":"Custom Resource Providers","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Custom Resource Providers"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_pgxEVkzLl1OP","title":"ETAPI (REST API)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/ETAPI (REST API)"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_9qPsTWBorUhQ","title":"API Reference","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"/etapi/docs"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_47ZrP6FNuoG8","title":"Default Note Title","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Default Note Title"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_wX4HbRucYSDD","title":"Database","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database"},{"name":"iconClass","value":"bx bx-data","type":"label"}],"children":[{"id":"_help_oyIAJ9PvvwHX","title":"Manually altering the database","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database/Manually altering the database"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_YKWqdJhzi2VY","title":"SQL Console","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database/Manually altering the database/SQL Console"},{"name":"iconClass","value":"bx bx-data","type":"label"}]}]},{"id":"_help_6tZeKvSHEUiB","title":"Demo Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database/Demo Notes"},{"name":"iconClass","value":"bx bx-package","type":"label"}]}]},{"id":"_help_Gzjqa934BdH4","title":"Configuration (config.ini or environment variables)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Configuration (config.ini or e"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_c5xB8m4g2IY6","title":"Trilium instance","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Trilium instance"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_LWtBjFej3wX3","title":"Cross-Origin Resource Sharing (CORS)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Cross-Origin Resource Sharing "},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_ivYnonVFBxbQ","title":"Bulk Actions","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Bulk Actions"},{"name":"iconClass","value":"bx bx-list-plus","type":"label"}]},{"id":"_help_4FahAwuGTAwC","title":"Note source","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Note source"},{"name":"iconClass","value":"bx bx-code","type":"label"}]},{"id":"_help_1YeN2MzFUluU","title":"Technologies used","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used"},{"name":"iconClass","value":"bx bxs-component","type":"label"}],"children":[{"id":"_help_MI26XDLSAlCD","title":"CKEditor","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/CKEditor"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_N4IDkixaDG9C","title":"MindElixir","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/MindElixir"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_H0mM1lTxF9JI","title":"Excalidraw","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/Excalidraw"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_MQHyy2dIFgxS","title":"Leaflet","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/Leaflet"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_m1lbrzyKDaRB","title":"Note ID","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Note ID"},{"name":"iconClass","value":"bx bx-hash","type":"label"}]},{"id":"_help_0vTSyvhPTAOz","title":"Internal API","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_z8O2VG4ZZJD7","title":"API Reference","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"/api/docs"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_2mUhVmZK8RF3","title":"Hidden Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Hidden Notes"},{"name":"iconClass","value":"bx bx-hide","type":"label"}]},{"id":"_help_uYF7pmepw27K","title":"Metrics","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Metrics"},{"name":"iconClass","value":"bx bxs-data","type":"label"}]}]},{"id":"_help_LMAv4Uy3Wk6J","title":"AI","type":"book","attributes":[{"name":"iconClass","value":"bx bx-bot","type":"label"}],"children":[{"id":"_help_GBBMSlVSOIGP","title":"Introduction","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/Introduction"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WkM7gsEUyCXs","title":"AI Provider Information","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_7EdTxPADv95W","title":"Ollama","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_vvUCN7FDkq7G","title":"Installing Ollama","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information/Ollama/Installing Ollama"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_ZavFigBX9AwP","title":"OpenAI","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information/OpenAI"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_e0lkirXEiSNc","title":"Anthropic","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information/Anthropic"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]}]},{"id":"_help_CdNpE2pqjmI6","title":"Scripting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting"},{"name":"iconClass","value":"bx bxs-file-js","type":"label"}],"children":[{"id":"_help_yIhgI5H7A2Sm","title":"Frontend Basics","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Frontend Basics"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_es8OU2GuguFU","title":"Examples","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_TjLYAo3JMO8X","title":"\"New Task\" launcher button","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Examples/New Task launcher button"},{"name":"iconClass","value":"bx bx-task","type":"label"}]},{"id":"_help_7kZPMD0uFwkH","title":"Downloading responses from Google Forms","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Examples/Downloading responses from Goo"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_DL92EjAaXT26","title":"Using promoted attributes to configure scripts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Examples/Using promoted attributes to c"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_GPERMystNGTB","title":"Events","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Events"},{"name":"iconClass","value":"bx bx-rss","type":"label"}]},{"id":"_help_MgibgPcfeuGz","title":"Custom Widgets","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Custom Widgets"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_YNxAqkI5Kg1M","title":"Word count widget","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Custom Widgets/Word count widget"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_SynTBQiBsdYJ","title":"Widget Basics","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Custom Widgets/Widget Basics"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_GLks18SNjxmC","title":"Script API","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Script API"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_Q2z6av6JZVWm","title":"Frontend API","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://triliumnext.github.io/Notes/Script%20API/interfaces/Frontend_Script_API.Api.html"},{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_habiZ3HU8Kw8","title":"FNote","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://triliumnext.github.io/Notes/Script%20API/classes/Frontend_Script_API.FNote.html"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_MEtfsqa5VwNi","title":"Backend API","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://triliumnext.github.io/Notes/Script%20API/interfaces/Backend_Script_API.Api.html"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]}]}]
\ No newline at end of file
+[{"id":"_help_Otzi9La2YAUX","title":"Installation & Setup","type":"book","attributes":[{"name":"iconClass","value":"bx bx-cog","type":"label"}],"children":[{"id":"_help_poXkQfguuA0U","title":"Desktop Installation","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Desktop Installation"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WOcw2SLH6tbX","title":"Server Installation","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_Dgg7bR3b6K9j","title":"1. Installing the server","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_3tW6mORuTHnB","title":"Packaged version for Linux","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux"},{"name":"iconClass","value":"bx bxl-tux","type":"label"}]},{"id":"_help_rWX5eY045zbE","title":"Using Docker","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Docker"},{"name":"iconClass","value":"bx bxl-docker","type":"label"}]},{"id":"_help_moVgBcoxE3EK","title":"On NixOS","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/On NixOS"},{"name":"iconClass","value":"bx bxl-tux","type":"label"}]},{"id":"_help_J1Bb6lVlwU5T","title":"Manually","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Manually"},{"name":"iconClass","value":"bx bx-code-alt","type":"label"}]},{"id":"_help_DCmT6e7clMoP","title":"Using Kubernetes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Using Kubernetes"},{"name":"iconClass","value":"bx bxl-kubernetes","type":"label"}]},{"id":"_help_klCWNks3ReaQ","title":"Multiple server instances","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Multiple server instances"},{"name":"iconClass","value":"bx bxs-user-account","type":"label"}]}]},{"id":"_help_vcjrb3VVYPZI","title":"2. Reverse proxy","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_ud6MShXL4WpO","title":"Nginx","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Nginx"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_fDLvzOx29Pfg","title":"Apache","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/2. Reverse proxy/Apache"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_l2VkvOwUNfZj","title":"TLS Configuration","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Server Installation/TLS Configuration"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_cbkrhQjrkKrh","title":"Synchronization","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Synchronization"},{"name":"iconClass","value":"bx bx-sync","type":"label"}]},{"id":"_help_RDslemsQ6gCp","title":"Mobile Frontend","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Mobile Frontend"},{"name":"iconClass","value":"bx bx-mobile-alt","type":"label"}]},{"id":"_help_MtPxeAWVAzMg","title":"Web Clipper","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Web Clipper"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_n1lujUxCwipy","title":"Upgrading TriliumNext","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Upgrading TriliumNext"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_ODY7qQn5m2FT","title":"Backup","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Backup"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_tAassRL4RSQL","title":"Data directory","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Installation & Setup/Data directory"},{"name":"iconClass","value":"bx bx-folder-open","type":"label"}]}]},{"id":"_help_gh7bpGYxajRS","title":"Basic Concepts and Features","type":"book","attributes":[{"name":"iconClass","value":"bx bx-help-circle","type":"label"}],"children":[{"id":"_help_Vc8PjrjAGuOp","title":"UI Elements","type":"book","attributes":[{"name":"iconClass","value":"bx bx-window-alt","type":"label"}],"children":[{"id":"_help_x0JgW8UqGXvq","title":"Vertical and horizontal layout","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Vertical and horizontal layout"},{"name":"iconClass","value":"bx bxs-layout","type":"label"}]},{"id":"_help_x3i7MxGccDuM","title":"Global menu","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Global menu"},{"name":"iconClass","value":"bx bx-menu","type":"label"}]},{"id":"_help_oPVyFC7WL2Lp","title":"Note Tree","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree"},{"name":"iconClass","value":"bx bxs-tree-alt","type":"label"}],"children":[{"id":"_help_YtSN43OrfzaA","title":"Note tree contextual menu","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Note tree contextual menu"},{"name":"iconClass","value":"bx bx-menu","type":"label"}]},{"id":"_help_yTjUdsOi4CIE","title":"Multiple selection","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note Tree/Multiple selection"},{"name":"iconClass","value":"bx bx-list-plus","type":"label"}]}]},{"id":"_help_BlN9DFI679QC","title":"Ribbon","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Ribbon"},{"name":"iconClass","value":"bx bx-dots-horizontal","type":"label"}]},{"id":"_help_3seOhtN8uLIY","title":"Tabs","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Tabs"},{"name":"iconClass","value":"bx bx-dock-top","type":"label"}]},{"id":"_help_xYmIYSP6wE3F","title":"Launch Bar","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Launch Bar"},{"name":"iconClass","value":"bx bx-sidebar","type":"label"}]},{"id":"_help_8YBEPzcpUgxw","title":"Note buttons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Note buttons"},{"name":"iconClass","value":"bx bx-dots-vertical-rounded","type":"label"}]},{"id":"_help_4TIF1oA4VQRO","title":"Options","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Options"},{"name":"iconClass","value":"bx bx-cog","type":"label"}]},{"id":"_help_luNhaphA37EO","title":"Split View","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Split View"},{"name":"iconClass","value":"bx bx-dock-right","type":"label"}]},{"id":"_help_XpOYSgsLkTJy","title":"Floating buttons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Floating buttons"},{"name":"iconClass","value":"bx bx-rectangle","type":"label"}]},{"id":"_help_RnaPdbciOfeq","title":"Right Sidebar","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Right Sidebar"},{"name":"iconClass","value":"bx bxs-dock-right","type":"label"}]},{"id":"_help_r5JGHN99bVKn","title":"Recent Changes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Recent Changes"},{"name":"iconClass","value":"bx bx-history","type":"label"}]},{"id":"_help_ny318J39E5Z0","title":"Zoom","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/UI Elements/Zoom"},{"name":"iconClass","value":"bx bx-zoom-in","type":"label"}]}]},{"id":"_help_BFs8mudNFgCS","title":"Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes"},{"name":"iconClass","value":"bx bx-notepad","type":"label"}],"children":[{"id":"_help_p9kXRFAkwN4o","title":"Note Icons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note Icons"},{"name":"iconClass","value":"bx bxs-grid","type":"label"}]},{"id":"_help_0vhv7lsOLy82","title":"Attachments","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Attachments"},{"name":"iconClass","value":"bx bx-paperclip","type":"label"}]},{"id":"_help_IakOLONlIfGI","title":"Cloning Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes"},{"name":"iconClass","value":"bx bx-duplicate","type":"label"}],"children":[{"id":"_help_TBwsyfadTA18","title":"Branch prefix","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Cloning Notes/Branch prefix"},{"name":"iconClass","value":"bx bx-rename","type":"label"}]}]},{"id":"_help_bwg0e8ewQMak","title":"Protected Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Protected Notes"},{"name":"iconClass","value":"bx bx-lock-alt","type":"label"}]},{"id":"_help_MKmLg5x6xkor","title":"Archived Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Archived Notes"},{"name":"iconClass","value":"bx bx-box","type":"label"}]},{"id":"_help_vZWERwf8U3nx","title":"Note Revisions","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note Revisions"},{"name":"iconClass","value":"bx bx-history","type":"label"}]},{"id":"_help_aGlEvb9hyDhS","title":"Sorting Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Sorting Notes"},{"name":"iconClass","value":"bx bx-sort-up","type":"label"}]},{"id":"_help_NRnIZmSMc5sj","title":"Export as PDF","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Export as PDF"},{"name":"iconClass","value":"bx bxs-file-pdf","type":"label"}]},{"id":"_help_CoFPLs3dRlXc","title":"Read-Only Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Read-Only Notes"},{"name":"iconClass","value":"bx bx-edit-alt","type":"label"}]},{"id":"_help_0ESUbbAxVnoK","title":"Note List","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note List"},{"name":"iconClass","value":"bx bxs-grid","type":"label"}],"children":[{"id":"_help_xWbu3jpNWapp","title":"Calendar View","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Notes/Note List/Calendar View"},{"name":"iconClass","value":"bx bx-calendar","type":"label"}]}]}]},{"id":"_help_wArbEsdSae6g","title":"Navigation","type":"book","attributes":[{"name":"iconClass","value":"bx bx-navigation","type":"label"}],"children":[{"id":"_help_kBrnXNG3Hplm","title":"Tree Concepts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Tree Concepts"},{"name":"iconClass","value":"bx bx-pyramid","type":"label"}]},{"id":"_help_MMiBEQljMQh2","title":"Note Navigation","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Note Navigation"},{"name":"iconClass","value":"bx bxs-navigation","type":"label"}]},{"id":"_help_Ms1nauBra7gq","title":"Quick search","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Quick search"},{"name":"iconClass","value":"bx bx-search-alt-2","type":"label"}]},{"id":"_help_F1r9QtzQLZqm","title":"Jump to Note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Jump to Note"},{"name":"iconClass","value":"bx bx-send","type":"label"}]},{"id":"_help_eIg8jdvaoNNd","title":"Search","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Search"},{"name":"iconClass","value":"bx bx-search-alt-2","type":"label"}]},{"id":"_help_u3YFHC9tQlpm","title":"Bookmarks","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Bookmarks"},{"name":"iconClass","value":"bx bx-bookmarks","type":"label"}]},{"id":"_help_OR8WJ7Iz9K4U","title":"Note Hoisting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Note Hoisting"},{"name":"iconClass","value":"bx bxs-chevrons-up","type":"label"}]},{"id":"_help_9sRHySam5fXb","title":"Workspaces","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Workspaces"},{"name":"iconClass","value":"bx bx-door-open","type":"label"}]},{"id":"_help_xWtq5NUHOwql","title":"Similar Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Similar Notes"},{"name":"iconClass","value":"bx bx-bar-chart","type":"label"}]},{"id":"_help_McngOG2jbUWX","title":"Search in note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Navigation/Search in note"},{"name":"iconClass","value":"bx bx-search-alt-2","type":"label"}]}]},{"id":"_help_A9Oc6YKKc65v","title":"Keyboard Shortcuts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts"},{"name":"iconClass","value":"bx bxs-keyboard","type":"label"}]},{"id":"_help_Wy267RK4M69c","title":"Themes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Themes"},{"name":"iconClass","value":"bx bx-palette","type":"label"}],"children":[{"id":"_help_VbjZvtUek0Ln","title":"Theme Gallery","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Themes/Theme Gallery"},{"name":"iconClass","value":"bx bx-book-reader","type":"label"}]}]},{"id":"_help_mHbBMPDPkVV5","title":"Import & Export","type":"book","attributes":[{"name":"iconClass","value":"bx bx-import","type":"label"}],"children":[{"id":"_help_Oau6X9rCuegd","title":"Markdown","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Import & Export/Markdown"},{"name":"iconClass","value":"bx bxl-markdown","type":"label"}]},{"id":"_help_syuSEKf2rUGr","title":"Evernote","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Import & Export/Evernote"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_GnhlmrATVqcH","title":"OneNote","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Import & Export/OneNote"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_rC3pL2aptaRE","title":"Zen mode","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Basic Concepts and Features/Zen mode"},{"name":"iconClass","value":"bx bxs-yin-yang","type":"label"}]}]},{"id":"_help_s3YCWHBfmYuM","title":"Quick Start","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Quick Start"},{"name":"iconClass","value":"bx bx-run","type":"label"}]},{"id":"_help_i6dbnitykE5D","title":"FAQ","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/FAQ"},{"name":"iconClass","value":"bx bx-question-mark","type":"label"}]},{"id":"_help_KSZ04uQ2D1St","title":"Note Types","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types"},{"name":"iconClass","value":"bx bx-edit","type":"label"}],"children":[{"id":"_help_iPIMuisry3hd","title":"Text","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text"},{"name":"iconClass","value":"bx bx-note","type":"label"}],"children":[{"id":"_help_NwBbFdNZ9h7O","title":"Block quotes & admonitions","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Block quotes & admonitions"},{"name":"iconClass","value":"bx bx-info-circle","type":"label"}]},{"id":"_help_oSuaNgyyKnhu","title":"Bookmarks","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Bookmarks"},{"name":"iconClass","value":"bx bx-bookmark","type":"label"}]},{"id":"_help_veGu4faJErEM","title":"Content language & Right-to-left support","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Content language & Right-to-le"},{"name":"iconClass","value":"bx bx-align-right","type":"label"}]},{"id":"_help_2x0ZAX9ePtzV","title":"Cut to subnote","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Cut to subnote"},{"name":"iconClass","value":"bx bx-cut","type":"label"}]},{"id":"_help_UYuUB1ZekNQU","title":"Developer-specific formatting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Developer-specific formatting"},{"name":"iconClass","value":"bx bx-code-alt","type":"label"}],"children":[{"id":"_help_QxEyIjRBizuC","title":"Code blocks","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Developer-specific formatting/Code blocks"},{"name":"iconClass","value":"bx bx-code","type":"label"}]}]},{"id":"_help_AgjCISero73a","title":"Footnotes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Footnotes"},{"name":"iconClass","value":"bx bx-bracket","type":"label"}]},{"id":"_help_nRhnJkTT8cPs","title":"Formatting toolbar","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Formatting toolbar"},{"name":"iconClass","value":"bx bx-text","type":"label"}]},{"id":"_help_Gr6xFaF6ioJ5","title":"General formatting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/General formatting"},{"name":"iconClass","value":"bx bx-bold","type":"label"}]},{"id":"_help_AxshuNRegLAv","title":"Highlights list","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Highlights list"},{"name":"iconClass","value":"bx bx-highlight","type":"label"}]},{"id":"_help_mT0HEkOsz6i1","title":"Images","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Images"},{"name":"iconClass","value":"bx bx-image-alt","type":"label"}],"children":[{"id":"_help_0Ofbk1aSuVRu","title":"Image references","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Images/Image references"},{"name":"iconClass","value":"bx bxs-file-image","type":"label"}]}]},{"id":"_help_nBAXQFj20hS1","title":"Include Note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Include Note"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_CohkqWQC1iBv","title":"Insert buttons","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Insert buttons"},{"name":"iconClass","value":"bx bx-plus","type":"label"}]},{"id":"_help_oiVPnW8QfnvS","title":"Keyboard shortcuts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Keyboard shortcuts"},{"name":"iconClass","value":"bx bxs-keyboard","type":"label"}]},{"id":"_help_QEAPj01N5f7w","title":"Links","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Links"},{"name":"iconClass","value":"bx bx-link-alt","type":"label"}]},{"id":"_help_S6Xx8QIWTV66","title":"Lists","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Lists"},{"name":"iconClass","value":"bx bx-list-ul","type":"label"}]},{"id":"_help_QrtTYPmdd1qq","title":"Markdown-like formatting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Markdown-like formatting"},{"name":"iconClass","value":"bx bxl-markdown","type":"label"}]},{"id":"_help_YfYAtQBcfo5V","title":"Math Equations","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Math Equations"},{"name":"iconClass","value":"bx bx-math","type":"label"}]},{"id":"_help_dEHYtoWWi8ct","title":"Other features","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Other features"},{"name":"iconClass","value":"bx bxs-grid","type":"label"}]},{"id":"_help_BFvAtE74rbP6","title":"Table of contents","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Table of contents"},{"name":"iconClass","value":"bx bx-heading","type":"label"}]},{"id":"_help_NdowYOC1GFKS","title":"Tables","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Text/Tables"},{"name":"iconClass","value":"bx bx-table","type":"label"}]}]},{"id":"_help_6f9hih2hXXZk","title":"Code","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Code"},{"name":"iconClass","value":"bx bx-code","type":"label"}]},{"id":"_help_m523cpzocqaD","title":"Saved Search","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Saved Search"},{"name":"iconClass","value":"bx bx-file-find","type":"label"}]},{"id":"_help_iRwzGnHPzonm","title":"Relation Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Relation Map"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]},{"id":"_help_bdUJEHsAPYQR","title":"Note Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Note Map"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]},{"id":"_help_HcABDtFCkbFN","title":"Render Note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Render Note"},{"name":"iconClass","value":"bx bx-extension","type":"label"}]},{"id":"_help_GTwFsgaA0lCt","title":"Book","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Book"},{"name":"iconClass","value":"bx bx-book","type":"label"}]},{"id":"_help_s1aBHPd79XYj","title":"Mermaid Diagrams","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Mermaid Diagrams"},{"name":"iconClass","value":"bx bx-selection","type":"label"}],"children":[{"id":"_help_RH6yLjjWJHof","title":"ELK layout","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Mermaid Diagrams/ELK layout"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]}]},{"id":"_help_grjYqerjn243","title":"Canvas","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Canvas"},{"name":"iconClass","value":"bx bx-pen","type":"label"}]},{"id":"_help_1vHRoWCEjj0L","title":"Web View","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Web View"},{"name":"iconClass","value":"bx bx-globe-alt","type":"label"}]},{"id":"_help_gBbsAeiuUxI5","title":"Mind Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Mind Map"},{"name":"iconClass","value":"bx bx-sitemap","type":"label"}]},{"id":"_help_81SGnPGMk7Xc","title":"Geo Map","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/Geo Map"},{"name":"iconClass","value":"bx bx-map-alt","type":"label"}]},{"id":"_help_W8vYD3Q1zjCR","title":"File","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Note Types/File"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_BgmBlOIl72jZ","title":"Troubleshooting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting"},{"name":"iconClass","value":"bx bx-bug","type":"label"}],"children":[{"id":"_help_wy8So3yZZlH9","title":"Reporting issues","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Reporting issues"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_x59R8J8KV5Bp","title":"Anonymized Database","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Anonymized Database"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_qzNzp9LYQyPT","title":"Error logs","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Error logs"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_vdlYGAcpXAgc","title":"Synchronization fails with 504 Gateway Timeout","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Synchronization fails with 504"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_s8alTXmpFR61","title":"Refreshing the application","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Troubleshooting/Refreshing the application"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_pKK96zzmvBGf","title":"Theme development","type":"book","attributes":[{"name":"iconClass","value":"bx bx-palette","type":"label"}],"children":[{"id":"_help_7NfNr5pZpVKV","title":"Creating a custom theme","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Creating a custom theme"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WFGzWeUK6arS","title":"Customize the Next theme","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Customize the Next theme"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WN5z4M8ASACJ","title":"Reference","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Reference"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_AlhDUqhENtH7","title":"Custom app-wide CSS","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Theme development/Custom app-wide CSS"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_tC7s2alapj8V","title":"Advanced Usage","type":"book","attributes":[{"name":"iconClass","value":"bx bx-rocket","type":"label"}],"children":[{"id":"_help_zEY4DaJG4YT5","title":"Attributes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes"},{"name":"iconClass","value":"bx bx-list-check","type":"label"}],"children":[{"id":"_help_HI6GBBIduIgv","title":"Labels","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Labels"},{"name":"iconClass","value":"bx bx-hash","type":"label"}]},{"id":"_help_Cq5X6iKQop6R","title":"Relations","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Relations"},{"name":"iconClass","value":"bx bx-transfer","type":"label"}]},{"id":"_help_bwZpz2ajCEwO","title":"Attribute Inheritance","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Attribute Inheritance"},{"name":"iconClass","value":"bx bx-list-plus","type":"label"}]},{"id":"_help_OFXdgB2nNk1F","title":"Promoted Attributes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Attributes/Promoted Attributes"},{"name":"iconClass","value":"bx bx-table","type":"label"}]}]},{"id":"_help_KC1HB96bqqHX","title":"Templates","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Templates"},{"name":"iconClass","value":"bx bx-copy","type":"label"}]},{"id":"_help_BCkXAVs63Ttv","title":"Note Map (Link map, Tree map)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Note Map (Link map, Tree map)"},{"name":"iconClass","value":"bx bxs-network-chart","type":"label"}]},{"id":"_help_R9pX4DGra2Vt","title":"Sharing","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Sharing"},{"name":"iconClass","value":"bx bx-share-alt","type":"label"}],"children":[{"id":"_help_Qjt68inQ2bRj","title":"Serving directly the content of a note","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Sharing/Serving directly the content o"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_5668rwcirq1t","title":"Advanced Showcases","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_l0tKav7yLHGF","title":"Day Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases/Day Notes"},{"name":"iconClass","value":"bx bx-calendar","type":"label"}]},{"id":"_help_R7abl2fc6Mxi","title":"Weight Tracker","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases/Weight Tracker"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_xYjQUYhpbUEW","title":"Task Manager","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Advanced Showcases/Task Manager"},{"name":"iconClass","value":"bx bx-calendar-check","type":"label"}]}]},{"id":"_help_J5Ex1ZrMbyJ6","title":"Custom Request Handler","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Custom Request Handler"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_d3fAXQ2diepH","title":"Custom Resource Providers","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Custom Resource Providers"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_pgxEVkzLl1OP","title":"ETAPI (REST API)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/ETAPI (REST API)"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_9qPsTWBorUhQ","title":"API Reference","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"/etapi/docs"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_47ZrP6FNuoG8","title":"Default Note Title","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Default Note Title"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_wX4HbRucYSDD","title":"Database","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database"},{"name":"iconClass","value":"bx bx-data","type":"label"}],"children":[{"id":"_help_oyIAJ9PvvwHX","title":"Manually altering the database","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database/Manually altering the database"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_YKWqdJhzi2VY","title":"SQL Console","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database/Manually altering the database/SQL Console"},{"name":"iconClass","value":"bx bx-data","type":"label"}]}]},{"id":"_help_6tZeKvSHEUiB","title":"Demo Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Database/Demo Notes"},{"name":"iconClass","value":"bx bx-package","type":"label"}]}]},{"id":"_help_Gzjqa934BdH4","title":"Configuration (config.ini or environment variables)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Configuration (config.ini or e"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_c5xB8m4g2IY6","title":"Trilium instance","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Trilium instance"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_LWtBjFej3wX3","title":"Cross-Origin Resource Sharing (CORS)","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Configuration (config.ini or environment variables)/Cross-Origin Resource Sharing "},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_ivYnonVFBxbQ","title":"Bulk Actions","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Bulk Actions"},{"name":"iconClass","value":"bx bx-list-plus","type":"label"}]},{"id":"_help_4FahAwuGTAwC","title":"Note source","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Note source"},{"name":"iconClass","value":"bx bx-code","type":"label"}]},{"id":"_help_1YeN2MzFUluU","title":"Technologies used","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used"},{"name":"iconClass","value":"bx bxs-component","type":"label"}],"children":[{"id":"_help_MI26XDLSAlCD","title":"CKEditor","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/CKEditor"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_N4IDkixaDG9C","title":"MindElixir","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/MindElixir"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_H0mM1lTxF9JI","title":"Excalidraw","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/Excalidraw"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_MQHyy2dIFgxS","title":"Leaflet","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Technologies used/Leaflet"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_m1lbrzyKDaRB","title":"Note ID","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Note ID"},{"name":"iconClass","value":"bx bx-hash","type":"label"}]},{"id":"_help_0vTSyvhPTAOz","title":"Internal API","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_z8O2VG4ZZJD7","title":"API Reference","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"/api/docs"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_2mUhVmZK8RF3","title":"Hidden Notes","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Hidden Notes"},{"name":"iconClass","value":"bx bx-hide","type":"label"}]},{"id":"_help_uYF7pmepw27K","title":"Metrics","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Advanced Usage/Metrics"},{"name":"iconClass","value":"bx bxs-data","type":"label"}],"children":[{"id":"_help_bOP3TB56fL1V","title":"grafana-dashboard.json","type":"doc","attributes":[{"name":"iconClass","value":"bx bx-file","type":"label"}]}]}]},{"id":"_help_LMAv4Uy3Wk6J","title":"AI","type":"book","attributes":[{"name":"iconClass","value":"bx bx-bot","type":"label"}],"children":[{"id":"_help_GBBMSlVSOIGP","title":"Introduction","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/Introduction"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_WkM7gsEUyCXs","title":"AI Provider Information","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_7EdTxPADv95W","title":"Ollama","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_vvUCN7FDkq7G","title":"Installing Ollama","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information/Ollama/Installing Ollama"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_ZavFigBX9AwP","title":"OpenAI","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information/OpenAI"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_e0lkirXEiSNc","title":"Anthropic","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/AI/AI Provider Information/Anthropic"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]}]},{"id":"_help_CdNpE2pqjmI6","title":"Scripting","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting"},{"name":"iconClass","value":"bx bxs-file-js","type":"label"}],"children":[{"id":"_help_yIhgI5H7A2Sm","title":"Frontend Basics","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Frontend Basics"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_es8OU2GuguFU","title":"Examples","type":"book","attributes":[{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_TjLYAo3JMO8X","title":"\"New Task\" launcher button","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Examples/New Task launcher button"},{"name":"iconClass","value":"bx bx-task","type":"label"}]},{"id":"_help_7kZPMD0uFwkH","title":"Downloading responses from Google Forms","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Examples/Downloading responses from Goo"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_DL92EjAaXT26","title":"Using promoted attributes to configure scripts","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Examples/Using promoted attributes to c"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_GPERMystNGTB","title":"Events","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Events"},{"name":"iconClass","value":"bx bx-rss","type":"label"}]},{"id":"_help_MgibgPcfeuGz","title":"Custom Widgets","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Custom Widgets"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_YNxAqkI5Kg1M","title":"Word count widget","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Custom Widgets/Word count widget"},{"name":"iconClass","value":"bx bx-file","type":"label"}]},{"id":"_help_SynTBQiBsdYJ","title":"Widget Basics","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Custom Widgets/Widget Basics"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_GLks18SNjxmC","title":"Script API","type":"doc","attributes":[{"type":"label","name":"docName","value":"User Guide/User Guide/Scripting/Script API"},{"name":"iconClass","value":"bx bx-file","type":"label"}],"children":[{"id":"_help_Q2z6av6JZVWm","title":"Frontend API","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://triliumnext.github.io/Notes/Script%20API/interfaces/Frontend_Script_API.Api.html"},{"name":"iconClass","value":"bx bx-folder","type":"label"}],"children":[{"id":"_help_habiZ3HU8Kw8","title":"FNote","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://triliumnext.github.io/Notes/Script%20API/classes/Frontend_Script_API.FNote.html"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]},{"id":"_help_MEtfsqa5VwNi","title":"Backend API","type":"webView","attributes":[{"type":"label","name":"webViewSrc","value":"https://triliumnext.github.io/Notes/Script%20API/interfaces/Backend_Script_API.Api.html"},{"name":"iconClass","value":"bx bx-file","type":"label"}]}]}]}]
\ No newline at end of file
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/1_Metrics_image.png b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/1_Metrics_image.png
new file mode 100644
index 000000000..683789547
Binary files /dev/null and b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/1_Metrics_image.png differ
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/2_Metrics_image.png b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/2_Metrics_image.png
new file mode 100644
index 000000000..08181d986
Binary files /dev/null and b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/2_Metrics_image.png differ
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics.html
index 805db1df2..7f2d204f9 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics.html
@@ -79,4 +79,24 @@ trilium_notes_total 1234 1701432000
400
- Invalid format parameter
401
- Missing or invalid ETAPI token
500
- Internal server error
-
\ No newline at end of file
+
+
+Grafana Dashboard
+
+
+
+
+You can also use the Grafana Dashboard that has been created for TriliumNext
+ - just take the JSON from grafana-dashboard.json and
+ then import the dashboard, following these screenshots:
+
+
+
+Then paste the JSON, and hit load:
+
+
+
+
\ No newline at end of file
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json
new file mode 100644
index 000000000..2e1e4511e
--- /dev/null
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json
@@ -0,0 +1,1335 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "grafana",
+ "uid": "-- Grafana --"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 1,
+ "id": 549,
+ "links": [],
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 100,
+ "panels": [],
+ "title": "🏠 Trilium Overview",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Current Trilium version and build information",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "auto",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "filterable": false,
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "id": 101,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_info{job=~'$job',instance=~'$instance'}",
+ "format": "table",
+ "instant": true,
+ "refId": "A"
+ }
+ ],
+ "title": "📋 Instance Information",
+ "transformations": [
+ {
+ "id": "organize",
+ "options": {
+ "excludeByName": {
+ "Time": true,
+ "Value": true,
+ "__name__": true,
+ "instance": true,
+ "job": true
+ },
+ "indexByName": {},
+ "renameByName": {
+ "build_date": "Build Date",
+ "build_revision": "Git Revision",
+ "db_version": "DB Version",
+ "node_version": "Node.js",
+ "sync_version": "Sync Version",
+ "version": "Version"
+ }
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Database file size in human-readable format",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "yellow",
+ "value": 500000000
+ },
+ {
+ "color": "red",
+ "value": 1000000000
+ }
+ ]
+ },
+ "unit": "decbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 1
+ },
+ "id": 102,
+ "options": {
+ "colorMode": "background",
+ "graphMode": "area",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_database_size_bytes{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "💾 Database Size",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Total active notes in your Trilium instance",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "yellow",
+ "value": 1000
+ },
+ {
+ "color": "red",
+ "value": 5000
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 18,
+ "y": 1
+ },
+ "id": 103,
+ "options": {
+ "colorMode": "background",
+ "graphMode": "area",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "📝 Active Notes",
+ "type": "stat"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 7
+ },
+ "id": 200,
+ "panels": [],
+ "title": "📊 Key Metrics",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Total notes including deleted ones",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [],
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 0,
+ "y": 8
+ },
+ "id": 201,
+ "options": {
+ "legend": {
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": []
+ },
+ "pieType": "pie",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Active Notes",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_deleted{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Deleted Notes",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_protected{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Protected Notes",
+ "refId": "C"
+ }
+ ],
+ "title": "📝 Notes Distribution",
+ "type": "piechart"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Breakdown of attachments by MIME type",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [],
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 6,
+ "y": 8
+ },
+ "id": 202,
+ "options": {
+ "legend": {
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": []
+ },
+ "pieType": "donut",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attachments_by_type{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "{{mime_type}}",
+ "refId": "A"
+ }
+ ],
+ "title": "🖼️ Attachments by Type",
+ "type": "piechart"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Distribution of notes by their content type",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [],
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 8
+ },
+ "id": 203,
+ "options": {
+ "legend": {
+ "displayMode": "table",
+ "placement": "right",
+ "showLegend": true,
+ "values": [
+ "value",
+ "percent"
+ ]
+ },
+ "pieType": "donut",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_by_type{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "{{type}}",
+ "refId": "A"
+ }
+ ],
+ "title": "📄 Notes by Content Type",
+ "type": "piechart"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 16
+ },
+ "id": 300,
+ "panels": [],
+ "title": "📈 Trends & Time Series",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Growth of notes over time",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 20,
+ "gradientMode": "hue",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "smooth",
+ "lineWidth": 3,
+ "pointSize": 8,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Active Notes"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "blue",
+ "mode": "fixed"
+ }
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Total Notes"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "green",
+ "mode": "fixed"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 17
+ },
+ "id": 301,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last",
+ "max"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Active Notes",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Total Notes",
+ "refId": "B"
+ }
+ ],
+ "title": "📈 Notes Growth Over Time",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Attachment storage trends",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 20,
+ "gradientMode": "hue",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "smooth",
+ "lineWidth": 3,
+ "pointSize": 8,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Active Attachments"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "purple",
+ "mode": "fixed"
+ }
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Total Attachments"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "orange",
+ "mode": "fixed"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 17
+ },
+ "id": 302,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last",
+ "max"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attachments_active{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Active Attachments",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attachments_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Total Attachments",
+ "refId": "B"
+ }
+ ],
+ "title": "📎 Attachments Growth Over Time",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 25
+ },
+ "id": 400,
+ "panels": [],
+ "title": "🔧 Advanced Metrics",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of branches connecting notes",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 0,
+ "y": 26
+ },
+ "id": 401,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_branches_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🌳 Total Branches",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of note attributes",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 6,
+ "y": 26
+ },
+ "id": 402,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attributes_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🏷️ Attributes",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of note revisions",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 12,
+ "y": 26
+ },
+ "id": 403,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_revisions_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🔄 Revisions",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of ETAPI tokens",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 18,
+ "y": 26
+ },
+ "id": 404,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_etapi_tokens_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🔑 API Tokens",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Various storage and system metrics",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 2,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Recent Notes"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "yellow",
+ "mode": "fixed"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 30
+ },
+ "id": 405,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_blobs_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Blob Records",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_recent_notes_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Recent Notes",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_embeddings_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Embeddings",
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_embedding_providers_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Embedding Providers",
+ "refId": "D"
+ }
+ ],
+ "title": "📊 Storage & System Metrics",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Timeline showing when content was created and last modified",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "points",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 8,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "always",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "dateTimeAsIso"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 30
+ },
+ "id": 406,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_oldest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000",
+ "legendFormat": "Oldest Note",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_newest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000",
+ "legendFormat": "Newest Note",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_last_modified_timestamp{job=~'$job',instance=~'$instance'} * 1000",
+ "legendFormat": "Last Modified",
+ "refId": "C"
+ }
+ ],
+ "title": "⏰ Content Timeline",
+ "type": "timeseries"
+ }
+ ],
+ "preload": false,
+ "refresh": "1m",
+ "schemaVersion": 41,
+ "tags": [
+ "trilium",
+ "notes",
+ "monitoring",
+ "enhanced"
+ ],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "text": "myprom",
+ "value": "PA04845DA3A4B088E"
+ },
+ "includeAll": false,
+ "label": "Datasource",
+ "name": "datasource",
+ "options": [],
+ "query": "prometheus",
+ "refresh": 1,
+ "regex": "//",
+ "type": "datasource"
+ },
+ {
+ "allValue": ".*",
+ "current": {
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": {
+ "UID": "",
+ "type": ""
+ },
+ "includeAll": true,
+ "label": "Job",
+ "multi": true,
+ "name": "job",
+ "options": [],
+ "query": "query_result(up)",
+ "refresh": 1,
+ "regex": "/job=\"([^\"]+)\"/",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "allValue": ".*",
+ "current": {
+ "text": [
+ "All"
+ ],
+ "value": [
+ "$__all"
+ ]
+ },
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${datasource}"
+ },
+ "includeAll": true,
+ "label": "Instance",
+ "multi": true,
+ "name": "instance",
+ "options": [],
+ "query": "trilium_database_size_bytes",
+ "refresh": 1,
+ "regex": "/instance=\"([^\"]+)\"/",
+ "sort": 1,
+ "type": "query"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-1h",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "browser",
+ "title": "TriliumNext Dashboard",
+ "uid": "06993f9b-a477-4723-bf18-47743393b382",
+ "version": 5
+}
\ No newline at end of file
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics_image.png b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics_image.png
new file mode 100644
index 000000000..ae68ddd02
Binary files /dev/null and b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Advanced Usage/Metrics_image.png differ
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.html
index ddd6b647d..a9c2d7c65 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Basic Concepts and Features/Keyboard Shortcuts.html
@@ -77,7 +77,7 @@
class="reference-link" href="#root/_help_QrtTYPmdd1qq">Markdown-like formatting.
- Enter in tree pane switches from tree pane into note title.
+ Enter in tree pane switches from tree pane into note title.
Enter from note title switches focus to text editor. Ctrl +. switches
back from editor to tree pane.
Ctrl +. - jump away from the editor to tree pane and
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Geo Map.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Geo Map.html
index 4a5860659..b85d13a7c 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Geo Map.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Geo Map.html
@@ -19,7 +19,7 @@
1
-
+
@@ -29,7 +29,7 @@
2
-
+
@@ -170,7 +170,7 @@
1
-
+
@@ -187,7 +187,7 @@
2
-
+
@@ -197,7 +197,7 @@
3
-
+
@@ -316,8 +316,15 @@ class="table" style="width:100%;">
-
-Troubleshooting
+
+ The starting point of the track will be displayed as a marker, with the
+ name of the note underneath. The start marker will also respect the icon
+ and the color
of the note. The end marker is displayed with
+ a distinct icon.
+ If the GPX contains waypoints, they will also be displayed. If they have
+ a name, it is displayed when hovering over it with the mouse.
+
+ Troubleshooting
diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.html
index df312d7bf..f26061d1c 100644
--- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.html
+++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.html
@@ -60,7 +60,7 @@
- Mark selected text as keyboard shortcut
+ Mark selected text as keyboard shortcut
Ctrl + Alt + K
@@ -68,7 +68,7 @@
- Insert Math Equations
+ Insert Math Equations
Ctrl + M
@@ -76,7 +76,7 @@
- Move blocks (lists, paragraphs, etc.) up
+ Move blocks (lists, paragraphs, etc.) up
Ctrl +↑
⌘ +↑
@@ -87,7 +87,7 @@
- Move blocks (lists, paragraphs, etc.) down
+ Move blocks (lists, paragraphs, etc.) down
Ctrl +↑
⌘ +↑
@@ -102,6 +102,7 @@
+
Common shortcuts
This section of keyboard shortcuts presents a subset of the keyboard shortcuts
@@ -260,6 +261,7 @@
+
Interacting with blocks
Blocks are images, tables, blockquotes, annotations.
@@ -373,6 +375,7 @@
+
General UI shortcuts
diff --git a/apps/server/src/assets/translations/en/server.json b/apps/server/src/assets/translations/en/server.json
index 2985cc010..33147a8d2 100644
--- a/apps/server/src/assets/translations/en/server.json
+++ b/apps/server/src/assets/translations/en/server.json
@@ -1,12 +1,18 @@
{
"keyboard_actions": {
+ "back-in-note-history": "Navigate to previous note in history",
+ "forward-in-note-history": "Navigate to next note in history",
"open-jump-to-note-dialog": "Open \"Jump to note\" dialog",
+ "scroll-to-active-note": "Scroll note tree to active note",
+ "quick-search": "Activate quick search bar",
"search-in-subtree": "Search for notes in the active note's subtree",
"expand-subtree": "Expand subtree of current note",
"collapse-tree": "Collapses the complete note tree",
"collapse-subtree": "Collapses subtree of current note",
"sort-child-notes": "Sort child notes",
"creating-and-moving-notes": "Creating and moving notes",
+ "create-note-after": "Create note after active note",
+ "create-note-into": "Create note as child of active note",
"create-note-into-inbox": "Create a note in the inbox (if defined) or day note",
"delete-note": "Delete note",
"move-note-up": "Move note up",
@@ -14,40 +20,44 @@
"move-note-up-in-hierarchy": "Move note up in hierarchy",
"move-note-down-in-hierarchy": "Move note down in hierarchy",
"edit-note-title": "Jump from tree to the note detail and edit title",
- "edit-branch-prefix": "Show Edit branch prefix dialog",
+ "edit-branch-prefix": "Show \"Edit branch prefix\" dialog",
+ "cloneNotesTo": "Clone selected notes",
+ "moveNotesTo": "Move selected notes",
"note-clipboard": "Note clipboard",
"copy-notes-to-clipboard": "Copy selected notes to the clipboard",
"paste-notes-from-clipboard": "Paste notes from the clipboard into active note",
"cut-notes-to-clipboard": "Cut selected notes to the clipboard",
"select-all-notes-in-parent": "Select all notes from the current note level",
"add-note-above-to-the-selection": "Add note above to the selection",
- "add-note-below-to-selection": "Add note above to the selection",
+ "add-note-below-to-selection": "Add note below to the selection",
"duplicate-subtree": "Duplicate subtree",
"tabs-and-windows": "Tabs & Windows",
- "open-new-tab": "Opens new tab",
- "close-active-tab": "Closes active tab",
- "reopen-last-tab": "Reopens the last closed tab",
- "activate-next-tab": "Activates tab on the right",
- "activate-previous-tab": "Activates tab on the left",
+ "open-new-tab": "Open new tab",
+ "close-active-tab": "Close active tab",
+ "reopen-last-tab": "Reopen the last closed tab",
+ "activate-next-tab": "Activate tab on the right",
+ "activate-previous-tab": "Activate tab on the left",
"open-new-window": "Open new empty window",
- "toggle-tray": "Shows/hides the application from the system tray",
- "first-tab": "Activates the first tab in the list",
- "second-tab": "Activates the second tab in the list",
- "third-tab": "Activates the third tab in the list",
- "fourth-tab": "Activates the fourth tab in the list",
- "fifth-tab": "Activates the fifth tab in the list",
- "sixth-tab": "Activates the sixth tab in the list",
- "seventh-tab": "Activates the seventh tab in the list",
- "eight-tab": "Activates the eighth tab in the list",
- "ninth-tab": "Activates the ninth tab in the list",
- "last-tab": "Activates the last tab in the list",
+ "toggle-tray": "Show/hide the application from the system tray",
+ "first-tab": "Activate the first tab in the list",
+ "second-tab": "Activate the second tab in the list",
+ "third-tab": "Activate the third tab in the list",
+ "fourth-tab": "Activate the fourth tab in the list",
+ "fifth-tab": "Activate the fifth tab in the list",
+ "sixth-tab": "Activate the sixth tab in the list",
+ "seventh-tab": "Activate the seventh tab in the list",
+ "eight-tab": "Activate the eighth tab in the list",
+ "ninth-tab": "Activate the ninth tab in the list",
+ "last-tab": "Activate the last tab in the list",
"dialogs": "Dialogs",
- "show-note-source": "Shows Note Source dialog",
- "show-options": "Shows Options dialog",
- "show-revisions": "Shows Note Revisions dialog",
- "show-recent-changes": "Shows Recent Changes dialog",
- "show-sql-console": "Shows SQL Console dialog",
- "show-backend-log": "Shows Backend Log dialog",
+ "show-note-source": "Show \"Note Source\" dialog",
+ "show-options": "Open \"Options\" page",
+ "show-revisions": "Show \"Note Revisions\" dialog",
+ "show-recent-changes": "Show \"Recent Changes\" dialog",
+ "show-sql-console": "Open \"SQL Console\" page",
+ "show-backend-log": "Open \"Backend Log\" page",
+ "show-help": "Open the built-in User Guide",
+ "show-cheatsheet": "Show a modal with common keyboard operations",
"text-note-operations": "Text note operations",
"add-link-to-text": "Open dialog to add link to the text",
"follow-link-under-cursor": "Follow link within which the caret is placed",
@@ -76,10 +86,11 @@
"open-note-externally": "Open note as a file with default application",
"render-active-note": "Render (re-render) active note",
"run-active-note": "Run active JavaScript (frontend/backend) code note",
- "toggle-note-hoisting": "Toggles note hoisting of active note",
+ "toggle-note-hoisting": "Toggle note hoisting of active note",
"unhoist": "Unhoist from anywhere",
- "reload-frontend-app": "Reload frontend App",
- "open-dev-tools": "Open dev tools",
+ "reload-frontend-app": "Reload frontend",
+ "open-dev-tools": "Open developer tools",
+ "find-in-text": "Toggle search panel",
"toggle-left-note-tree-panel": "Toggle left (note tree) panel",
"toggle-full-screen": "Toggle full screen",
"zoom-out": "Zoom Out",
@@ -88,11 +99,9 @@
"reset-zoom-level": "Reset zoom level",
"copy-without-formatting": "Copy selected text without formatting",
"force-save-revision": "Force creating / saving new note revision of the active note",
- "show-help": "Shows the built-in User Guide",
"toggle-book-properties": "Toggle Book Properties",
"toggle-classic-editor-toolbar": "Toggle the Formatting tab for the editor with fixed toolbar",
- "export-as-pdf": "Exports the current note as a PDF",
- "show-cheatsheet": "Shows a modal with common keyboard operations",
+ "export-as-pdf": "Export the current note as a PDF",
"toggle-zen-mode": "Enables/disables the zen mode (minimal UI for more focused editing)"
},
"login": {
diff --git a/apps/server/src/assets/views/mobile.ejs b/apps/server/src/assets/views/mobile.ejs
index 254dcaed5..80778d9ad 100644
--- a/apps/server/src/assets/views/mobile.ejs
+++ b/apps/server/src/assets/views/mobile.ejs
@@ -118,6 +118,15 @@
<% if (themeCssUrl) { %>
<% } %>
+
+<% if (themeUseNextAsBase === "next") { %>
+
+<% } else if (themeUseNextAsBase === "next-dark") { %>
+
+<% } else if (themeUseNextAsBase === "next-light") { %>
+
+<% } %>
+
diff --git a/apps/server/src/assets/views/share/page.ejs b/apps/server/src/assets/views/share/page.ejs
index d15cf515e..2fba4702b 100644
--- a/apps/server/src/assets/views/share/page.ejs
+++ b/apps/server/src/assets/views/share/page.ejs
@@ -13,6 +13,7 @@
<% } %>
+
<% if (!note.isLabelTruthy("shareOmitDefaultCss")) { %>
<% } %>
diff --git a/apps/server/src/becca/becca-interface.ts b/apps/server/src/becca/becca-interface.ts
index 005a5cc52..4301b2b5e 100644
--- a/apps/server/src/becca/becca-interface.ts
+++ b/apps/server/src/becca/becca-interface.ts
@@ -12,6 +12,7 @@ import type { AttachmentRow, BlobRow, RevisionRow } from "@triliumnext/commons";
import BBlob from "./entities/bblob.js";
import BRecentNote from "./entities/brecent_note.js";
import type AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
+import type BNoteEmbedding from "./entities/bnote_embedding.js";
interface AttachmentOpts {
includeContentLength?: boolean;
@@ -32,6 +33,7 @@ export default class Becca {
attributeIndex!: Record;
options!: Record;
etapiTokens!: Record;
+ noteEmbeddings!: Record;
allNoteSetCache: NoteSet | null;
@@ -48,6 +50,7 @@ export default class Becca {
this.attributeIndex = {};
this.options = {};
this.etapiTokens = {};
+ this.noteEmbeddings = {};
this.dirtyNoteSetCache();
diff --git a/apps/server/src/becca/becca_loader.ts b/apps/server/src/becca/becca_loader.ts
index 4506c912a..44e3a9ce2 100644
--- a/apps/server/src/becca/becca_loader.ts
+++ b/apps/server/src/becca/becca_loader.ts
@@ -9,9 +9,10 @@ import BBranch from "./entities/bbranch.js";
import BAttribute from "./entities/battribute.js";
import BOption from "./entities/boption.js";
import BEtapiToken from "./entities/betapi_token.js";
+import BNoteEmbedding from "./entities/bnote_embedding.js";
import cls from "../services/cls.js";
import entityConstructor from "../becca/entity_constructor.js";
-import type { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow } from "@triliumnext/commons";
+import type { AttributeRow, BranchRow, EtapiTokenRow, NoteRow, OptionRow, NoteEmbeddingRow } from "@triliumnext/commons";
import type AbstractBeccaEntity from "./entities/abstract_becca_entity.js";
import ws from "../services/ws.js";
@@ -63,6 +64,10 @@ function load() {
for (const row of sql.getRows(/*sql*/`SELECT etapiTokenId, name, tokenHash, utcDateCreated, utcDateModified FROM etapi_tokens WHERE isDeleted = 0`)) {
new BEtapiToken(row);
}
+
+ for (const row of sql.getRows(/*sql*/`SELECT embedId, noteId, providerId, modelId, dimension, embedding, version, dateCreated, dateModified, utcDateCreated, utcDateModified FROM note_embeddings`)) {
+ new BNoteEmbedding(row).init();
+ }
});
for (const noteId in becca.notes) {
@@ -85,7 +90,7 @@ eventService.subscribeBeccaLoader([eventService.ENTITY_CHANGE_SYNCED], ({ entity
return;
}
- if (["notes", "branches", "attributes", "etapi_tokens", "options"].includes(entityName)) {
+ if (["notes", "branches", "attributes", "etapi_tokens", "options", "note_embeddings"].includes(entityName)) {
const EntityClass = entityConstructor.getEntityFromEntityName(entityName);
const primaryKeyName = EntityClass.primaryKeyName;
@@ -143,6 +148,8 @@ eventService.subscribeBeccaLoader([eventService.ENTITY_DELETED, eventService.ENT
attributeDeleted(entityId);
} else if (entityName === "etapi_tokens") {
etapiTokenDeleted(entityId);
+ } else if (entityName === "note_embeddings") {
+ noteEmbeddingDeleted(entityId);
}
});
@@ -278,6 +285,10 @@ function etapiTokenDeleted(etapiTokenId: string) {
delete becca.etapiTokens[etapiTokenId];
}
+function noteEmbeddingDeleted(embedId: string) {
+ delete becca.noteEmbeddings[embedId];
+}
+
eventService.subscribeBeccaLoader(eventService.ENTER_PROTECTED_SESSION, () => {
try {
becca.decryptProtectedNotes();
diff --git a/apps/server/src/becca/entities/bnote_embedding.ts b/apps/server/src/becca/entities/bnote_embedding.ts
index 76d559e52..c59a06e5e 100644
--- a/apps/server/src/becca/entities/bnote_embedding.ts
+++ b/apps/server/src/becca/entities/bnote_embedding.ts
@@ -32,6 +32,12 @@ class BNoteEmbedding extends AbstractBeccaEntity {
}
}
+ init() {
+ if (this.embedId) {
+ this.becca.noteEmbeddings[this.embedId] = this;
+ }
+ }
+
updateFromRow(row: NoteEmbeddingRow): void {
this.embedId = row.embedId;
this.noteId = row.noteId;
@@ -44,6 +50,10 @@ class BNoteEmbedding extends AbstractBeccaEntity {
this.dateModified = row.dateModified;
this.utcDateCreated = row.utcDateCreated;
this.utcDateModified = row.utcDateModified;
+
+ if (this.embedId) {
+ this.becca.noteEmbeddings[this.embedId] = this;
+ }
}
override beforeSaving() {
diff --git a/apps/server/src/etapi/backup.ts b/apps/server/src/etapi/backup.ts
index d73bf1a33..9c986f45a 100644
--- a/apps/server/src/etapi/backup.ts
+++ b/apps/server/src/etapi/backup.ts
@@ -4,10 +4,10 @@ import eu from "./etapi_utils.js";
import backupService from "../services/backup.js";
function register(router: Router) {
- eu.route(router, "put", "/etapi/backup/:backupName", async (req, res, next) => {
- await backupService.backupNow(req.params.backupName);
-
- res.sendStatus(204);
+ eu.route(router, "put", "/etapi/backup/:backupName", (req, res, next) => {
+ backupService.backupNow(req.params.backupName)
+ .then(() => res.sendStatus(204))
+ .catch(() => res.sendStatus(500));
});
}
diff --git a/apps/server/src/etapi/etapi_utils.ts b/apps/server/src/etapi/etapi_utils.ts
index e4f40c927..a50434f70 100644
--- a/apps/server/src/etapi/etapi_utils.ts
+++ b/apps/server/src/etapi/etapi_utils.ts
@@ -6,7 +6,7 @@ import etapiTokenService from "../services/etapi_tokens.js";
import config from "../services/config.js";
import type { NextFunction, Request, RequestHandler, Response, Router } from "express";
import type { ValidatorMap } from "./etapi-interface.js";
-import type { ApiRequestHandler } from "../routes/route_api.js";
+import type { ApiRequestHandler, SyncRouteRequestHandler } from "../routes/route_api.js";
const GENERIC_CODE = "GENERIC";
type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head";
@@ -73,11 +73,11 @@ function processRequest(req: Request, res: Response, routeHandler: ApiRequestHan
}
}
-function route(router: Router, method: HttpMethod, path: string, routeHandler: ApiRequestHandler) {
+function route(router: Router, method: HttpMethod, path: string, routeHandler: SyncRouteRequestHandler) {
router[method](path, checkEtapiAuth, (req: Request, res: Response, next: NextFunction) => processRequest(req, res, routeHandler, next, method, path));
}
-function NOT_AUTHENTICATED_ROUTE(router: Router, method: HttpMethod, path: string, middleware: RequestHandler[], routeHandler: RequestHandler) {
+function NOT_AUTHENTICATED_ROUTE(router: Router, method: HttpMethod, path: string, middleware: RequestHandler[], routeHandler: SyncRouteRequestHandler) {
router[method](path, ...middleware, (req: Request, res: Response, next: NextFunction) => processRequest(req, res, routeHandler, next, method, path));
}
diff --git a/apps/server/src/etapi/special_notes.ts b/apps/server/src/etapi/special_notes.ts
index df2f75f9a..043ce1d3a 100644
--- a/apps/server/src/etapi/special_notes.ts
+++ b/apps/server/src/etapi/special_notes.ts
@@ -15,46 +15,46 @@ function isValidDate(date: string) {
}
function register(router: Router) {
- eu.route(router, "get", "/etapi/inbox/:date", async (req, res, next) => {
+ eu.route(router, "get", "/etapi/inbox/:date", (req, res, next) => {
const { date } = req.params;
if (!isValidDate(date)) {
throw getDateInvalidError(date);
}
- const note = await specialNotesService.getInboxNote(date);
+ const note = specialNotesService.getInboxNote(date);
res.json(mappers.mapNoteToPojo(note));
});
- eu.route(router, "get", "/etapi/calendar/days/:date", async (req, res, next) => {
+ eu.route(router, "get", "/etapi/calendar/days/:date", (req, res, next) => {
const { date } = req.params;
if (!isValidDate(date)) {
throw getDateInvalidError(date);
}
- const note = await dateNotesService.getDayNote(date);
+ const note = dateNotesService.getDayNote(date);
res.json(mappers.mapNoteToPojo(note));
});
- eu.route(router, "get", "/etapi/calendar/week-first-day/:date", async (req, res, next) => {
+ eu.route(router, "get", "/etapi/calendar/week-first-day/:date", (req, res, next) => {
const { date } = req.params;
if (!isValidDate(date)) {
throw getDateInvalidError(date);
}
- const note = await dateNotesService.getWeekFirstDayNote(date);
+ const note = dateNotesService.getWeekFirstDayNote(date);
res.json(mappers.mapNoteToPojo(note));
});
- eu.route(router, "get", "/etapi/calendar/weeks/:week", async (req, res, next) => {
+ eu.route(router, "get", "/etapi/calendar/weeks/:week", (req, res, next) => {
const { week } = req.params;
if (!/[0-9]{4}-W[0-9]{2}/.test(week)) {
throw getWeekInvalidError(week);
}
- const note = await dateNotesService.getWeekNote(week);
+ const note = dateNotesService.getWeekNote(week);
if (!note) {
throw getWeekNotFoundError(week);
@@ -63,14 +63,14 @@ function register(router: Router) {
res.json(mappers.mapNoteToPojo(note));
});
- eu.route(router, "get", "/etapi/calendar/months/:month", async (req, res, next) => {
+ eu.route(router, "get", "/etapi/calendar/months/:month", (req, res, next) => {
const { month } = req.params;
if (!/[0-9]{4}-[0-9]{2}/.test(month)) {
throw getMonthInvalidError(month);
}
- const note = await dateNotesService.getMonthNote(month);
+ const note = dateNotesService.getMonthNote(month);
res.json(mappers.mapNoteToPojo(note));
});
diff --git a/apps/server/src/routes/api/llm.ts b/apps/server/src/routes/api/llm.ts
index 013ce779d..c21426a66 100644
--- a/apps/server/src/routes/api/llm.ts
+++ b/apps/server/src/routes/api/llm.ts
@@ -5,7 +5,6 @@ import options from "../../services/options.js";
// Import the index service for knowledge base management
import indexService from "../../services/llm/index_service.js";
import restChatService from "../../services/llm/rest_chat_service.js";
-import chatService from '../../services/llm/chat_service.js';
import chatStorageService from '../../services/llm/chat_storage_service.js';
// Define basic interfaces
@@ -190,23 +189,26 @@ async function getSession(req: Request, res: Response) {
* tags: ["llm"]
*/
async function updateSession(req: Request, res: Response) {
- // Get the chat using ChatService
+ // Get the chat using chatStorageService directly
const chatNoteId = req.params.chatNoteId;
const updates = req.body;
try {
// Get the chat
- const session = await chatService.getOrCreateSession(chatNoteId);
+ const chat = await chatStorageService.getChat(chatNoteId);
+ if (!chat) {
+ throw new Error(`Chat with ID ${chatNoteId} not found`);
+ }
// Update title if provided
if (updates.title) {
- await chatStorageService.updateChat(chatNoteId, session.messages, updates.title);
+ await chatStorageService.updateChat(chatNoteId, chat.messages, updates.title);
}
// Return the updated chat
return {
id: chatNoteId,
- title: updates.title || session.title,
+ title: updates.title || chat.title,
updatedAt: new Date()
};
} catch (error) {
@@ -248,18 +250,18 @@ async function updateSession(req: Request, res: Response) {
* tags: ["llm"]
*/
async function listSessions(req: Request, res: Response) {
- // Get all sessions using ChatService
+ // Get all sessions using chatStorageService directly
try {
- const sessions = await chatService.getAllSessions();
+ const chats = await chatStorageService.getAllChats();
// Format the response
return {
- sessions: sessions.map(session => ({
- id: session.id,
- title: session.title,
- createdAt: new Date(), // Since we don't have this in chat sessions
- lastActive: new Date(), // Since we don't have this in chat sessions
- messageCount: session.messages.length
+ sessions: chats.map(chat => ({
+ id: chat.id,
+ title: chat.title,
+ createdAt: chat.createdAt || new Date(),
+ lastActive: chat.updatedAt || new Date(),
+ messageCount: chat.messages.length
}))
};
} catch (error) {
@@ -811,17 +813,38 @@ async function streamMessage(req: Request, res: Response) {
const { content, useAdvancedContext, showThinking, mentions } = req.body;
if (!content || typeof content !== 'string' || content.trim().length === 0) {
- throw new Error('Content cannot be empty');
+ return res.status(400).json({
+ success: false,
+ error: 'Content cannot be empty'
+ });
}
+
+ // IMPORTANT: Immediately send a success response to the initial POST request
+ // The client is waiting for this to confirm streaming has been initiated
+ res.status(200).json({
+ success: true,
+ message: 'Streaming initiated successfully'
+ });
+ log.info(`Sent immediate success response for streaming setup`);
+
+ // Create a new response object for streaming through WebSocket only
+ // We won't use HTTP streaming since we've already sent the HTTP response
- // Check if session exists
- const session = restChatService.getSessions().get(chatNoteId);
- if (!session) {
- throw new Error('Chat not found');
+ // Get or create chat directly from storage (simplified approach)
+ let chat = await chatStorageService.getChat(chatNoteId);
+ if (!chat) {
+ // Create a new chat if it doesn't exist
+ chat = await chatStorageService.createChat('New Chat');
+ log.info(`Created new chat with ID: ${chat.id} for stream request`);
}
-
- // Update last active timestamp
- session.lastActive = new Date();
+
+ // Add the user message to the chat immediately
+ chat.messages.push({
+ role: 'user',
+ content
+ });
+ // Save the chat to ensure the user message is recorded
+ await chatStorageService.updateChat(chat.id, chat.messages, chat.title);
// Process mentions if provided
let enhancedContent = content;
@@ -830,7 +853,6 @@ async function streamMessage(req: Request, res: Response) {
// Import note service to get note content
const becca = (await import('../../becca/becca.js')).default;
-
const mentionContexts: string[] = [];
for (const mention of mentions) {
@@ -857,102 +879,94 @@ async function streamMessage(req: Request, res: Response) {
}
}
- // Add user message to the session (with enhanced content for processing)
- session.messages.push({
- role: 'user',
- content: enhancedContent,
- timestamp: new Date()
- });
-
- // Create request parameters for the pipeline
- const requestParams = {
- chatNoteId: chatNoteId,
- content: enhancedContent,
- useAdvancedContext: useAdvancedContext === true,
- showThinking: showThinking === true,
- stream: true // Always stream for this endpoint
- };
-
- // Create a fake request/response pair to pass to the handler
- const fakeReq = {
- ...req,
- method: 'GET', // Set to GET to indicate streaming
- query: {
- stream: 'true', // Set stream param - don't use format: 'stream' to avoid confusion
- useAdvancedContext: String(useAdvancedContext === true),
- showThinking: String(showThinking === true)
- },
- params: {
- chatNoteId: chatNoteId
- },
- // Make sure the enhanced content is available to the handler
- body: {
- content: enhancedContent,
- useAdvancedContext: useAdvancedContext === true,
- showThinking: showThinking === true
- }
- } as unknown as Request;
-
- // Log to verify correct parameters
- log.info(`WebSocket stream settings - useAdvancedContext=${useAdvancedContext === true}, in query=${fakeReq.query.useAdvancedContext}, in body=${fakeReq.body.useAdvancedContext}`);
- // Extra safety to ensure the parameters are passed correctly
- if (useAdvancedContext === true) {
- log.info(`Enhanced context IS enabled for this request`);
- } else {
- log.info(`Enhanced context is NOT enabled for this request`);
- }
-
- // Process the request in the background
- Promise.resolve().then(async () => {
- try {
- await restChatService.handleSendMessage(fakeReq, res);
- } catch (error) {
- log.error(`Background message processing error: ${error}`);
-
- // Import the WebSocket service
- const wsService = (await import('../../services/ws.js')).default;
-
- // Define LLMStreamMessage interface
- interface LLMStreamMessage {
- type: 'llm-stream';
- chatNoteId: string;
- content?: string;
- thinking?: string;
- toolExecution?: any;
- done?: boolean;
- error?: string;
- raw?: unknown;
- }
-
- // Send error to client via WebSocket
- wsService.sendMessageToAllClients({
- type: 'llm-stream',
- chatNoteId: chatNoteId,
- error: `Error processing message: ${error}`,
- done: true
- } as LLMStreamMessage);
- }
- });
-
- // Import the WebSocket service
+ // Import the WebSocket service to send immediate feedback
const wsService = (await import('../../services/ws.js')).default;
- // Let the client know streaming has started via WebSocket (helps client confirm connection is working)
+ // Let the client know streaming has started
wsService.sendMessageToAllClients({
type: 'llm-stream',
chatNoteId: chatNoteId,
- thinking: 'Initializing streaming LLM response...'
+ thinking: showThinking ? 'Initializing streaming LLM response...' : undefined
});
- // Let the client know streaming has started via HTTP response
- return {
- success: true,
- message: 'Streaming started',
- chatNoteId: chatNoteId
- };
+ // Instead of trying to reimplement the streaming logic ourselves,
+ // delegate to restChatService but set up the correct protocol:
+ // 1. We've already sent a success response to the initial POST
+ // 2. Now we'll have restChatService process the actual streaming through WebSocket
+ try {
+ // Import the WebSocket service for sending messages
+ const wsService = (await import('../../services/ws.js')).default;
+
+ // Create a simple pass-through response object that won't write to the HTTP response
+ // but will allow restChatService to send WebSocket messages
+ const dummyResponse = {
+ writableEnded: false,
+ // Implement methods that would normally be used by restChatService
+ write: (_chunk: string) => {
+ // Silent no-op - we're only using WebSocket
+ return true;
+ },
+ end: (_chunk?: string) => {
+ // Log when streaming is complete via WebSocket
+ log.info(`[${chatNoteId}] Completed HTTP response handling during WebSocket streaming`);
+ return dummyResponse;
+ },
+ setHeader: (name: string, _value: string) => {
+ // Only log for content-type to reduce noise
+ if (name.toLowerCase() === 'content-type') {
+ log.info(`[${chatNoteId}] Setting up streaming for WebSocket only`);
+ }
+ return dummyResponse;
+ }
+ };
+
+ // Process the streaming now through WebSocket only
+ try {
+ log.info(`[${chatNoteId}] Processing LLM streaming through WebSocket after successful initiation at ${new Date().toISOString()}`);
+
+ // Call restChatService with our enhanced request and dummy response
+ // The important part is setting method to GET to indicate streaming mode
+ await restChatService.handleSendMessage({
+ ...req,
+ method: 'GET', // Indicate streaming mode
+ query: {
+ ...req.query,
+ stream: 'true' // Add the required stream parameter
+ },
+ body: {
+ content: enhancedContent,
+ useAdvancedContext: useAdvancedContext === true,
+ showThinking: showThinking === true
+ },
+ params: { chatNoteId }
+ } as unknown as Request, dummyResponse as unknown as Response);
+
+ log.info(`[${chatNoteId}] WebSocket streaming completed at ${new Date().toISOString()}`);
+ } catch (streamError) {
+ log.error(`[${chatNoteId}] Error during WebSocket streaming: ${streamError}`);
+
+ // Send error message through WebSocket
+ wsService.sendMessageToAllClients({
+ type: 'llm-stream',
+ chatNoteId: chatNoteId,
+ error: `Error during streaming: ${streamError}`,
+ done: true
+ });
+ }
+ } catch (error) {
+ log.error(`Error during streaming: ${error}`);
+
+ // Send error to client via WebSocket
+ wsService.sendMessageToAllClients({
+ type: 'llm-stream',
+ chatNoteId: chatNoteId,
+ error: `Error processing message: ${error}`,
+ done: true
+ });
+ }
} catch (error: any) {
log.error(`Error starting message stream: ${error.message}`);
- throw error;
+ log.error(`Error starting message stream, can't communicate via WebSocket: ${error.message}`);
}
}
diff --git a/apps/server/src/routes/api/openai.ts b/apps/server/src/routes/api/openai.ts
index c78f183cd..ced03ce04 100644
--- a/apps/server/src/routes/api/openai.ts
+++ b/apps/server/src/routes/api/openai.ts
@@ -81,13 +81,13 @@ async function listModels(req: Request, res: Response) {
// Filter and categorize models
const allModels = response.data || [];
- // Separate models into chat models and embedding models
+ // Include all models as chat models, without filtering by specific model names
+ // This allows models from providers like OpenRouter to be displayed
const chatModels = allModels
- .filter((model) =>
- // Include GPT models for chat
- model.id.includes('gpt') ||
- // Include Claude models via Azure OpenAI
- model.id.includes('claude')
+ .filter((model) =>
+ // Exclude models that are explicitly for embeddings
+ !model.id.includes('embedding') &&
+ !model.id.includes('embed')
)
.map((model) => ({
id: model.id,
diff --git a/apps/server/src/services/consistency_checks.ts b/apps/server/src/services/consistency_checks.ts
index ec7850572..8022c74df 100644
--- a/apps/server/src/services/consistency_checks.ts
+++ b/apps/server/src/services/consistency_checks.ts
@@ -799,6 +799,7 @@ class ConsistencyChecks {
this.runEntityChangeChecks("attributes", "attributeId");
this.runEntityChangeChecks("etapi_tokens", "etapiTokenId");
this.runEntityChangeChecks("options", "name");
+ this.runEntityChangeChecks("note_embeddings", "embedId");
}
findWronglyNamedAttributes() {
diff --git a/apps/server/src/services/html_sanitizer.ts b/apps/server/src/services/html_sanitizer.ts
index 11bf9e42d..4f2bc5fc0 100644
--- a/apps/server/src/services/html_sanitizer.ts
+++ b/apps/server/src/services/html_sanitizer.ts
@@ -1,5 +1,5 @@
import sanitizeHtml from "sanitize-html";
-import sanitizeUrl from "@braintree/sanitize-url";
+import { sanitizeUrl } from "@braintree/sanitize-url";
import optionService from "./options.js";
// Be consistent with `ALLOWED_PROTOCOLS` in `src\public\app\services\link.js`
@@ -190,6 +190,6 @@ function sanitize(dirtyHtml: string) {
export default {
sanitize,
sanitizeUrl: (url: string) => {
- return sanitizeUrl.sanitizeUrl(url).trim();
+ return sanitizeUrl(url).trim();
}
};
diff --git a/apps/server/src/services/keyboard_actions.ts b/apps/server/src/services/keyboard_actions.ts
index 35bfd9b6f..fe8e7c276 100644
--- a/apps/server/src/services/keyboard_actions.ts
+++ b/apps/server/src/services/keyboard_actions.ts
@@ -19,12 +19,14 @@ function getDefaultKeyboardActions() {
actionName: "backInNoteHistory",
// Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376
defaultShortcuts: isMac ? ["CommandOrControl+Left"] : ["Alt+Left"],
+ description: t("keyboard_actions.back-in-note-history"),
scope: "window"
},
{
actionName: "forwardInNoteHistory",
// Mac has a different history navigation shortcuts - https://github.com/zadam/trilium/issues/376
defaultShortcuts: isMac ? ["CommandOrControl+Right"] : ["Alt+Right"],
+ description: t("keyboard_actions.forward-in-note-history"),
scope: "window"
},
{
@@ -36,11 +38,13 @@ function getDefaultKeyboardActions() {
{
actionName: "scrollToActiveNote",
defaultShortcuts: ["CommandOrControl+."],
+ description: t("keyboard_actions.scroll-to-active-note"),
scope: "window"
},
{
actionName: "quickSearch",
defaultShortcuts: ["CommandOrControl+S"],
+ description: t("keyboard_actions.quick-search"),
scope: "window"
},
{
@@ -80,11 +84,13 @@ function getDefaultKeyboardActions() {
{
actionName: "createNoteAfter",
defaultShortcuts: ["CommandOrControl+O"],
+ description: t("keyboard_actions.create-note-after"),
scope: "window"
},
{
actionName: "createNoteInto",
defaultShortcuts: ["CommandOrControl+P"],
+ description: t("keyboard_actions.create-note-into"),
scope: "window"
},
{
@@ -138,11 +144,13 @@ function getDefaultKeyboardActions() {
{
actionName: "cloneNotesTo",
defaultShortcuts: ["CommandOrControl+Shift+C"],
+ description: t("keyboard_actions.clone-notes-to"),
scope: "window"
},
{
actionName: "moveNotesTo",
defaultShortcuts: ["CommandOrControl+Shift+X"],
+ description: t("keyboard_actions.move-notes-to"),
scope: "window"
},
@@ -566,6 +574,7 @@ function getDefaultKeyboardActions() {
{
actionName: "findInText",
defaultShortcuts: isElectron ? ["CommandOrControl+F"] : [],
+ description: t("keyboard_actions.find-in-text"),
scope: "window"
},
{
diff --git a/apps/server/src/services/llm/ai_service_manager.ts b/apps/server/src/services/llm/ai_service_manager.ts
index fbbc12cb5..d7bbf4cf7 100644
--- a/apps/server/src/services/llm/ai_service_manager.ts
+++ b/apps/server/src/services/llm/ai_service_manager.ts
@@ -18,6 +18,19 @@ import type {
} from './interfaces/ai_service_interfaces.js';
import type { NoteSearchResult } from './interfaces/context_interfaces.js';
+// Import new configuration system
+import {
+ getProviderPrecedence,
+ getPreferredProvider,
+ getEmbeddingProviderPrecedence,
+ parseModelIdentifier,
+ isAIEnabled,
+ getDefaultModelForProvider,
+ clearConfigurationCache,
+ validateConfiguration
+} from './config/configuration_helpers.js';
+import type { ProviderType } from './interfaces/configuration_interfaces.js';
+
/**
* Interface representing relevant note context
*/
@@ -36,7 +49,7 @@ export class AIServiceManager implements IAIServiceManager {
ollama: new OllamaService()
};
- private providerOrder: ServiceProviders[] = ['openai', 'anthropic', 'ollama']; // Default order
+ private providerOrder: ServiceProviders[] = []; // Will be populated from configuration
private initialized = false;
constructor() {
@@ -71,7 +84,24 @@ export class AIServiceManager implements IAIServiceManager {
}
/**
- * Update the provider precedence order from saved options
+ * Update the provider precedence order using the new configuration system
+ */
+ async updateProviderOrderAsync(): Promise {
+ try {
+ const providers = await getProviderPrecedence();
+ this.providerOrder = providers as ServiceProviders[];
+ this.initialized = true;
+ log.info(`Updated provider order: ${providers.join(', ')}`);
+ } catch (error) {
+ log.error(`Failed to get provider precedence: ${error}`);
+ // Keep empty order, will be handled gracefully by other methods
+ this.providerOrder = [];
+ this.initialized = true;
+ }
+ }
+
+ /**
+ * Update the provider precedence order (legacy sync version)
* Returns true if successful, false if options not available yet
*/
updateProviderOrder(): boolean {
@@ -79,146 +109,48 @@ export class AIServiceManager implements IAIServiceManager {
return true;
}
- try {
- // Default precedence: openai, anthropic, ollama
- const defaultOrder: ServiceProviders[] = ['openai', 'anthropic', 'ollama'];
+ // Use async version but don't wait
+ this.updateProviderOrderAsync().catch(error => {
+ log.error(`Error in async provider order update: ${error}`);
+ });
- // Get custom order from options
- const customOrder = options.getOption('aiProviderPrecedence');
-
- if (customOrder) {
- try {
- // Try to parse as JSON first
- let parsed;
-
- // Handle both array in JSON format and simple string format
- if (customOrder.startsWith('[') && customOrder.endsWith(']')) {
- parsed = JSON.parse(customOrder);
- } else if (typeof customOrder === 'string') {
- // If it's a string with commas, split it
- if (customOrder.includes(',')) {
- parsed = customOrder.split(',').map(p => p.trim());
- } else {
- // If it's a simple string (like "ollama"), convert to single-item array
- parsed = [customOrder];
- }
- } else {
- // Fallback to default
- parsed = defaultOrder;
- }
-
- // Validate that all providers are valid
- if (Array.isArray(parsed) &&
- parsed.every(p => Object.keys(this.services).includes(p))) {
- this.providerOrder = parsed as ServiceProviders[];
- } else {
- log.info('Invalid AI provider precedence format, using defaults');
- this.providerOrder = defaultOrder;
- }
- } catch (e) {
- log.error(`Failed to parse AI provider precedence: ${e}`);
- this.providerOrder = defaultOrder;
- }
- } else {
- this.providerOrder = defaultOrder;
- }
-
- this.initialized = true;
-
- // Remove the validateEmbeddingProviders call since we now do validation on the client
- // this.validateEmbeddingProviders();
-
- return true;
- } catch (error) {
- // If options table doesn't exist yet, use defaults
- // This happens during initial database creation
- this.providerOrder = ['openai', 'anthropic', 'ollama'];
- return false;
- }
+ return true;
}
/**
- * Validate embedding providers configuration
- * - Check if embedding default provider is in provider precedence list
- * - Check if all providers in precedence list and default provider are enabled
- *
- * @returns A warning message if there are issues, or null if everything is fine
+ * Validate AI configuration using the new configuration system
*/
- async validateEmbeddingProviders(): Promise {
+ async validateConfiguration(): Promise {
try {
- // Check if AI is enabled, if not, skip validation
- const aiEnabled = await options.getOptionBool('aiEnabled');
- if (!aiEnabled) {
- return null;
+ const result = await validateConfiguration();
+
+ if (!result.isValid) {
+ let message = 'There are issues with your AI configuration:';
+ for (const error of result.errors) {
+ message += `\n• ${error}`;
+ }
+ if (result.warnings.length > 0) {
+ message += '\n\nWarnings:';
+ for (const warning of result.warnings) {
+ message += `\n• ${warning}`;
+ }
+ }
+ message += '\n\nPlease check your AI settings.';
+ return message;
}
- // Get precedence list from options
- let precedenceList: string[] = ['openai']; // Default to openai if not set
- const precedenceOption = await options.getOption('aiProviderPrecedence');
-
- if (precedenceOption) {
- try {
- if (precedenceOption.startsWith('[') && precedenceOption.endsWith(']')) {
- precedenceList = JSON.parse(precedenceOption);
- } else if (typeof precedenceOption === 'string') {
- if (precedenceOption.includes(',')) {
- precedenceList = precedenceOption.split(',').map(p => p.trim());
- } else {
- precedenceList = [precedenceOption];
- }
- }
- } catch (e) {
- log.error(`Error parsing precedence list: ${e}`);
+ if (result.warnings.length > 0) {
+ let message = 'AI configuration warnings:';
+ for (const warning of result.warnings) {
+ message += `\n• ${warning}`;
}
- }
-
- // Check for configuration issues with providers in the precedence list
- const configIssues: string[] = [];
-
- // Check each provider in the precedence list for proper configuration
- for (const provider of precedenceList) {
- if (provider === 'openai') {
- // Check OpenAI configuration
- const apiKey = await options.getOption('openaiApiKey');
- if (!apiKey) {
- configIssues.push(`OpenAI API key is missing`);
- }
- } else if (provider === 'anthropic') {
- // Check Anthropic configuration
- const apiKey = await options.getOption('anthropicApiKey');
- if (!apiKey) {
- configIssues.push(`Anthropic API key is missing`);
- }
- } else if (provider === 'ollama') {
- // Check Ollama configuration
- const baseUrl = await options.getOption('ollamaBaseUrl');
- if (!baseUrl) {
- configIssues.push(`Ollama Base URL is missing`);
- }
- }
- // Add checks for other providers as needed
- }
-
- // Return warning message if there are configuration issues
- if (configIssues.length > 0) {
- let message = 'There are issues with your AI provider configuration:';
-
- for (const issue of configIssues) {
- message += `\n• ${issue}`;
- }
-
- message += '\n\nPlease check your AI settings.';
-
- // Log warning to console
- log.error('AI Provider Configuration Warning: ' + message);
-
- return message;
+ log.info(message);
}
return null;
} catch (error) {
- log.error(`Error validating embedding providers: ${error}`);
- return null;
+ log.error(`Error validating AI configuration: ${error}`);
+ return `Configuration validation failed: ${error}`;
}
}
@@ -279,18 +211,20 @@ export class AIServiceManager implements IAIServiceManager {
// If a specific provider is requested and available, use it
if (options.model && options.model.includes(':')) {
- const [providerName, modelName] = options.model.split(':');
+ // Use the new configuration system to parse model identifier
+ const modelIdentifier = parseModelIdentifier(options.model);
- if (availableProviders.includes(providerName as ServiceProviders)) {
+ if (modelIdentifier.provider && availableProviders.includes(modelIdentifier.provider as ServiceProviders)) {
try {
- const modifiedOptions = { ...options, model: modelName };
- log.info(`[AIServiceManager] Using provider ${providerName} from model prefix with modifiedOptions.stream: ${modifiedOptions.stream}`);
- return await this.services[providerName as ServiceProviders].generateChatCompletion(messages, modifiedOptions);
+ const modifiedOptions = { ...options, model: modelIdentifier.modelId };
+ log.info(`[AIServiceManager] Using provider ${modelIdentifier.provider} from model prefix with modifiedOptions.stream: ${modifiedOptions.stream}`);
+ return await this.services[modelIdentifier.provider as ServiceProviders].generateChatCompletion(messages, modifiedOptions);
} catch (error) {
- log.error(`Error with specified provider ${providerName}: ${error}`);
+ log.error(`Error with specified provider ${modelIdentifier.provider}: ${error}`);
// If the specified provider fails, continue with the fallback providers
}
}
+ // If not a provider prefix, treat the entire string as a model name and continue with normal provider selection
}
// Try each provider in order until one succeeds
@@ -390,39 +324,33 @@ export class AIServiceManager implements IAIServiceManager {
}
/**
- * Get whether AI features are enabled from options
+ * Get whether AI features are enabled using the new configuration system
+ */
+ async getAIEnabledAsync(): Promise {
+ return isAIEnabled();
+ }
+
+ /**
+ * Get whether AI features are enabled (sync version for compatibility)
*/
getAIEnabled(): boolean {
+ // For synchronous compatibility, use the old method
+ // In a full refactor, this should be async
return options.getOptionBool('aiEnabled');
}
/**
- * Set up embeddings provider for AI features
+ * Set up embeddings provider using the new configuration system
*/
async setupEmbeddingsProvider(): Promise {
try {
- if (!this.getAIEnabled()) {
+ const aiEnabled = await isAIEnabled();
+ if (!aiEnabled) {
log.info('AI features are disabled');
return;
}
- // Get provider precedence list
- const precedenceOption = await options.getOption('embeddingProviderPrecedence');
- let precedenceList: string[] = [];
-
- if (precedenceOption) {
- if (precedenceOption.startsWith('[') && precedenceOption.endsWith(']')) {
- precedenceList = JSON.parse(precedenceOption);
- } else if (typeof precedenceOption === 'string') {
- if (precedenceOption.includes(',')) {
- precedenceList = precedenceOption.split(',').map(p => p.trim());
- } else {
- precedenceList = [precedenceOption];
- }
- }
- }
-
- // Check if we have enabled providers
+ // Use the new configuration system - no string parsing!
const enabledProviders = await getEnabledEmbeddingProviders();
if (enabledProviders.length === 0) {
@@ -439,20 +367,23 @@ export class AIServiceManager implements IAIServiceManager {
}
/**
- * Initialize the AI Service
+ * Initialize the AI Service using the new configuration system
*/
async initialize(): Promise {
try {
log.info("Initializing AI service...");
- // Check if AI is enabled in options
- const isAIEnabled = this.getAIEnabled();
+ // Check if AI is enabled using the new helper
+ const aiEnabled = await isAIEnabled();
- if (!isAIEnabled) {
+ if (!aiEnabled) {
log.info("AI features are disabled in options");
return;
}
+ // Update provider order from configuration
+ await this.updateProviderOrderAsync();
+
// Set up embeddings provider if AI is enabled
await this.setupEmbeddingsProvider();
@@ -586,7 +517,25 @@ export class AIServiceManager implements IAIServiceManager {
}
/**
- * Get the preferred provider based on configuration
+ * Get the preferred provider based on configuration using the new system
+ */
+ async getPreferredProviderAsync(): Promise {
+ try {
+ const preferredProvider = await getPreferredProvider();
+ if (preferredProvider === null) {
+ // No providers configured, fallback to first available
+ log.info('No providers configured in precedence, using first available provider');
+ return this.providerOrder[0];
+ }
+ return preferredProvider;
+ } catch (error) {
+ log.error(`Error getting preferred provider: ${error}`);
+ return this.providerOrder[0];
+ }
+ }
+
+ /**
+ * Get the preferred provider based on configuration (sync version for compatibility)
*/
getPreferredProvider(): string {
this.ensureInitialized();
@@ -669,7 +618,7 @@ export default {
},
// Add validateEmbeddingProviders method
async validateEmbeddingProviders(): Promise {
- return getInstance().validateEmbeddingProviders();
+ return getInstance().validateConfiguration();
},
// Context and index related methods
getContextExtractor() {
diff --git a/apps/server/src/services/llm/chat/handlers/tool_handler.ts b/apps/server/src/services/llm/chat/handlers/tool_handler.ts
index 076664f63..40520ebe3 100644
--- a/apps/server/src/services/llm/chat/handlers/tool_handler.ts
+++ b/apps/server/src/services/llm/chat/handlers/tool_handler.ts
@@ -3,7 +3,6 @@
*/
import log from "../../../log.js";
import type { Message } from "../../ai_interface.js";
-import SessionsStore from "../sessions_store.js";
/**
* Handles the execution of LLM tools
@@ -101,11 +100,6 @@ export class ToolHandler {
: JSON.stringify(result).substring(0, 100) + '...';
log.info(`Tool result: ${resultPreview}`);
- // Record tool execution in session if chatNoteId is provided
- if (chatNoteId) {
- SessionsStore.recordToolExecution(chatNoteId, toolCall, typeof result === 'string' ? result : JSON.stringify(result));
- }
-
// Format result as a proper message
return {
role: 'tool',
@@ -116,11 +110,6 @@ export class ToolHandler {
} catch (error: any) {
log.error(`Error executing tool ${toolCall.function.name}: ${error.message}`);
- // Record error in session if chatNoteId is provided
- if (chatNoteId) {
- SessionsStore.recordToolExecution(chatNoteId, toolCall, '', error.message);
- }
-
// Return error as tool result
return {
role: 'tool',
diff --git a/apps/server/src/services/llm/chat/index.ts b/apps/server/src/services/llm/chat/index.ts
index d82554229..79b587a09 100644
--- a/apps/server/src/services/llm/chat/index.ts
+++ b/apps/server/src/services/llm/chat/index.ts
@@ -2,7 +2,6 @@
* Chat module export
*/
import restChatService from './rest_chat_service.js';
-import sessionsStore from './sessions_store.js';
import { ContextHandler } from './handlers/context_handler.js';
import { ToolHandler } from './handlers/tool_handler.js';
import { StreamHandler } from './handlers/stream_handler.js';
@@ -13,7 +12,6 @@ import type { LLMStreamMessage } from '../interfaces/chat_ws_messages.js';
// Export components
export {
restChatService as default,
- sessionsStore,
ContextHandler,
ToolHandler,
StreamHandler,
diff --git a/apps/server/src/services/llm/chat/rest_chat_service.ts b/apps/server/src/services/llm/chat/rest_chat_service.ts
index 0a400ad91..1ad3d7a22 100644
--- a/apps/server/src/services/llm/chat/rest_chat_service.ts
+++ b/apps/server/src/services/llm/chat/rest_chat_service.ts
@@ -1,5 +1,6 @@
/**
- * Service to handle chat API interactions
+ * Simplified service to handle chat API interactions
+ * Works directly with ChatStorageService - no complex session management
*/
import log from "../../log.js";
import type { Request, Response } from "express";
@@ -8,21 +9,16 @@ import { AIServiceManager } from "../ai_service_manager.js";
import { ChatPipeline } from "../pipeline/chat_pipeline.js";
import type { ChatPipelineInput } from "../pipeline/interfaces.js";
import options from "../../options.js";
-import { SEARCH_CONSTANTS } from '../constants/search_constants.js';
-
-// Import our refactored modules
-import { ContextHandler } from "./handlers/context_handler.js";
import { ToolHandler } from "./handlers/tool_handler.js";
-import { StreamHandler } from "./handlers/stream_handler.js";
-import SessionsStore from "./sessions_store.js";
-import * as MessageFormatter from "./utils/message_formatter.js";
-import type { NoteSource } from "../interfaces/chat_session.js";
import type { LLMStreamMessage } from "../interfaces/chat_ws_messages.js";
-import type { ChatMessage } from '../interfaces/chat_session.js';
-import type { ChatSession } from '../interfaces/chat_session.js';
+import chatStorageService from '../chat_storage_service.js';
+import {
+ isAIEnabled,
+ getFirstValidModelConfig,
+} from '../config/configuration_helpers.js';
/**
- * Service to handle chat API interactions
+ * Simplified service to handle chat API interactions
*/
class RestChatService {
/**
@@ -41,35 +37,15 @@ class RestChatService {
* Check if AI services are available
*/
safelyUseAIManager(): boolean {
- // Only use AI manager if database is initialized
if (!this.isDatabaseInitialized()) {
log.info("AI check failed: Database is not initialized");
return false;
}
- // Try to access the manager - will create instance only if needed
try {
- // Create local instance to avoid circular references
const aiManager = new AIServiceManager();
-
- if (!aiManager) {
- log.info("AI check failed: AI manager module is not available");
- return false;
- }
-
const isAvailable = aiManager.isAnyServiceAvailable();
log.info(`AI service availability check result: ${isAvailable}`);
-
- if (isAvailable) {
- // Additional diagnostics
- try {
- const providers = aiManager.getAvailableProviders();
- log.info(`Available AI providers: ${providers.join(', ')}`);
- } catch (err) {
- log.info(`Could not get available providers: ${err}`);
- }
- }
-
return isAvailable;
} catch (error) {
log.error(`Error accessing AI service manager: ${error}`);
@@ -79,505 +55,330 @@ class RestChatService {
/**
* Handle a message sent to an LLM and get a response
+ * Simplified to work directly with chat storage
*/
async handleSendMessage(req: Request, res: Response) {
- log.info("=== Starting handleSendMessage ===");
+ log.info("=== Starting simplified handleSendMessage ===");
try {
- // Extract parameters differently based on the request method
+ // Extract parameters
let content, useAdvancedContext, showThinking, chatNoteId;
if (req.method === 'POST') {
- // For POST requests, get content from the request body
const requestBody = req.body || {};
content = requestBody.content;
useAdvancedContext = requestBody.useAdvancedContext || false;
showThinking = requestBody.showThinking || false;
-
- // Add logging for POST requests
- log.info(`LLM POST message: chatNoteId=${req.params.chatNoteId}, useAdvancedContext=${useAdvancedContext}, showThinking=${showThinking}, contentLength=${content ? content.length : 0}`);
+ log.info(`LLM POST message: chatNoteId=${req.params.chatNoteId}, contentLength=${content ? content.length : 0}`);
} else if (req.method === 'GET') {
- // For GET (streaming) requests, get parameters from query params and body
- // For streaming requests, we need the content from the body
useAdvancedContext = req.query.useAdvancedContext === 'true' || (req.body && req.body.useAdvancedContext === true);
showThinking = req.query.showThinking === 'true' || (req.body && req.body.showThinking === true);
content = req.body && req.body.content ? req.body.content : '';
-
- // Add detailed logging for GET requests
- log.info(`LLM GET stream: chatNoteId=${req.params.chatNoteId}, useAdvancedContext=${useAdvancedContext}, showThinking=${showThinking}`);
- log.info(`Parameters from query: useAdvancedContext=${req.query.useAdvancedContext}, showThinking=${req.query.showThinking}`);
- log.info(`Parameters from body: useAdvancedContext=${req.body?.useAdvancedContext}, showThinking=${req.body?.showThinking}, content=${content ? `${content.substring(0, 20)}...` : 'none'}`);
+ log.info(`LLM GET stream: chatNoteId=${req.params.chatNoteId}`);
}
- // Get chatNoteId from URL params
chatNoteId = req.params.chatNoteId;
- // For GET requests, ensure we have the stream parameter
+ // Validate inputs
if (req.method === 'GET' && req.query.stream !== 'true') {
throw new Error('Stream parameter must be set to true for GET/streaming requests');
}
- // For POST requests, validate the content
if (req.method === 'POST' && (!content || typeof content !== 'string' || content.trim().length === 0)) {
throw new Error('Content cannot be empty');
}
- // Get or create session from Chat Note
- let session = await this.getOrCreateSessionFromChatNote(chatNoteId, req.method === 'POST');
+ // Check if AI is enabled
+ const aiEnabled = await options.getOptionBool('aiEnabled');
+ if (!aiEnabled) {
+ return { error: "AI features are disabled. Please enable them in the settings." };
+ }
- // If no session found and we're not allowed to create one (GET request)
- if (!session && req.method === 'GET') {
+ if (!this.safelyUseAIManager()) {
+ return { error: "AI services are currently unavailable. Please check your configuration." };
+ }
+
+ // Load or create chat directly from storage
+ let chat = await chatStorageService.getChat(chatNoteId);
+
+ if (!chat && req.method === 'GET') {
throw new Error('Chat Note not found, cannot create session for streaming');
}
- // For POST requests, if no Chat Note exists, create a new one
- if (!session && req.method === 'POST') {
- log.info(`No Chat Note found for ${chatNoteId}, creating a new Chat Note and session`);
-
- // Create a new Chat Note via the storage service
- //const chatStorageService = (await import('../../llm/chat_storage_service.js')).default;
- //const newChat = await chatStorageService.createChat('New Chat');
-
- // Use the new Chat Note's ID for the session
- session = SessionsStore.createSession({
- //title: newChat.title,
- chatNoteId: chatNoteId
- });
-
- // Update the session ID to match the Chat Note ID
- session.id = chatNoteId;
-
- log.info(`Created new Chat Note and session with ID: ${session.id}`);
-
- // Update the parameter to use the new ID
- chatNoteId = session.id;
+ if (!chat && req.method === 'POST') {
+ log.info(`Creating new chat note with ID: ${chatNoteId}`);
+ chat = await chatStorageService.createChat('New Chat');
+ // Update the chat ID to match the requested ID if possible
+ // In practice, we'll use the generated ID
+ chatNoteId = chat.id;
}
- // At this point, session should never be null
- // TypeScript doesn't know this, so we'll add a check
- if (!session) {
- // This should never happen due to our logic above
- throw new Error('Failed to create or retrieve session');
+ if (!chat) {
+ throw new Error('Failed to create or retrieve chat');
}
- // Update session last active timestamp
- SessionsStore.touchSession(session.id);
-
- // For POST requests, store the user message
- if (req.method === 'POST' && content && session) {
- // Add message to session
- session.messages.push({
+ // For POST requests, add the user message to the chat immediately
+ // This ensures user messages are always saved
+ if (req.method === 'POST' && content) {
+ chat.messages.push({
role: 'user',
- content,
- timestamp: new Date()
+ content
});
-
- // Log a preview of the message
- log.info(`Processing LLM message: "${content.substring(0, 50)}${content.length > 50 ? '...' : ''}"`);
- }
-
- // Check if AI services are enabled before proceeding
- const aiEnabled = await options.getOptionBool('aiEnabled');
- log.info(`AI enabled setting: ${aiEnabled}`);
- if (!aiEnabled) {
- log.info("AI services are disabled by configuration");
- return {
- error: "AI features are disabled. Please enable them in the settings."
- };
- }
-
- // Check if AI services are available
- log.info("Checking if AI services are available...");
- if (!this.safelyUseAIManager()) {
- log.info("AI services are not available - checking for specific issues");
-
- try {
- // Create a direct instance to avoid circular references
- const aiManager = new AIServiceManager();
-
- if (!aiManager) {
- log.error("AI service manager is not initialized");
- return {
- error: "AI service is not properly initialized. Please check your configuration."
- };
- }
-
- const availableProviders = aiManager.getAvailableProviders();
- if (availableProviders.length === 0) {
- log.error("No AI providers are available");
- return {
- error: "No AI providers are configured or available. Please check your AI settings."
- };
- }
- } catch (err) {
- log.error(`Detailed AI service check failed: ${err}`);
- }
-
- return {
- error: "AI services are currently unavailable. Please check your configuration."
- };
- }
-
- // Create direct instance to avoid circular references
- const aiManager = new AIServiceManager();
-
- // Get the default service - just use the first available one
- const availableProviders = aiManager.getAvailableProviders();
-
- if (availableProviders.length === 0) {
- log.error("No AI providers are available after manager check");
- return {
- error: "No AI providers are configured or available. Please check your AI settings."
- };
- }
-
- // Use the first available provider
- const providerName = availableProviders[0];
- log.info(`Using AI provider: ${providerName}`);
-
- // We know the manager has a 'services' property from our code inspection,
- // but TypeScript doesn't know that from the interface.
- // This is a workaround to access it
- const service = (aiManager as any).services[providerName];
-
- if (!service) {
- log.error(`AI service for provider ${providerName} not found`);
- return {
- error: `Selected AI provider (${providerName}) is not available. Please check your configuration.`
- };
+ // Save immediately to ensure user message is saved
+ await chatStorageService.updateChat(chat.id, chat.messages, chat.title);
+ log.info(`Added and saved user message: "${content.substring(0, 50)}${content.length > 50 ? '...' : ''}"`);
}
// Initialize tools
- log.info("Initializing LLM agent tools...");
- // Ensure tools are initialized to prevent tool execution issues
await ToolHandler.ensureToolsInitialized();
- // Create and use the chat pipeline instead of direct processing
+ // Create and use the chat pipeline
const pipeline = new ChatPipeline({
enableStreaming: req.method === 'GET',
enableMetrics: true,
maxToolCallIterations: 5
});
- log.info("Executing chat pipeline...");
+ // Get user's preferred model
+ const preferredModel = await this.getPreferredModel();
- // Create options object for better tracking
const pipelineOptions = {
- // Force useAdvancedContext to be a boolean, no matter what
useAdvancedContext: useAdvancedContext === true,
- systemPrompt: session?.messages.find(m => m.role === 'system')?.content,
- temperature: session?.metadata.temperature,
- maxTokens: session?.metadata.maxTokens,
- model: session?.metadata.model,
- // Set stream based on request type, but ensure it's explicitly a boolean value
- // GET requests or format=stream parameter indicates streaming should be used
+ systemPrompt: chat.messages.find(m => m.role === 'system')?.content,
+ model: preferredModel,
stream: !!(req.method === 'GET' || req.query.format === 'stream' || req.query.stream === 'true'),
- // Include chatNoteId for tracking tool executions
chatNoteId: chatNoteId
};
- // Log the options to verify what's being sent to the pipeline
- log.info(`Pipeline input options: ${JSON.stringify({
- useAdvancedContext: pipelineOptions.useAdvancedContext,
- stream: pipelineOptions.stream
- })}`);
+ log.info(`Pipeline options: ${JSON.stringify({ useAdvancedContext: pipelineOptions.useAdvancedContext, stream: pipelineOptions.stream })}`);
- // Import the WebSocket service for direct access
+ // Import WebSocket service for streaming
const wsService = await import('../../ws.js');
+ const accumulatedContentRef = { value: '' };
- // Create a stream callback wrapper
- // This will ensure we properly handle all streaming messages
- let messageContent = '';
-
- // Prepare the pipeline input
const pipelineInput: ChatPipelineInput = {
- messages: session.messages.map(msg => ({
+ messages: chat.messages.map(msg => ({
role: msg.role as 'user' | 'assistant' | 'system',
content: msg.content
})),
- query: content || '', // Ensure query is always a string, even if content is null/undefined
- noteId: session.noteContext ?? undefined,
+ query: content || '',
+ noteId: undefined, // TODO: Add context note support if needed
showThinking: showThinking,
options: pipelineOptions,
streamCallback: req.method === 'GET' ? (data, done, rawChunk) => {
- try {
- // Use WebSocket service to send messages
- this.handleStreamCallback(
- data, done, rawChunk,
- wsService.default, chatNoteId,
- messageContent, session, res
- );
- } catch (error) {
- log.error(`Error in stream callback: ${error}`);
-
- // Try to send error message
- try {
- wsService.default.sendMessageToAllClients({
- type: 'llm-stream',
- chatNoteId: chatNoteId,
- error: `Stream error: ${error instanceof Error ? error.message : 'Unknown error'}`,
- done: true
- });
-
- // End the response
- res.write(`data: ${JSON.stringify({ error: 'Stream error', done: true })}\n\n`);
- res.end();
- } catch (e) {
- log.error(`Failed to send error message: ${e}`);
- }
- }
+ this.handleStreamCallback(data, done, rawChunk, wsService.default, chatNoteId, res, accumulatedContentRef, chat);
} : undefined
};
// Execute the pipeline
const response = await pipeline.execute(pipelineInput);
- // Handle the response
if (req.method === 'POST') {
- // Add assistant message to session
- session.messages.push({
+ // Add assistant response to chat
+ chat.messages.push({
role: 'assistant',
- content: response.text || '',
- timestamp: new Date()
+ content: response.text || ''
});
- // Extract sources if they're available
+ // Save the updated chat back to storage (single source of truth)
+ await chatStorageService.updateChat(chat.id, chat.messages, chat.title);
+ log.info(`Saved non-streaming assistant response: ${(response.text || '').length} characters`);
+
+ // Extract sources if available
const sources = (response as any).sources || [];
- // Store sources in the session metadata if they're present
- if (sources.length > 0) {
- session.metadata.sources = sources;
- log.info(`Stored ${sources.length} sources in session metadata`);
- }
-
- // Return the response with complete metadata
return {
content: response.text || '',
sources: sources,
metadata: {
- model: response.model || session.metadata.model,
- provider: response.provider || session.metadata.provider,
- temperature: session.metadata.temperature,
- maxTokens: session.metadata.maxTokens,
- lastUpdated: new Date().toISOString(),
- toolExecutions: session.metadata.toolExecutions || []
+ model: response.model,
+ provider: response.provider,
+ lastUpdated: new Date().toISOString()
}
};
} else {
- // For streaming requests, we've already sent the response
+ // For streaming, response is already sent via WebSocket/SSE
+ // The accumulatedContentRef will have been saved in handleStreamCallback when done=true
return null;
}
- } catch (processingError: any) {
- log.error(`Error processing message: ${processingError}`);
- return {
- error: `Error processing your request: ${processingError.message}`
- };
+ } catch (error: any) {
+ log.error(`Error processing message: ${error}`);
+ return { error: `Error processing your request: ${error.message}` };
}
}
/**
- * Handle stream callback for WebSocket communication
+ * Simplified stream callback handler
*/
- private handleStreamCallback(
+ private async handleStreamCallback(
data: string | null,
done: boolean,
rawChunk: any,
wsService: any,
chatNoteId: string,
- messageContent: string,
- session: any,
- res: Response
+ res: Response,
+ accumulatedContentRef: { value: string },
+ chat: { id: string; messages: Message[]; title: string }
) {
- // Only accumulate content that's actually text (not tool execution or thinking info)
- if (data) {
- messageContent += data;
- }
-
- // Create a message object with all necessary fields
const message: LLMStreamMessage = {
type: 'llm-stream',
- chatNoteId: chatNoteId
+ chatNoteId: chatNoteId,
+ done: done
};
- // Add content if available - either the new chunk or full content on completion
if (data) {
message.content = data;
+ // Simple accumulation - just append the new data
+ accumulatedContentRef.value += data;
}
- // Add thinking info if available in the raw chunk
+ // Only include thinking if explicitly present in rawChunk
if (rawChunk && 'thinking' in rawChunk && rawChunk.thinking) {
message.thinking = rawChunk.thinking as string;
}
- // Add tool execution info if available in the raw chunk
+ // Only include tool execution if explicitly present in rawChunk
if (rawChunk && 'toolExecution' in rawChunk && rawChunk.toolExecution) {
- // Transform the toolExecution to match the expected format
const toolExec = rawChunk.toolExecution;
message.toolExecution = {
- // Use optional chaining for all properties
- tool: typeof toolExec.tool === 'string'
- ? toolExec.tool
- : toolExec.tool?.name,
+ tool: typeof toolExec.tool === 'string' ? toolExec.tool : toolExec.tool?.name,
result: toolExec.result,
- // Map arguments to args
args: 'arguments' in toolExec ?
- (typeof toolExec.arguments === 'object' ?
- toolExec.arguments as Record : {}) : {},
- // Add additional properties if they exist
+ (typeof toolExec.arguments === 'object' ? toolExec.arguments as Record : {}) : {},
action: 'action' in toolExec ? toolExec.action as string : undefined,
toolCallId: 'toolCallId' in toolExec ? toolExec.toolCallId as string : undefined,
error: 'error' in toolExec ? toolExec.error as string : undefined
};
}
- // Set done flag explicitly
- message.done = done;
-
- // On final message, include the complete content too
- if (done) {
- // Store the response in the session when done
- session.messages.push({
- role: 'assistant',
- content: messageContent,
- timestamp: new Date()
- });
- }
-
- // Send message to all clients
+ // Send WebSocket message
wsService.sendMessageToAllClients(message);
- // Log what was sent (first message and completion)
- if (message.thinking || done) {
- log.info(
- `[WS-SERVER] Sending LLM stream message: chatNoteId=${chatNoteId}, content=${!!message.content}, contentLength=${message.content?.length || 0}, thinking=${!!message.thinking}, toolExecution=${!!message.toolExecution}, done=${done}`
- );
- }
-
- // For GET requests, also send as server-sent events
- // Prepare response data for JSON event
- const responseData: any = {
- content: data,
- done
- };
-
- // Add tool execution if available
+ // Send SSE response for compatibility
+ const responseData: any = { content: data, done };
if (rawChunk?.toolExecution) {
responseData.toolExecution = rawChunk.toolExecution;
}
- // Send the data as a JSON event
res.write(`data: ${JSON.stringify(responseData)}\n\n`);
-
+
+ // When streaming is complete, save the accumulated content to the chat note
if (done) {
+ try {
+ // Only save if we have accumulated content
+ if (accumulatedContentRef.value) {
+ // Add assistant response to chat
+ chat.messages.push({
+ role: 'assistant',
+ content: accumulatedContentRef.value
+ });
+
+ // Save the updated chat back to storage
+ await chatStorageService.updateChat(chat.id, chat.messages, chat.title);
+ log.info(`Saved streaming assistant response: ${accumulatedContentRef.value.length} characters`);
+ }
+ } catch (error) {
+ // Log error but don't break the response flow
+ log.error(`Error saving streaming response: ${error}`);
+ }
+
+ // End the response
res.end();
}
}
/**
- * Create a new chat session
+ * Create a new chat
*/
async createSession(req: Request, res: Response) {
try {
const options: any = req.body || {};
const title = options.title || 'Chat Session';
- // Use the currentNoteId as the chatNoteId if provided
- let chatNoteId = options.chatNoteId;
+ let noteId = options.noteId || options.chatNoteId;
- // If currentNoteId is provided but chatNoteId is not, use currentNoteId
- if (!chatNoteId && options.currentNoteId) {
- chatNoteId = options.currentNoteId;
- log.info(`Using provided currentNoteId ${chatNoteId} as chatNoteId`);
+ // Check if currentNoteId is already an AI Chat note
+ if (!noteId && options.currentNoteId) {
+ const becca = (await import('../../../becca/becca.js')).default;
+ const note = becca.notes[options.currentNoteId];
+
+ if (note) {
+ try {
+ const content = note.getContent();
+ if (content) {
+ const contentStr = typeof content === 'string' ? content : content.toString();
+ const parsedContent = JSON.parse(contentStr);
+ if (parsedContent.messages && Array.isArray(parsedContent.messages)) {
+ noteId = options.currentNoteId;
+ log.info(`Using existing AI Chat note ${noteId} as session`);
+ }
+ }
+ } catch (_) {
+ // Not JSON content, so not an AI Chat note
+ }
+ }
}
- // If we still don't have a chatNoteId, create a new Chat Note
- if (!chatNoteId) {
- // Create a new Chat Note via the storage service
- const chatStorageService = (await import('../../llm/chat_storage_service.js')).default;
+ // Create new chat if needed
+ if (!noteId) {
const newChat = await chatStorageService.createChat(title);
- chatNoteId = newChat.id;
- log.info(`Created new Chat Note with ID: ${chatNoteId}`);
+ noteId = newChat.id;
+ log.info(`Created new Chat Note with ID: ${noteId}`);
+ } else {
+ log.info(`Using existing Chat Note with ID: ${noteId}`);
}
- // Create a new session through our session store
- const session = SessionsStore.createSession({
- chatNoteId,
- title,
- systemPrompt: options.systemPrompt,
- contextNoteId: options.contextNoteId,
- maxTokens: options.maxTokens,
- model: options.model,
- provider: options.provider,
- temperature: options.temperature
- });
-
return {
- id: session.id,
- title: session.title,
- createdAt: session.createdAt,
- noteId: chatNoteId // Return the note ID explicitly
+ id: noteId,
+ title: title,
+ createdAt: new Date(),
+ noteId: noteId
};
} catch (error: any) {
- log.error(`Error creating LLM session: ${error.message || 'Unknown error'}`);
- throw new Error(`Failed to create LLM session: ${error.message || 'Unknown error'}`);
+ log.error(`Error creating chat session: ${error.message || 'Unknown error'}`);
+ throw new Error(`Failed to create chat session: ${error.message || 'Unknown error'}`);
}
}
/**
- * Get a specific chat session by ID
+ * Get a chat by ID
*/
- async getSession(req: Request, res: Response) {
+ async getSession(req: Request, res: Response): Promise {
try {
const { sessionId } = req.params;
- // Check if session exists
- const session = SessionsStore.getSession(sessionId);
- if (!session) {
- // Instead of throwing an error, return a structured 404 response
- // that the frontend can handle gracefully
+ const chat = await chatStorageService.getChat(sessionId);
+ if (!chat) {
res.status(404).json({
error: true,
message: `Session with ID ${sessionId} not found`,
code: 'session_not_found',
sessionId
});
- return null; // Return null to prevent further processing
+ return null;
}
- // Return session with metadata and additional fields
return {
- id: session.id,
- title: session.title,
- createdAt: session.createdAt,
- lastActive: session.lastActive,
- messages: session.messages,
- noteContext: session.noteContext,
- // Include additional fields for the frontend
- sources: session.metadata.sources || [],
- metadata: {
- model: session.metadata.model,
- provider: session.metadata.provider,
- temperature: session.metadata.temperature,
- maxTokens: session.metadata.maxTokens,
- lastUpdated: session.lastActive.toISOString(),
- // Include simplified tool executions if available
- toolExecutions: session.metadata.toolExecutions || []
- }
+ id: chat.id,
+ title: chat.title,
+ createdAt: chat.createdAt,
+ lastActive: chat.updatedAt,
+ messages: chat.messages,
+ metadata: chat.metadata || {}
};
} catch (error: any) {
- log.error(`Error getting LLM session: ${error.message || 'Unknown error'}`);
+ log.error(`Error getting chat session: ${error.message || 'Unknown error'}`);
throw new Error(`Failed to get session: ${error.message || 'Unknown error'}`);
}
}
/**
- * Delete a chat session
+ * Delete a chat
*/
async deleteSession(req: Request, res: Response) {
try {
const { sessionId } = req.params;
- // Delete the session
- const success = SessionsStore.deleteSession(sessionId);
+ const success = await chatStorageService.deleteChat(sessionId);
if (!success) {
throw new Error(`Session with ID ${sessionId} not found`);
}
@@ -587,91 +388,47 @@ class RestChatService {
message: `Session ${sessionId} deleted successfully`
};
} catch (error: any) {
- log.error(`Error deleting LLM session: ${error.message || 'Unknown error'}`);
+ log.error(`Error deleting chat session: ${error.message || 'Unknown error'}`);
throw new Error(`Failed to delete session: ${error.message || 'Unknown error'}`);
}
}
/**
- * Get all sessions
+ * Get all chats
*/
- getSessions() {
- return SessionsStore.getAllSessions();
- }
-
- /**
- * Create an in-memory session from a Chat Note
- * This treats the Chat Note as the source of truth, using its ID as the session ID
- */
- async createSessionFromChatNote(noteId: string): Promise {
+ async getAllSessions() {
try {
- log.info(`Creating in-memory session for Chat Note ID ${noteId}`);
-
- // Import chat storage service
- const chatStorageService = (await import('../../llm/chat_storage_service.js')).default;
-
- // Try to get the Chat Note data
- const chatNote = await chatStorageService.getChat(noteId);
-
- if (!chatNote) {
- log.error(`Chat Note ${noteId} not found, cannot create session`);
- return null;
- }
-
- log.info(`Found Chat Note ${noteId}, creating in-memory session`);
-
- // Convert Message[] to ChatMessage[] by ensuring the role is compatible
- const chatMessages: ChatMessage[] = chatNote.messages.map(msg => ({
- role: msg.role === 'tool' ? 'assistant' : msg.role, // Map 'tool' role to 'assistant'
- content: msg.content,
- timestamp: new Date()
- }));
-
- // Create a new session with the same ID as the Chat Note
- const session: ChatSession = {
- id: chatNote.id, // Use Chat Note ID as the session ID
- title: chatNote.title,
- messages: chatMessages,
- createdAt: chatNote.createdAt || new Date(),
- lastActive: new Date(),
- metadata: chatNote.metadata || {}
+ const chats = await chatStorageService.getAllChats();
+ return {
+ sessions: chats.map(chat => ({
+ id: chat.id,
+ title: chat.title,
+ createdAt: chat.createdAt,
+ lastActive: chat.updatedAt,
+ messageCount: chat.messages.length
+ }))
};
-
- // Add the session to the in-memory store
- SessionsStore.getAllSessions().set(noteId, session);
-
- log.info(`Successfully created in-memory session for Chat Note ${noteId}`);
- return session;
- } catch (error) {
- log.error(`Failed to create session from Chat Note: ${error}`);
- return null;
+ } catch (error: any) {
+ log.error(`Error listing sessions: ${error}`);
+ throw new Error(`Failed to list sessions: ${error}`);
}
}
/**
- * Get an existing session or create a new one from a Chat Note
- * This treats the Chat Note as the source of truth, using its ID as the session ID
+ * Get the user's preferred model
*/
- async getOrCreateSessionFromChatNote(noteId: string, createIfNotFound: boolean = true): Promise {
- // First check if we already have this session in memory
- let session = SessionsStore.getSession(noteId);
-
- if (session) {
- log.info(`Found existing in-memory session for Chat Note ${noteId}`);
- return session;
+ async getPreferredModel(): Promise {
+ try {
+ const validConfig = await getFirstValidModelConfig();
+ if (!validConfig) {
+ log.error('No valid AI model configuration found');
+ return undefined;
+ }
+ return validConfig.model;
+ } catch (error) {
+ log.error(`Error getting preferred model: ${error}`);
+ return undefined;
}
-
- // If not in memory, try to create from Chat Note
- log.info(`Session not found in memory for Chat Note ${noteId}, attempting to create it`);
-
- // Only try to create if allowed
- if (!createIfNotFound) {
- log.info(`Not creating new session for ${noteId} as createIfNotFound=false`);
- return null;
- }
-
- // Create from Chat Note
- return await this.createSessionFromChatNote(noteId);
}
}
diff --git a/apps/server/src/services/llm/chat/sessions_store.ts b/apps/server/src/services/llm/chat/sessions_store.ts
deleted file mode 100644
index 65715ab23..000000000
--- a/apps/server/src/services/llm/chat/sessions_store.ts
+++ /dev/null
@@ -1,169 +0,0 @@
-/**
- * In-memory storage for chat sessions
- */
-import log from "../../log.js";
-import { LLM_CONSTANTS } from '../constants/provider_constants.js';
-import { SEARCH_CONSTANTS } from '../constants/search_constants.js';
-import { randomString } from "../../utils.js";
-import type { ChatSession, ChatMessage } from '../interfaces/chat_session.js';
-
-// In-memory storage for sessions
-const sessions = new Map();
-
-// Flag to track if cleanup timer has been initialized
-let cleanupInitialized = false;
-
-/**
- * Provides methods to manage chat sessions
- */
-class SessionsStore {
- /**
- * Initialize the session cleanup timer to remove old/inactive sessions
- */
- initializeCleanupTimer(): void {
- if (cleanupInitialized) {
- return;
- }
-
- // Clean sessions that have expired based on the constants
- function cleanupOldSessions() {
- const expiryTime = new Date(Date.now() - LLM_CONSTANTS.SESSION.SESSION_EXPIRY_MS);
- for (const [sessionId, session] of sessions.entries()) {
- if (session.lastActive < expiryTime) {
- sessions.delete(sessionId);
- }
- }
- }
-
- // Run cleanup at the configured interval
- setInterval(cleanupOldSessions, LLM_CONSTANTS.SESSION.CLEANUP_INTERVAL_MS);
- cleanupInitialized = true;
- log.info("Session cleanup timer initialized");
- }
-
- /**
- * Get all sessions
- */
- getAllSessions(): Map {
- return sessions;
- }
-
- /**
- * Get a specific session by ID
- */
- getSession(sessionId: string): ChatSession | undefined {
- return sessions.get(sessionId);
- }
-
- /**
- * Create a new session
- */
- createSession(options: {
- chatNoteId: string;
- title?: string;
- systemPrompt?: string;
- contextNoteId?: string;
- maxTokens?: number;
- model?: string;
- provider?: string;
- temperature?: number;
- }): ChatSession {
- this.initializeCleanupTimer();
-
- const title = options.title || 'Chat Session';
- const sessionId = options.chatNoteId;
- const now = new Date();
-
- // Initial system message if provided
- const messages: ChatMessage[] = [];
- if (options.systemPrompt) {
- messages.push({
- role: 'system',
- content: options.systemPrompt,
- timestamp: now
- });
- }
-
- // Create and store the session
- const session: ChatSession = {
- id: sessionId,
- title,
- messages,
- createdAt: now,
- lastActive: now,
- noteContext: options.contextNoteId,
- metadata: {
- temperature: options.temperature || SEARCH_CONSTANTS.TEMPERATURE.DEFAULT,
- maxTokens: options.maxTokens,
- model: options.model,
- provider: options.provider,
- sources: [],
- toolExecutions: [],
- lastUpdated: now.toISOString()
- }
- };
-
- sessions.set(sessionId, session);
- log.info(`Created in-memory session for Chat Note ID: ${sessionId}`);
-
- return session;
- }
-
- /**
- * Update a session's last active timestamp
- */
- touchSession(sessionId: string): boolean {
- const session = sessions.get(sessionId);
- if (!session) {
- return false;
- }
-
- session.lastActive = new Date();
- return true;
- }
-
- /**
- * Delete a session
- */
- deleteSession(sessionId: string): boolean {
- return sessions.delete(sessionId);
- }
-
- /**
- * Record a tool execution in the session metadata
- */
- recordToolExecution(chatNoteId: string, tool: any, result: string, error?: string): void {
- if (!chatNoteId) return;
-
- const session = sessions.get(chatNoteId);
- if (!session) return;
-
- try {
- const toolExecutions = session.metadata.toolExecutions || [];
-
- // Format tool execution record
- const execution = {
- id: tool.id || `tool-${Date.now()}-${Math.random().toString(36).substring(2, 7)}`,
- name: tool.function?.name || 'unknown',
- arguments: typeof tool.function?.arguments === 'string'
- ? (() => { try { return JSON.parse(tool.function.arguments); } catch { return tool.function.arguments; } })()
- : tool.function?.arguments || {},
- result: result,
- error: error,
- timestamp: new Date().toISOString()
- };
-
- // Add to tool executions
- toolExecutions.push(execution);
- session.metadata.toolExecutions = toolExecutions;
-
- log.info(`Recorded tool execution for ${execution.name} in session ${chatNoteId}`);
- } catch (err) {
- log.error(`Failed to record tool execution: ${err}`);
- }
- }
-}
-
-// Create singleton instance
-const sessionsStore = new SessionsStore();
-export default sessionsStore;
diff --git a/apps/server/src/services/llm/config/configuration_helpers.ts b/apps/server/src/services/llm/config/configuration_helpers.ts
new file mode 100644
index 000000000..88d2cf1da
--- /dev/null
+++ b/apps/server/src/services/llm/config/configuration_helpers.ts
@@ -0,0 +1,179 @@
+import configurationManager from './configuration_manager.js';
+import type {
+ ProviderType,
+ ModelIdentifier,
+ ModelConfig,
+ ProviderPrecedenceConfig,
+ EmbeddingProviderPrecedenceConfig
+} from '../interfaces/configuration_interfaces.js';
+
+/**
+ * Helper functions for accessing AI configuration without string parsing
+ * Use these throughout the codebase instead of parsing strings directly
+ */
+
+/**
+ * Get the ordered list of AI providers
+ */
+export async function getProviderPrecedence(): Promise {
+ const config = await configurationManager.getProviderPrecedence();
+ return config.providers;
+}
+
+/**
+ * Get the default/preferred AI provider
+ */
+export async function getPreferredProvider(): Promise {
+ const config = await configurationManager.getProviderPrecedence();
+ if (config.providers.length === 0) {
+ return null; // No providers configured
+ }
+ return config.defaultProvider || config.providers[0];
+}
+
+/**
+ * Get the ordered list of embedding providers
+ */
+export async function getEmbeddingProviderPrecedence(): Promise {
+ const config = await configurationManager.getEmbeddingProviderPrecedence();
+ return config.providers;
+}
+
+/**
+ * Get the default embedding provider
+ */
+export async function getPreferredEmbeddingProvider(): Promise {
+ const config = await configurationManager.getEmbeddingProviderPrecedence();
+ if (config.providers.length === 0) {
+ return null; // No providers configured
+ }
+ return config.defaultProvider || config.providers[0];
+}
+
+/**
+ * Parse a model identifier (handles "provider:model" format)
+ */
+export function parseModelIdentifier(modelString: string): ModelIdentifier {
+ return configurationManager.parseModelIdentifier(modelString);
+}
+
+/**
+ * Create a model configuration from a model string
+ */
+export function createModelConfig(modelString: string, defaultProvider?: ProviderType): ModelConfig {
+ return configurationManager.createModelConfig(modelString, defaultProvider);
+}
+
+/**
+ * Get the default model for a specific provider
+ */
+export async function getDefaultModelForProvider(provider: ProviderType): Promise {
+ const config = await configurationManager.getAIConfig();
+ return config.defaultModels[provider]; // This can now be undefined
+}
+
+/**
+ * Get provider settings for a specific provider
+ */
+export async function getProviderSettings(provider: ProviderType) {
+ const config = await configurationManager.getAIConfig();
+ return config.providerSettings[provider];
+}
+
+/**
+ * Check if AI is enabled
+ */
+export async function isAIEnabled(): Promise {
+ const config = await configurationManager.getAIConfig();
+ return config.enabled;
+}
+
+/**
+ * Check if a provider has required configuration
+ */
+export async function isProviderConfigured(provider: ProviderType): Promise {
+ const settings = await getProviderSettings(provider);
+
+ switch (provider) {
+ case 'openai':
+ return Boolean((settings as any)?.apiKey);
+ case 'anthropic':
+ return Boolean((settings as any)?.apiKey);
+ case 'ollama':
+ return Boolean((settings as any)?.baseUrl);
+ default:
+ return false;
+ }
+}
+
+/**
+ * Get the first available (configured) provider from the precedence list
+ */
+export async function getFirstAvailableProvider(): Promise {
+ const providers = await getProviderPrecedence();
+
+ if (providers.length === 0) {
+ return null; // No providers configured
+ }
+
+ for (const provider of providers) {
+ if (await isProviderConfigured(provider)) {
+ return provider;
+ }
+ }
+
+ return null; // No providers are properly configured
+}
+
+/**
+ * Validate the current AI configuration
+ */
+export async function validateConfiguration() {
+ return configurationManager.validateConfig();
+}
+
+/**
+ * Clear cached configuration (use when settings change)
+ */
+export function clearConfigurationCache(): void {
+ configurationManager.clearCache();
+}
+
+/**
+ * Get a model configuration with validation that no defaults are assumed
+ */
+export async function getValidModelConfig(provider: ProviderType): Promise<{ model: string; provider: ProviderType } | null> {
+ const defaultModel = await getDefaultModelForProvider(provider);
+
+ if (!defaultModel) {
+ // No default model configured for this provider
+ return null;
+ }
+
+ const isConfigured = await isProviderConfigured(provider);
+ if (!isConfigured) {
+ // Provider is not properly configured
+ return null;
+ }
+
+ return {
+ model: defaultModel,
+ provider
+ };
+}
+
+/**
+ * Get the first valid model configuration from the provider precedence list
+ */
+export async function getFirstValidModelConfig(): Promise<{ model: string; provider: ProviderType } | null> {
+ const providers = await getProviderPrecedence();
+
+ for (const provider of providers) {
+ const config = await getValidModelConfig(provider);
+ if (config) {
+ return config;
+ }
+ }
+
+ return null; // No valid model configuration found
+}
diff --git a/apps/server/src/services/llm/config/configuration_manager.ts b/apps/server/src/services/llm/config/configuration_manager.ts
new file mode 100644
index 000000000..5bc9611b8
--- /dev/null
+++ b/apps/server/src/services/llm/config/configuration_manager.ts
@@ -0,0 +1,378 @@
+import options from '../../options.js';
+import log from '../../log.js';
+import type {
+ AIConfig,
+ ProviderPrecedenceConfig,
+ EmbeddingProviderPrecedenceConfig,
+ ModelIdentifier,
+ ModelConfig,
+ ProviderType,
+ EmbeddingProviderType,
+ ConfigValidationResult,
+ ProviderSettings,
+ OpenAISettings,
+ AnthropicSettings,
+ OllamaSettings
+} from '../interfaces/configuration_interfaces.js';
+
+/**
+ * Configuration manager that handles conversion from string-based options
+ * to proper typed configuration objects.
+ *
+ * This is the ONLY place where string parsing should happen for LLM configurations.
+ */
+export class ConfigurationManager {
+ private static instance: ConfigurationManager | null = null;
+ private cachedConfig: AIConfig | null = null;
+ private lastConfigUpdate: number = 0;
+
+ // Cache for 5 minutes to avoid excessive option reads
+ private static readonly CACHE_DURATION = 5 * 60 * 1000;
+
+ private constructor() {}
+
+ public static getInstance(): ConfigurationManager {
+ if (!ConfigurationManager.instance) {
+ ConfigurationManager.instance = new ConfigurationManager();
+ }
+ return ConfigurationManager.instance;
+ }
+
+ /**
+ * Get the complete AI configuration
+ */
+ public async getAIConfig(): Promise {
+ const now = Date.now();
+ if (this.cachedConfig && (now - this.lastConfigUpdate) < ConfigurationManager.CACHE_DURATION) {
+ return this.cachedConfig;
+ }
+
+ try {
+ const config: AIConfig = {
+ enabled: await this.getAIEnabled(),
+ providerPrecedence: await this.getProviderPrecedence(),
+ embeddingProviderPrecedence: await this.getEmbeddingProviderPrecedence(),
+ defaultModels: await this.getDefaultModels(),
+ providerSettings: await this.getProviderSettings()
+ };
+
+ this.cachedConfig = config;
+ this.lastConfigUpdate = now;
+ return config;
+ } catch (error) {
+ log.error(`Error loading AI configuration: ${error}`);
+ return this.getDefaultConfig();
+ }
+ }
+
+ /**
+ * Parse provider precedence from string option
+ */
+ public async getProviderPrecedence(): Promise {
+ try {
+ const precedenceOption = await options.getOption('aiProviderPrecedence');
+ const providers = this.parseProviderList(precedenceOption);
+
+ return {
+ providers: providers as ProviderType[],
+ defaultProvider: providers.length > 0 ? providers[0] as ProviderType : undefined
+ };
+ } catch (error) {
+ log.error(`Error parsing provider precedence: ${error}`);
+ // Only return known providers if they exist, don't assume defaults
+ return {
+ providers: [],
+ defaultProvider: undefined
+ };
+ }
+ }
+
+ /**
+ * Parse embedding provider precedence from string option
+ */
+ public async getEmbeddingProviderPrecedence(): Promise {
+ try {
+ const precedenceOption = await options.getOption('embeddingProviderPrecedence');
+ const providers = this.parseProviderList(precedenceOption);
+
+ return {
+ providers: providers as EmbeddingProviderType[],
+ defaultProvider: providers.length > 0 ? providers[0] as EmbeddingProviderType : undefined
+ };
+ } catch (error) {
+ log.error(`Error parsing embedding provider precedence: ${error}`);
+ // Don't assume defaults, return empty configuration
+ return {
+ providers: [],
+ defaultProvider: undefined
+ };
+ }
+ }
+
+ /**
+ * Parse model identifier with optional provider prefix
+ * Handles formats like "gpt-4", "openai:gpt-4", "ollama:llama2:7b"
+ */
+ public parseModelIdentifier(modelString: string): ModelIdentifier {
+ if (!modelString) {
+ return {
+ modelId: '',
+ fullIdentifier: ''
+ };
+ }
+
+ const parts = modelString.split(':');
+
+ if (parts.length === 1) {
+ // No provider prefix, just model name
+ return {
+ modelId: modelString,
+ fullIdentifier: modelString
+ };
+ }
+
+ // Check if first part is a known provider
+ const potentialProvider = parts[0].toLowerCase();
+ const knownProviders: ProviderType[] = ['openai', 'anthropic', 'ollama'];
+
+ if (knownProviders.includes(potentialProvider as ProviderType)) {
+ // Provider prefix format
+ const provider = potentialProvider as ProviderType;
+ const modelId = parts.slice(1).join(':'); // Rejoin in case model has colons
+
+ return {
+ provider,
+ modelId,
+ fullIdentifier: modelString
+ };
+ }
+
+ // Not a provider prefix, treat whole string as model name
+ return {
+ modelId: modelString,
+ fullIdentifier: modelString
+ };
+ }
+
+ /**
+ * Create model configuration from string
+ */
+ public createModelConfig(modelString: string, defaultProvider?: ProviderType): ModelConfig {
+ const identifier = this.parseModelIdentifier(modelString);
+ const provider = identifier.provider || defaultProvider || 'openai';
+
+ return {
+ provider,
+ modelId: identifier.modelId,
+ displayName: identifier.fullIdentifier
+ };
+ }
+
+ /**
+ * Get default models for each provider - ONLY from user configuration
+ */
+ public async getDefaultModels(): Promise> {
+ try {
+ const [openaiModel, anthropicModel, ollamaModel] = await Promise.all([
+ options.getOption('openaiDefaultModel'),
+ options.getOption('anthropicDefaultModel'),
+ options.getOption('ollamaDefaultModel')
+ ]);
+
+ return {
+ openai: openaiModel || undefined,
+ anthropic: anthropicModel || undefined,
+ ollama: ollamaModel || undefined
+ };
+ } catch (error) {
+ log.error(`Error loading default models: ${error}`);
+ // Return undefined for all providers if we can't load config
+ return {
+ openai: undefined,
+ anthropic: undefined,
+ ollama: undefined
+ };
+ }
+ }
+
+ /**
+ * Get provider-specific settings
+ */
+ public async getProviderSettings(): Promise {
+ try {
+ const [
+ openaiApiKey, openaiBaseUrl, openaiDefaultModel,
+ anthropicApiKey, anthropicBaseUrl, anthropicDefaultModel,
+ ollamaBaseUrl, ollamaDefaultModel
+ ] = await Promise.all([
+ options.getOption('openaiApiKey'),
+ options.getOption('openaiBaseUrl'),
+ options.getOption('openaiDefaultModel'),
+ options.getOption('anthropicApiKey'),
+ options.getOption('anthropicBaseUrl'),
+ options.getOption('anthropicDefaultModel'),
+ options.getOption('ollamaBaseUrl'),
+ options.getOption('ollamaDefaultModel')
+ ]);
+
+ const settings: ProviderSettings = {};
+
+ if (openaiApiKey || openaiBaseUrl || openaiDefaultModel) {
+ settings.openai = {
+ apiKey: openaiApiKey,
+ baseUrl: openaiBaseUrl,
+ defaultModel: openaiDefaultModel
+ };
+ }
+
+ if (anthropicApiKey || anthropicBaseUrl || anthropicDefaultModel) {
+ settings.anthropic = {
+ apiKey: anthropicApiKey,
+ baseUrl: anthropicBaseUrl,
+ defaultModel: anthropicDefaultModel
+ };
+ }
+
+ if (ollamaBaseUrl || ollamaDefaultModel) {
+ settings.ollama = {
+ baseUrl: ollamaBaseUrl,
+ defaultModel: ollamaDefaultModel
+ };
+ }
+
+ return settings;
+ } catch (error) {
+ log.error(`Error loading provider settings: ${error}`);
+ return {};
+ }
+ }
+
+ /**
+ * Validate configuration
+ */
+ public async validateConfig(): Promise {
+ const result: ConfigValidationResult = {
+ isValid: true,
+ errors: [],
+ warnings: []
+ };
+
+ try {
+ const config = await this.getAIConfig();
+
+ if (!config.enabled) {
+ result.warnings.push('AI features are disabled');
+ return result;
+ }
+
+ // Validate provider precedence
+ if (config.providerPrecedence.providers.length === 0) {
+ result.errors.push('No providers configured in precedence list');
+ result.isValid = false;
+ }
+
+ // Validate provider settings
+ for (const provider of config.providerPrecedence.providers) {
+ const providerConfig = config.providerSettings[provider];
+
+ if (provider === 'openai') {
+ const openaiConfig = providerConfig as OpenAISettings | undefined;
+ if (!openaiConfig?.apiKey) {
+ result.warnings.push('OpenAI API key is not configured');
+ }
+ }
+
+ if (provider === 'anthropic') {
+ const anthropicConfig = providerConfig as AnthropicSettings | undefined;
+ if (!anthropicConfig?.apiKey) {
+ result.warnings.push('Anthropic API key is not configured');
+ }
+ }
+
+ if (provider === 'ollama') {
+ const ollamaConfig = providerConfig as OllamaSettings | undefined;
+ if (!ollamaConfig?.baseUrl) {
+ result.warnings.push('Ollama base URL is not configured');
+ }
+ }
+ }
+
+ } catch (error) {
+ result.errors.push(`Configuration validation error: ${error}`);
+ result.isValid = false;
+ }
+
+ return result;
+ }
+
+ /**
+ * Clear cached configuration (force reload on next access)
+ */
+ public clearCache(): void {
+ this.cachedConfig = null;
+ this.lastConfigUpdate = 0;
+ }
+
+ // Private helper methods
+
+ private async getAIEnabled(): Promise {
+ try {
+ return await options.getOptionBool('aiEnabled');
+ } catch {
+ return false;
+ }
+ }
+
+ private parseProviderList(precedenceOption: string | null): string[] {
+ if (!precedenceOption) {
+ // Don't assume any defaults - return empty array
+ return [];
+ }
+
+ try {
+ // Handle JSON array format
+ if (precedenceOption.startsWith('[') && precedenceOption.endsWith(']')) {
+ const parsed = JSON.parse(precedenceOption);
+ if (Array.isArray(parsed)) {
+ return parsed.map(p => String(p).trim());
+ }
+ }
+
+ // Handle comma-separated format
+ if (precedenceOption.includes(',')) {
+ return precedenceOption.split(',').map(p => p.trim());
+ }
+
+ // Handle single provider
+ return [precedenceOption.trim()];
+
+ } catch (error) {
+ log.error(`Error parsing provider list "${precedenceOption}": ${error}`);
+ // Don't assume defaults on parse error
+ return [];
+ }
+ }
+
+ private getDefaultConfig(): AIConfig {
+ return {
+ enabled: false,
+ providerPrecedence: {
+ providers: [],
+ defaultProvider: undefined
+ },
+ embeddingProviderPrecedence: {
+ providers: [],
+ defaultProvider: undefined
+ },
+ defaultModels: {
+ openai: undefined,
+ anthropic: undefined,
+ ollama: undefined
+ },
+ providerSettings: {}
+ };
+ }
+}
+
+// Export singleton instance
+export default ConfigurationManager.getInstance();
diff --git a/apps/server/src/services/llm/context_extractors/index.ts b/apps/server/src/services/llm/context_extractors/index.ts
index f6cd07b28..9b97f38a3 100644
--- a/apps/server/src/services/llm/context_extractors/index.ts
+++ b/apps/server/src/services/llm/context_extractors/index.ts
@@ -42,7 +42,6 @@ export class AgentToolsManager {
}
try {
- log.info("Initializing agent tools");
// Initialize the context service first
try {
diff --git a/apps/server/src/services/llm/embeddings/storage.ts b/apps/server/src/services/llm/embeddings/storage.ts
index 01cc2ac17..ac096071f 100644
--- a/apps/server/src/services/llm/embeddings/storage.ts
+++ b/apps/server/src/services/llm/embeddings/storage.ts
@@ -1,4 +1,4 @@
-import sql from "../../sql.js";
+import sql from '../../sql.js'
import { randomString } from "../../../services/utils.js";
import dateUtils from "../../../services/date_utils.js";
import log from "../../log.js";
@@ -11,6 +11,7 @@ import { SEARCH_CONSTANTS } from '../constants/search_constants.js';
import type { NoteEmbeddingContext } from "./embeddings_interface.js";
import becca from "../../../becca/becca.js";
import { isNoteExcludedFromAIById } from "../utils/ai_exclusion_utils.js";
+import { getEmbeddingProviderPrecedence } from '../config/configuration_helpers.js';
interface Similarity {
noteId: string;
@@ -271,44 +272,28 @@ export async function findSimilarNotes(
}
}
} else {
- // Use dedicated embedding provider precedence from options for other strategies
- let preferredProviders: string[] = [];
- const embeddingPrecedence = await options.getOption('embeddingProviderPrecedence');
+ // Try providers using the new configuration system
+ if (useFallback) {
+ log.info('No embeddings found for specified provider, trying fallback providers...');
- if (embeddingPrecedence) {
- // For "comma,separated,values"
- if (embeddingPrecedence.includes(',')) {
- preferredProviders = embeddingPrecedence.split(',').map(p => p.trim());
- }
- // For JSON array ["value1", "value2"]
- else if (embeddingPrecedence.startsWith('[') && embeddingPrecedence.endsWith(']')) {
- try {
- preferredProviders = JSON.parse(embeddingPrecedence);
- } catch (e) {
- log.error(`Error parsing embedding precedence: ${e}`);
- preferredProviders = [embeddingPrecedence]; // Fallback to using as single value
+ // Use the new configuration system - no string parsing!
+ const preferredProviders = await getEmbeddingProviderPrecedence();
+
+ log.info(`Using provider precedence: ${preferredProviders.join(', ')}`);
+
+ // Try providers in precedence order
+ for (const provider of preferredProviders) {
+ const providerEmbeddings = availableEmbeddings.filter(e => e.providerId === provider);
+
+ if (providerEmbeddings.length > 0) {
+ // Choose the model with the most embeddings
+ const bestModel = providerEmbeddings.sort((a, b) => b.count - a.count)[0];
+ log.info(`Found fallback provider: ${provider}, model: ${bestModel.modelId}, dimension: ${bestModel.dimension}`);
+
+ // The 'regenerate' strategy would go here if needed
+ // We're no longer supporting the 'adapt' strategy
}
}
- // For a single value
- else {
- preferredProviders = [embeddingPrecedence];
- }
- }
-
- log.info(`Using provider precedence: ${preferredProviders.join(', ')}`);
-
- // Try providers in precedence order
- for (const provider of preferredProviders) {
- const providerEmbeddings = availableEmbeddings.filter(e => e.providerId === provider);
-
- if (providerEmbeddings.length > 0) {
- // Choose the model with the most embeddings
- const bestModel = providerEmbeddings.sort((a, b) => b.count - a.count)[0];
- log.info(`Found fallback provider: ${provider}, model: ${bestModel.modelId}, dimension: ${bestModel.dimension}`);
-
- // The 'regenerate' strategy would go here if needed
- // We're no longer supporting the 'adapt' strategy
- }
}
}
}
diff --git a/apps/server/src/services/llm/interfaces/configuration_interfaces.ts b/apps/server/src/services/llm/interfaces/configuration_interfaces.ts
new file mode 100644
index 000000000..5a03dc4f1
--- /dev/null
+++ b/apps/server/src/services/llm/interfaces/configuration_interfaces.ts
@@ -0,0 +1,108 @@
+/**
+ * Configuration interfaces for LLM services
+ * These interfaces replace string parsing with proper typed objects
+ */
+
+/**
+ * Provider precedence configuration
+ */
+export interface ProviderPrecedenceConfig {
+ providers: ProviderType[];
+ defaultProvider?: ProviderType;
+}
+
+/**
+ * Model configuration with provider information
+ */
+export interface ModelConfig {
+ provider: ProviderType;
+ modelId: string;
+ displayName?: string;
+ capabilities?: ModelCapabilities;
+}
+
+/**
+ * Embedding provider precedence configuration
+ */
+export interface EmbeddingProviderPrecedenceConfig {
+ providers: EmbeddingProviderType[];
+ defaultProvider?: EmbeddingProviderType;
+}
+
+/**
+ * Model capabilities
+ */
+export interface ModelCapabilities {
+ contextWindow?: number;
+ supportsTools?: boolean;
+ supportsVision?: boolean;
+ supportsStreaming?: boolean;
+ maxTokens?: number;
+ temperature?: number;
+}
+
+/**
+ * Complete AI configuration
+ */
+export interface AIConfig {
+ enabled: boolean;
+ providerPrecedence: ProviderPrecedenceConfig;
+ embeddingProviderPrecedence: EmbeddingProviderPrecedenceConfig;
+ defaultModels: Record;
+ providerSettings: ProviderSettings;
+}
+
+/**
+ * Provider-specific settings
+ */
+export interface ProviderSettings {
+ openai?: OpenAISettings;
+ anthropic?: AnthropicSettings;
+ ollama?: OllamaSettings;
+}
+
+export interface OpenAISettings {
+ apiKey?: string;
+ baseUrl?: string;
+ defaultModel?: string;
+}
+
+export interface AnthropicSettings {
+ apiKey?: string;
+ baseUrl?: string;
+ defaultModel?: string;
+}
+
+export interface OllamaSettings {
+ baseUrl?: string;
+ defaultModel?: string;
+ timeout?: number;
+}
+
+/**
+ * Valid provider types
+ */
+export type ProviderType = 'openai' | 'anthropic' | 'ollama';
+
+/**
+ * Valid embedding provider types
+ */
+export type EmbeddingProviderType = 'openai' | 'ollama' | 'local';
+
+/**
+ * Model identifier with provider prefix (e.g., "openai:gpt-4" or "ollama:llama2")
+ */
+export interface ModelIdentifier {
+ provider?: ProviderType;
+ modelId: string;
+ fullIdentifier: string; // The complete string representation
+}
+
+/**
+ * Validation result for configuration
+ */
+export interface ConfigValidationResult {
+ isValid: boolean;
+ errors: string[];
+ warnings: string[];
+}
diff --git a/apps/server/src/services/llm/pipeline/stages/message_preparation_stage.ts b/apps/server/src/services/llm/pipeline/stages/message_preparation_stage.ts
index 753bc6a28..7f129b26d 100644
--- a/apps/server/src/services/llm/pipeline/stages/message_preparation_stage.ts
+++ b/apps/server/src/services/llm/pipeline/stages/message_preparation_stage.ts
@@ -20,44 +20,44 @@ export class MessagePreparationStage extends BasePipelineStage {
const { messages, context, systemPrompt, options } = input;
-
+
// Determine provider from model string if available (format: "provider:model")
let provider = 'default';
if (options?.model && options.model.includes(':')) {
const [providerName] = options.model.split(':');
provider = providerName;
}
-
+
// Check if tools are enabled
const toolsEnabled = options?.enableTools === true;
-
+
log.info(`Preparing messages for provider: ${provider}, context: ${!!context}, system prompt: ${!!systemPrompt}, tools: ${toolsEnabled}`);
-
+
// Get appropriate formatter for this provider
const formatter = MessageFormatterFactory.getFormatter(provider);
-
+
// Determine the system prompt to use
let finalSystemPrompt = systemPrompt || SYSTEM_PROMPTS.DEFAULT_SYSTEM_PROMPT;
-
+
// If tools are enabled, enhance system prompt with tools guidance
if (toolsEnabled) {
const toolCount = toolRegistry.getAllTools().length;
const toolsPrompt = `You have access to ${toolCount} tools to help you respond. When you need information that might be in the user's notes, use the search_notes tool to find relevant content or the read_note tool to read a specific note by ID. Use tools when specific information is required rather than making assumptions.`;
-
+
// Add tools guidance to system prompt
finalSystemPrompt = finalSystemPrompt + '\n\n' + toolsPrompt;
log.info(`Enhanced system prompt with tools guidance: ${toolCount} tools available`);
}
-
+
// Format messages using provider-specific approach
const formattedMessages = formatter.formatMessages(
messages,
finalSystemPrompt,
context
);
-
+
log.info(`Formatted ${messages.length} messages into ${formattedMessages.length} messages for provider: ${provider}`);
-
+
return { messages: formattedMessages };
}
}
diff --git a/apps/server/src/services/llm/pipeline/stages/model_selection_stage.ts b/apps/server/src/services/llm/pipeline/stages/model_selection_stage.ts
index e5406997d..fdecc216e 100644
--- a/apps/server/src/services/llm/pipeline/stages/model_selection_stage.ts
+++ b/apps/server/src/services/llm/pipeline/stages/model_selection_stage.ts
@@ -3,9 +3,22 @@ import type { ModelSelectionInput } from '../interfaces.js';
import type { ChatCompletionOptions } from '../../ai_interface.js';
import type { ModelMetadata } from '../../providers/provider_options.js';
import log from '../../../log.js';
-import options from '../../../options.js';
import aiServiceManager from '../../ai_service_manager.js';
import { SEARCH_CONSTANTS, MODEL_CAPABILITIES } from "../../constants/search_constants.js";
+
+// Import types
+import type { ServiceProviders } from '../../interfaces/ai_service_interfaces.js';
+
+// Import new configuration system
+import {
+ getProviderPrecedence,
+ getPreferredProvider,
+ parseModelIdentifier,
+ getDefaultModelForProvider,
+ createModelConfig
+} from '../../config/configuration_helpers.js';
+import type { ProviderType } from '../../interfaces/configuration_interfaces.js';
+
/**
* Pipeline stage for selecting the appropriate LLM model
*/
@@ -36,15 +49,15 @@ export class ModelSelectionStage extends BasePipelineStage p.trim());
- } else if (providerPrecedence.startsWith('[') && providerPrecedence.endsWith(']')) {
- providers = JSON.parse(providerPrecedence);
- } else {
- providers = [providerPrecedence];
- }
+ // Use the new configuration helpers - no string parsing!
+ const preferredProvider = await getPreferredProvider();
- // Check for first available provider
- if (providers.length > 0) {
- const firstProvider = providers[0];
- defaultProvider = firstProvider;
+ if (!preferredProvider) {
+ throw new Error('No AI providers are configured. Please check your AI settings.');
+ }
- // Get provider-specific default model
- if (firstProvider === 'openai') {
- const model = await options.getOption('openaiDefaultModel');
- if (model) defaultModelName = model;
- } else if (firstProvider === 'anthropic') {
- const model = await options.getOption('anthropicDefaultModel');
- if (model) defaultModelName = model;
- } else if (firstProvider === 'ollama') {
- const model = await options.getOption('ollamaDefaultModel');
- if (model) {
- defaultModelName = model;
+ const modelName = await getDefaultModelForProvider(preferredProvider);
- // Enable tools for all Ollama models
- // The Ollama API will handle models that don't support tool calling
- log.info(`Using Ollama model ${model} with tool calling enabled`);
- updatedOptions.enableTools = true;
- }
- }
+ if (!modelName) {
+ throw new Error(`No default model configured for provider ${preferredProvider}. Please set a default model in your AI settings.`);
+ }
+
+ log.info(`Selected provider: ${preferredProvider}, model: ${modelName}`);
+
+ // Determine query complexity
+ let queryComplexity = 'low';
+ if (query) {
+ // Simple heuristic: longer queries or those with complex terms indicate higher complexity
+ const complexityIndicators = [
+ 'explain', 'analyze', 'compare', 'evaluate', 'synthesize',
+ 'summarize', 'elaborate', 'investigate', 'research', 'debate'
+ ];
+
+ const hasComplexTerms = complexityIndicators.some(term => query.toLowerCase().includes(term));
+ const isLongQuery = query.length > 100;
+ const hasMultipleQuestions = (query.match(/\?/g) || []).length > 1;
+
+ if ((hasComplexTerms && isLongQuery) || hasMultipleQuestions) {
+ queryComplexity = 'high';
+ } else if (hasComplexTerms || isLongQuery) {
+ queryComplexity = 'medium';
}
}
+
+ // Check content length if provided
+ if (contentLength && contentLength > SEARCH_CONSTANTS.CONTEXT.CONTENT_LENGTH.MEDIUM_THRESHOLD) {
+ // For large content, favor more powerful models
+ queryComplexity = contentLength > SEARCH_CONSTANTS.CONTEXT.CONTENT_LENGTH.HIGH_THRESHOLD ? 'high' : 'medium';
+ }
+
+ // Set the model and add provider metadata
+ updatedOptions.model = modelName;
+ this.addProviderMetadata(updatedOptions, preferredProvider as ServiceProviders, modelName);
+
+ log.info(`Selected model: ${modelName} from provider: ${preferredProvider} for query complexity: ${queryComplexity}`);
+ log.info(`[ModelSelectionStage] Final options: ${JSON.stringify({
+ model: updatedOptions.model,
+ stream: updatedOptions.stream,
+ provider: preferredProvider,
+ enableTools: updatedOptions.enableTools
+ })}`);
+
+ return { options: updatedOptions };
} catch (error) {
- // If any error occurs, use the fallback default
log.error(`Error determining default model: ${error}`);
- }
-
- // Determine query complexity
- let queryComplexity = 'low';
- if (query) {
- // Simple heuristic: longer queries or those with complex terms indicate higher complexity
- const complexityIndicators = [
- 'explain', 'analyze', 'compare', 'evaluate', 'synthesize',
- 'summarize', 'elaborate', 'investigate', 'research', 'debate'
- ];
-
- const hasComplexTerms = complexityIndicators.some(term => query.toLowerCase().includes(term));
- const isLongQuery = query.length > 100;
- const hasMultipleQuestions = (query.match(/\?/g) || []).length > 1;
-
- if ((hasComplexTerms && isLongQuery) || hasMultipleQuestions) {
- queryComplexity = 'high';
- } else if (hasComplexTerms || isLongQuery) {
- queryComplexity = 'medium';
- }
- }
-
- // Check content length if provided
- if (contentLength && contentLength > SEARCH_CONSTANTS.CONTEXT.CONTENT_LENGTH.MEDIUM_THRESHOLD) {
- // For large content, favor more powerful models
- queryComplexity = contentLength > SEARCH_CONSTANTS.CONTEXT.CONTENT_LENGTH.HIGH_THRESHOLD ? 'high' : 'medium';
- }
-
- // Set the model and add provider metadata
- updatedOptions.model = defaultModelName;
- this.addProviderMetadata(updatedOptions, defaultProvider, defaultModelName);
-
- log.info(`Selected model: ${defaultModelName} from provider: ${defaultProvider} for query complexity: ${queryComplexity}`);
- log.info(`[ModelSelectionStage] Final options: ${JSON.stringify({
- model: updatedOptions.model,
- stream: updatedOptions.stream,
- provider: defaultProvider,
- enableTools: updatedOptions.enableTools
- })}`);
-
- return { options: updatedOptions };
- }
-
- /**
- * Helper to parse model identifier with provider prefix
- * Handles legacy format "provider:model"
- */
- private parseModelIdentifier(modelId: string): { provider?: string, model: string } {
- if (!modelId) return { model: '' };
-
- const parts = modelId.split(':');
- if (parts.length === 1) {
- // No provider prefix
- return { model: modelId };
- } else {
- // Extract provider and model
- const provider = parts[0];
- const model = parts.slice(1).join(':'); // Handle model names that might include :
- return { provider, model };
+ throw new Error(`Failed to determine AI model configuration: ${error}`);
}
}
/**
* Add provider metadata to the options based on model name
*/
- private addProviderMetadata(options: ChatCompletionOptions, provider: string, modelName: string): void {
+ private addProviderMetadata(options: ChatCompletionOptions, provider: ServiceProviders, modelName: string): void {
// Check if we already have providerMetadata
if (options.providerMetadata) {
// If providerMetadata exists but not modelId, add the model name
@@ -216,7 +183,7 @@ export class ModelSelectionStage extends BasePipelineStage {
+ try {
+ // Use the new configuration system
+ const providers = await getProviderPrecedence();
- // Use only providers that are available
- const availableProviders = providerPrecedence.filter(provider =>
- aiServiceManager.isProviderAvailable(provider));
+ // Use only providers that are available
+ const availableProviders = providers.filter(provider =>
+ aiServiceManager.isProviderAvailable(provider));
- if (availableProviders.length === 0) {
- throw new Error('No AI providers are available');
+ if (availableProviders.length === 0) {
+ throw new Error('No AI providers are available');
+ }
+
+ // Get the first available provider and its default model
+ const defaultProvider = availableProviders[0];
+ const defaultModel = await getDefaultModelForProvider(defaultProvider);
+
+ if (!defaultModel) {
+ throw new Error(`No default model configured for provider ${defaultProvider}. Please configure a default model in your AI settings.`);
+ }
+
+ // Set provider metadata
+ if (!input.options.providerMetadata) {
+ input.options.providerMetadata = {
+ provider: defaultProvider as 'openai' | 'anthropic' | 'ollama' | 'local',
+ modelId: defaultModel
+ };
+ }
+
+ log.info(`Selected default model ${defaultModel} from provider ${defaultProvider}`);
+ return defaultModel;
+ } catch (error) {
+ log.error(`Error determining default model: ${error}`);
+ throw error; // Don't provide fallback defaults, let the error propagate
}
-
- // Get the first available provider and its default model
- const defaultProvider = availableProviders[0] as 'openai' | 'anthropic' | 'ollama' | 'local';
- let defaultModel = 'gpt-3.5-turbo'; // Use model from our constants
-
- // Set provider metadata
- if (!input.options.providerMetadata) {
- input.options.providerMetadata = {
- provider: defaultProvider,
- modelId: defaultModel
- };
- }
-
- log.info(`Selected default model ${defaultModel} from provider ${defaultProvider}`);
- return defaultModel;
}
/**
diff --git a/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts b/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts
index 1dd6ff550..f988a6394 100644
--- a/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts
+++ b/apps/server/src/services/llm/pipeline/stages/tool_calling_stage.ts
@@ -559,11 +559,9 @@ export class ToolCallingStage extends BasePipelineStage {
// Get agent tools manager and initialize it
const agentTools = aiServiceManager.getAgentTools();
if (agentTools && typeof agentTools.initialize === 'function') {
- log.info('Initializing agent tools to create vectorSearchTool');
try {
// Force initialization to ensure it runs even if previously marked as initialized
await agentTools.initialize(true);
- log.info('Agent tools initialized successfully');
} catch (initError: any) {
log.error(`Failed to initialize agent tools: ${initError.message}`);
return null;
@@ -143,7 +141,7 @@ export class SearchNotesTool implements ToolHandler {
temperature: 0.3,
maxTokens: 200,
// Type assertion to bypass type checking for special internal parameters
- ...(({
+ ...(({
bypassFormatter: true,
bypassContextProcessing: true
} as Record))
diff --git a/apps/server/src/services/llm/tools/tool_registry.ts b/apps/server/src/services/llm/tools/tool_registry.ts
index 9ad41fdce..6d6dd417f 100644
--- a/apps/server/src/services/llm/tools/tool_registry.ts
+++ b/apps/server/src/services/llm/tools/tool_registry.ts
@@ -13,7 +13,7 @@ import log from '../../log.js';
export class ToolRegistry {
private static instance: ToolRegistry;
private tools: Map = new Map();
- private initializationAttempted: boolean = false;
+ private initializationAttempted = false;
private constructor() {}
@@ -106,7 +106,6 @@ export class ToolRegistry {
}
this.tools.set(name, handler);
- log.info(`Registered tool: ${name}`);
}
/**
diff --git a/apps/server/src/services/special_notes.ts b/apps/server/src/services/special_notes.ts
index df8b87cdc..4083b8fff 100644
--- a/apps/server/src/services/special_notes.ts
+++ b/apps/server/src/services/special_notes.ts
@@ -9,6 +9,7 @@ import searchService from "./search/services/search.js";
import SearchContext from "./search/search_context.js";
import hiddenSubtree from "./hidden_subtree.js";
import { t } from "i18next";
+import { BNote } from "./backend_script_entrypoint.js";
const { LBTPL_NOTE_LAUNCHER, LBTPL_CUSTOM_WIDGET, LBTPL_SPACER, LBTPL_SCRIPT } = hiddenSubtree;
function getInboxNote(date: string) {
@@ -17,7 +18,7 @@ function getInboxNote(date: string) {
throw new Error("Unable to find workspace note");
}
- let inbox;
+ let inbox: BNote;
if (!workspaceNote.isRoot()) {
inbox = workspaceNote.searchNoteInSubtree("#workspaceInbox");
diff --git a/apps/server/src/services/ws.ts b/apps/server/src/services/ws.ts
index 8dde51639..6a211c572 100644
--- a/apps/server/src/services/ws.ts
+++ b/apps/server/src/services/ws.ts
@@ -203,6 +203,13 @@ function fillInAdditionalProperties(entityChange: EntityChange) {
WHERE attachmentId = ?`,
[entityChange.entityId]
);
+ } else if (entityChange.entityName === "note_embeddings") {
+ // Note embeddings are backend-only entities for AI/vector search
+ // Frontend doesn't need the full embedding data (which is large binary data)
+ // Just ensure entity is marked as handled - actual sync happens at database level
+ if (!entityChange.isErased) {
+ entityChange.entity = { embedId: entityChange.entityId };
+ }
}
if (entityChange.entity instanceof AbstractBeccaEntity) {
diff --git a/apps/server/vite.config.mts b/apps/server/vite.config.mts
index eae95a616..ffd7b7427 100644
--- a/apps/server/vite.config.mts
+++ b/apps/server/vite.config.mts
@@ -10,8 +10,7 @@ export default defineConfig(() => ({
globals: true,
setupFiles: ["./spec/setup.ts"],
environment: "node",
- include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
- reporters: ['default'],
+ include: ['{src,spec}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
coverage: {
reportsDirectory: './test-output/vitest/coverage',
provider: 'v8' as const,
diff --git a/apps/web-clipper/.gitignore b/apps/web-clipper/.gitignore
new file mode 100644
index 000000000..77738287f
--- /dev/null
+++ b/apps/web-clipper/.gitignore
@@ -0,0 +1 @@
+dist/
\ No newline at end of file
diff --git a/apps/web-clipper/.idea/.gitignore b/apps/web-clipper/.idea/.gitignore
new file mode 100644
index 000000000..c0f9e196c
--- /dev/null
+++ b/apps/web-clipper/.idea/.gitignore
@@ -0,0 +1,5 @@
+# Default ignored files
+/workspace.xml
+
+# Datasource local storage ignored files
+/dataSources.local.xml
\ No newline at end of file
diff --git a/apps/web-clipper/.idea/inspectionProfiles/Project_Default.xml b/apps/web-clipper/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 000000000..146ab09b7
--- /dev/null
+++ b/apps/web-clipper/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/web-clipper/.idea/misc.xml b/apps/web-clipper/.idea/misc.xml
new file mode 100644
index 000000000..7e5bdf89f
--- /dev/null
+++ b/apps/web-clipper/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/web-clipper/.idea/modules.xml b/apps/web-clipper/.idea/modules.xml
new file mode 100644
index 000000000..ebf785642
--- /dev/null
+++ b/apps/web-clipper/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/web-clipper/.idea/vcs.xml b/apps/web-clipper/.idea/vcs.xml
new file mode 100644
index 000000000..94a25f7f4
--- /dev/null
+++ b/apps/web-clipper/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/web-clipper/LICENSE b/apps/web-clipper/LICENSE
new file mode 100644
index 000000000..f288702d2
--- /dev/null
+++ b/apps/web-clipper/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+ .
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/apps/web-clipper/README.md b/apps/web-clipper/README.md
new file mode 100644
index 000000000..a37d0e181
--- /dev/null
+++ b/apps/web-clipper/README.md
@@ -0,0 +1,24 @@
+# Trilium Web Clipper
+
+## This repo is dead
+
+**Trilium is in maintenance mode and Web Clipper is not likely to get new releases.**
+
+Trilium Web Clipper is a web browser extension which allows user to clip text, screenshots, whole pages and short notes and save them directly to [Trilium Notes](https://github.com/zadam/trilium).
+
+For more details, see the [wiki page](https://github.com/zadam/trilium/wiki/Web-clipper).
+
+## Keyboard shortcuts
+Keyboard shortcuts are available for most functions:
+* Save selected text: `Ctrl+Shift+S` (Mac: `Cmd+Shift+S`)
+* Save whole page: `Alt+Shift+S` (Mac: `Opt+Shift+S`)
+* Save screenshot: `Ctrl+Shift+E` (Mac: `Cmd+Shift+E`)
+
+To set custom shortcuts, follow the directions for your browser.
+
+**Firefox**: `about:addons` > Gear icon ⚙️ > Manage extension shortcuts
+
+**Chrome**: `chrome://extensions/shortcuts`
+
+## Credits
+Some parts of the code are based on the [Joplin Notes browser extension](https://github.com/laurent22/joplin/tree/master/Clipper).
diff --git a/apps/web-clipper/background.js b/apps/web-clipper/background.js
new file mode 100644
index 000000000..4074987ab
--- /dev/null
+++ b/apps/web-clipper/background.js
@@ -0,0 +1,451 @@
+// Keyboard shortcuts
+chrome.commands.onCommand.addListener(async function (command) {
+ if (command == "saveSelection") {
+ await saveSelection();
+ } else if (command == "saveWholePage") {
+ await saveWholePage();
+ } else if (command == "saveTabs") {
+ await saveTabs();
+ } else if (command == "saveCroppedScreenshot") {
+ const activeTab = await getActiveTab();
+
+ await saveCroppedScreenshot(activeTab.url);
+ } else {
+ console.log("Unrecognized command", command);
+ }
+});
+
+function cropImage(newArea, dataUrl) {
+ return new Promise((resolve, reject) => {
+ const img = new Image();
+
+ img.onload = function () {
+ const canvas = document.createElement('canvas');
+ canvas.width = newArea.width;
+ canvas.height = newArea.height;
+
+ const ctx = canvas.getContext('2d');
+
+ ctx.drawImage(img, newArea.x, newArea.y, newArea.width, newArea.height, 0, 0, newArea.width, newArea.height);
+
+ resolve(canvas.toDataURL());
+ };
+
+ img.src = dataUrl;
+ });
+}
+
+async function takeCroppedScreenshot(cropRect) {
+ const activeTab = await getActiveTab();
+ const zoom = await browser.tabs.getZoom(activeTab.id) * window.devicePixelRatio;
+
+ const newArea = Object.assign({}, cropRect);
+ newArea.x *= zoom;
+ newArea.y *= zoom;
+ newArea.width *= zoom;
+ newArea.height *= zoom;
+
+ const dataUrl = await browser.tabs.captureVisibleTab(null, { format: 'png' });
+
+ return await cropImage(newArea, dataUrl);
+}
+
+async function takeWholeScreenshot() {
+ // this saves only visible portion of the page
+ // workaround to save the whole page is to scroll & stitch
+ // example in https://github.com/mrcoles/full-page-screen-capture-chrome-extension
+ // see page.js and popup.js
+ return await browser.tabs.captureVisibleTab(null, { format: 'png' });
+}
+
+browser.runtime.onInstalled.addListener(() => {
+ if (isDevEnv()) {
+ browser.browserAction.setIcon({
+ path: 'icons/32-dev.png',
+ });
+ }
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-selection",
+ title: "Save selection to Trilium",
+ contexts: ["selection"]
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-cropped-screenshot",
+ title: "Clip screenshot to Trilium",
+ contexts: ["page"]
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-cropped-screenshot",
+ title: "Crop screen shot to Trilium",
+ contexts: ["page"]
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-whole-screenshot",
+ title: "Save whole screen shot to Trilium",
+ contexts: ["page"]
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-page",
+ title: "Save whole page to Trilium",
+ contexts: ["page"]
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-link",
+ title: "Save link to Trilium",
+ contexts: ["link"]
+});
+
+browser.contextMenus.create({
+ id: "trilium-save-image",
+ title: "Save image to Trilium",
+ contexts: ["image"]
+});
+
+async function getActiveTab() {
+ const tabs = await browser.tabs.query({
+ active: true,
+ currentWindow: true
+ });
+
+ return tabs[0];
+}
+
+async function getWindowTabs() {
+ const tabs = await browser.tabs.query({
+ currentWindow: true
+ });
+
+ return tabs;
+}
+
+async function sendMessageToActiveTab(message) {
+ const activeTab = await getActiveTab();
+
+ if (!activeTab) {
+ throw new Error("No active tab.");
+ }
+
+ try {
+ return await browser.tabs.sendMessage(activeTab.id, message);
+ }
+ catch (e) {
+ throw e;
+ }
+}
+
+function toast(message, noteId = null, tabIds = null) {
+ sendMessageToActiveTab({
+ name: 'toast',
+ message: message,
+ noteId: noteId,
+ tabIds: tabIds
+ });
+}
+
+function blob2base64(blob) {
+ return new Promise(resolve => {
+ const reader = new FileReader();
+ reader.onloadend = function() {
+ resolve(reader.result);
+ };
+ reader.readAsDataURL(blob);
+ });
+}
+
+async function fetchImage(url) {
+ const resp = await fetch(url);
+ const blob = await resp.blob();
+
+ return await blob2base64(blob);
+}
+
+async function postProcessImage(image) {
+ if (image.src.startsWith("data:image/")) {
+ image.dataUrl = image.src;
+ image.src = "inline." + image.src.substr(11, 3); // this should extract file type - png/jpg
+ }
+ else {
+ try {
+ image.dataUrl = await fetchImage(image.src, image);
+ }
+ catch (e) {
+ console.log(`Cannot fetch image from ${image.src}`);
+ }
+ }
+}
+
+async function postProcessImages(resp) {
+ if (resp.images) {
+ for (const image of resp.images) {
+ await postProcessImage(image);
+ }
+ }
+}
+
+async function saveSelection() {
+ const payload = await sendMessageToActiveTab({name: 'trilium-save-selection'});
+
+ await postProcessImages(payload);
+
+ const resp = await triliumServerFacade.callService('POST', 'clippings', payload);
+
+ if (!resp) {
+ return;
+ }
+
+ toast("Selection has been saved to Trilium.", resp.noteId);
+}
+
+async function getImagePayloadFromSrc(src, pageUrl) {
+ const image = {
+ imageId: randomString(20),
+ src: src
+ };
+
+ await postProcessImage(image);
+
+ const activeTab = await getActiveTab();
+
+ return {
+ title: activeTab.title,
+ content: ` `,
+ images: [image],
+ pageUrl: pageUrl
+ };
+}
+
+async function saveCroppedScreenshot(pageUrl) {
+ const cropRect = await sendMessageToActiveTab({name: 'trilium-get-rectangle-for-screenshot'});
+
+ const src = await takeCroppedScreenshot(cropRect);
+
+ const payload = await getImagePayloadFromSrc(src, pageUrl);
+
+ const resp = await triliumServerFacade.callService("POST", "clippings", payload);
+
+ if (!resp) {
+ return;
+ }
+
+ toast("Screenshot has been saved to Trilium.", resp.noteId);
+}
+
+async function saveWholeScreenshot(pageUrl) {
+ const src = await takeWholeScreenshot();
+
+ const payload = await getImagePayloadFromSrc(src, pageUrl);
+
+ const resp = await triliumServerFacade.callService("POST", "clippings", payload);
+
+ if (!resp) {
+ return;
+ }
+
+ toast("Screenshot has been saved to Trilium.", resp.noteId);
+}
+
+async function saveImage(srcUrl, pageUrl) {
+ const payload = await getImagePayloadFromSrc(srcUrl, pageUrl);
+
+ const resp = await triliumServerFacade.callService("POST", "clippings", payload);
+
+ if (!resp) {
+ return;
+ }
+
+ toast("Image has been saved to Trilium.", resp.noteId);
+}
+
+async function saveWholePage() {
+ const payload = await sendMessageToActiveTab({name: 'trilium-save-page'});
+
+ await postProcessImages(payload);
+
+ const resp = await triliumServerFacade.callService('POST', 'notes', payload);
+
+ if (!resp) {
+ return;
+ }
+
+ toast("Page has been saved to Trilium.", resp.noteId);
+}
+
+async function saveLinkWithNote(title, content) {
+ const activeTab = await getActiveTab();
+
+ if (!title.trim()) {
+ title = activeTab.title;
+ }
+
+ const resp = await triliumServerFacade.callService('POST', 'notes', {
+ title: title,
+ content: content,
+ clipType: 'note',
+ pageUrl: activeTab.url
+ });
+
+ if (!resp) {
+ return false;
+ }
+
+ toast("Link with note has been saved to Trilium.", resp.noteId);
+
+ return true;
+}
+
+async function getTabsPayload(tabs) {
+ let content = '';
+ tabs.forEach(tab => {
+ content += `${tab.title} `
+ });
+ content += ' ';
+
+ const domainsCount = tabs.map(tab => tab.url)
+ .reduce((acc, url) => {
+ const hostname = new URL(url).hostname
+ return acc.set(hostname, (acc.get(hostname) || 0) + 1)
+ }, new Map());
+
+ let topDomains = [...domainsCount]
+ .sort((a, b) => {return b[1]-a[1]})
+ .slice(0,3)
+ .map(domain=>domain[0])
+ .join(', ')
+
+ if (tabs.length > 3) { topDomains += '...' }
+
+ return {
+ title: `${tabs.length} browser tabs: ${topDomains}`,
+ content: content,
+ clipType: 'tabs'
+ };
+}
+
+async function saveTabs() {
+ const tabs = await getWindowTabs();
+
+ const payload = await getTabsPayload(tabs);
+
+ const resp = await triliumServerFacade.callService('POST', 'notes', payload);
+
+ if (!resp) {
+ return;
+ }
+
+ const tabIds = tabs.map(tab=>{return tab.id});
+
+ toast(`${tabs.length} links have been saved to Trilium.`, resp.noteId, tabIds);
+}
+
+browser.contextMenus.onClicked.addListener(async function(info, tab) {
+ if (info.menuItemId === 'trilium-save-selection') {
+ await saveSelection();
+ }
+ else if (info.menuItemId === 'trilium-save-cropped-screenshot') {
+ await saveCroppedScreenshot(info.pageUrl);
+ }
+ else if (info.menuItemId === 'trilium-save-whole-screenshot') {
+ await saveWholeScreenshot(info.pageUrl);
+ }
+ else if (info.menuItemId === 'trilium-save-image') {
+ await saveImage(info.srcUrl, info.pageUrl);
+ }
+ else if (info.menuItemId === 'trilium-save-link') {
+ const link = document.createElement("a");
+ link.href = info.linkUrl;
+ // linkText might be available only in firefox
+ link.appendChild(document.createTextNode(info.linkText || info.linkUrl));
+
+ const activeTab = await getActiveTab();
+
+ const resp = await triliumServerFacade.callService('POST', 'clippings', {
+ title: activeTab.title,
+ content: link.outerHTML,
+ pageUrl: info.pageUrl
+ });
+
+ if (!resp) {
+ return;
+ }
+
+ toast("Link has been saved to Trilium.", resp.noteId);
+ }
+ else if (info.menuItemId === 'trilium-save-page') {
+ await saveWholePage();
+ }
+ else {
+ console.log("Unrecognized menuItemId", info.menuItemId);
+ }
+});
+
+browser.runtime.onMessage.addListener(async request => {
+ console.log("Received", request);
+
+ if (request.name === 'openNoteInTrilium') {
+ const resp = await triliumServerFacade.callService('POST', 'open/' + request.noteId);
+
+ if (!resp) {
+ return;
+ }
+
+ // desktop app is not available so we need to open in browser
+ if (resp.result === 'open-in-browser') {
+ const {triliumServerUrl} = await browser.storage.sync.get("triliumServerUrl");
+
+ if (triliumServerUrl) {
+ const noteUrl = triliumServerUrl + '/#' + request.noteId;
+
+ console.log("Opening new tab in browser", noteUrl);
+
+ browser.tabs.create({
+ url: noteUrl
+ });
+ }
+ else {
+ console.error("triliumServerUrl not found in local storage.");
+ }
+ }
+ }
+ else if (request.name === 'closeTabs') {
+ return await browser.tabs.remove(request.tabIds)
+ }
+ else if (request.name === 'load-script') {
+ return await browser.tabs.executeScript({file: request.file});
+ }
+ else if (request.name === 'save-cropped-screenshot') {
+ const activeTab = await getActiveTab();
+
+ return await saveCroppedScreenshot(activeTab.url);
+ }
+ else if (request.name === 'save-whole-screenshot') {
+ const activeTab = await getActiveTab();
+
+ return await saveWholeScreenshot(activeTab.url);
+ }
+ else if (request.name === 'save-whole-page') {
+ return await saveWholePage();
+ }
+ else if (request.name === 'save-link-with-note') {
+ return await saveLinkWithNote(request.title, request.content);
+ }
+ else if (request.name === 'save-tabs') {
+ return await saveTabs();
+ }
+ else if (request.name === 'trigger-trilium-search') {
+ triliumServerFacade.triggerSearchForTrilium();
+ }
+ else if (request.name === 'send-trilium-search-status') {
+ triliumServerFacade.sendTriliumSearchStatusToPopup();
+ }
+ else if (request.name === 'trigger-trilium-search-note-url') {
+ const activeTab = await getActiveTab();
+ triliumServerFacade.triggerSearchNoteByUrl(activeTab.url);
+ }
+});
diff --git a/apps/web-clipper/bin/release-chrome.sh b/apps/web-clipper/bin/release-chrome.sh
new file mode 100755
index 000000000..2b96c9419
--- /dev/null
+++ b/apps/web-clipper/bin/release-chrome.sh
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+set -e
+
+VERSION=$(jq -r ".version" manifest.json)
+CHROME_EXTENSION_ID=dfhgmnfclbebfobmblelddiejjcijbjm
+
+BUILD_DIR=trilium-web-clipper-chrome
+
+rm -rf "dist/$BUILD_DIR"
+mkdir -p "dist/$BUILD_DIR"
+
+cp -r icons lib options popup *.js manifest.json "dist/$BUILD_DIR"
+
+cd dist/"${BUILD_DIR}" || exit
+
+jq '.name = "Trilium Web Clipper"' manifest.json | sponge manifest.json
+jq 'del(.browser_specific_settings)' manifest.json | sponge manifest.json
+
+EXT_FILE_NAME=trilium_web_clipper-${VERSION}-chrome.zip
+
+zip -r ../${EXT_FILE_NAME} *
+
+cd ..
+rm -r "${BUILD_DIR}"
+
+# https://github.com/fregante/chrome-webstore-upload-cli
+chrome-webstore-upload upload --source ${EXT_FILE_NAME} --auto-publish --extension-id "${CHROME_EXTENSION_ID}" --client-id "${CHROME_CLIENT_ID}" --client-secret "${CHROME_CLIENT_SECRET}" --refresh-token "${CHROME_REFRESH_TOKEN}"
+
diff --git a/apps/web-clipper/bin/release-firefox.sh b/apps/web-clipper/bin/release-firefox.sh
new file mode 100755
index 000000000..38633ac7a
--- /dev/null
+++ b/apps/web-clipper/bin/release-firefox.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+set -e
+
+WEB_EXT_ID="{1410742d-b377-40e7-a9db-63dc9c6ec99c}"
+
+ARTIFACT_NAME=trilium-web-clipper-firefox
+BUILD_DIR=dist/$ARTIFACT_NAME
+
+rm -rf "$BUILD_DIR"
+mkdir -p "$BUILD_DIR"
+
+cp -r icons lib options popup *.js manifest.json "$BUILD_DIR"
+
+cd dist/"${ARTIFACT_NAME}" || exit
+
+jq '.name = "Trilium Web Clipper"' manifest.json | sponge manifest.json
+
+web-ext sign --api-key $FIREFOX_API_KEY --api-secret $FIREFOX_API_SECRET --artifacts-dir ../
+
+cd ..
+rm -r "${ARTIFACT_NAME}"
diff --git a/apps/web-clipper/bin/release.sh b/apps/web-clipper/bin/release.sh
new file mode 100755
index 000000000..69ba675e0
--- /dev/null
+++ b/apps/web-clipper/bin/release.sh
@@ -0,0 +1,72 @@
+#!/usr/bin/env bash
+set -e
+
+export GITHUB_REPO=trilium-web-clipper
+
+if [[ $# -eq 0 ]] ; then
+ echo "Missing argument of new version"
+ exit 1
+fi
+
+VERSION=$1
+
+if ! [[ ${VERSION} =~ ^[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}(-.+)?$ ]] ;
+then
+ echo "Version ${VERSION} isn't in format X.Y.Z"
+ exit 1
+fi
+
+if ! git diff-index --quiet HEAD --; then
+ echo "There are uncommitted changes"
+ exit 1
+fi
+
+echo "Releasing Trilium Web Clipper $VERSION"
+
+jq '.version = "'"$VERSION"'"' manifest.json | sponge manifest.json
+
+git add manifest.json
+
+echo 'module.exports = { buildDate:"'$(date --iso-8601=seconds)'", buildRevision: "'$(git log -1 --format="%H")'" };' > build.js
+
+git add build.js
+
+TAG=v$VERSION
+
+echo "Committing package.json version change"
+
+git commit -m "release $VERSION"
+git push
+
+echo "Tagging commit with $TAG"
+
+git tag "$TAG"
+git push origin "$TAG"
+
+bin/release-firefox.sh
+bin/release-chrome.sh
+
+FIREFOX_BUILD=trilium_web_clipper-$VERSION-an+fx.xpi
+CHROME_BUILD=trilium_web_clipper-${VERSION}-chrome.zip
+
+echo "Creating release in GitHub"
+
+github-release release \
+ --tag "$TAG" \
+ --name "$TAG release"
+
+echo "Uploading firefox build package"
+
+github-release upload \
+ --tag "$TAG" \
+ --name "$FIREFOX_BUILD" \
+ --file "dist/$FIREFOX_BUILD"
+
+echo "Uploading chrome build package"
+
+github-release upload \
+ --tag "$TAG" \
+ --name "$CHROME_BUILD" \
+ --file "dist/$CHROME_BUILD"
+
+echo "Release finished!"
diff --git a/apps/web-clipper/build.js b/apps/web-clipper/build.js
new file mode 100644
index 000000000..3826b2524
--- /dev/null
+++ b/apps/web-clipper/build.js
@@ -0,0 +1 @@
+module.exports = { buildDate:"2022-10-29T15:25:37+02:00", buildRevision: "c9c10a90aa9b94efdf150b0b2fd57f9df5bf2d0a" };
diff --git a/apps/web-clipper/content.js b/apps/web-clipper/content.js
new file mode 100644
index 000000000..faacfa546
--- /dev/null
+++ b/apps/web-clipper/content.js
@@ -0,0 +1,351 @@
+function absoluteUrl(url) {
+ if (!url) {
+ return url;
+ }
+
+ const protocol = url.toLowerCase().split(':')[0];
+ if (['http', 'https', 'file'].indexOf(protocol) >= 0) {
+ return url;
+ }
+
+ if (url.indexOf('//') === 0) {
+ return location.protocol + url;
+ } else if (url[0] === '/') {
+ return location.protocol + '//' + location.host + url;
+ } else {
+ return getBaseUrl() + '/' + url;
+ }
+}
+
+function pageTitle() {
+ const titleElements = document.getElementsByTagName("title");
+
+ return titleElements.length ? titleElements[0].text.trim() : document.title.trim();
+}
+
+function getReadableDocument() {
+ // Readability directly change the passed document, so clone to preserve the original web page.
+ const documentCopy = document.cloneNode(true);
+ const readability = new Readability(documentCopy, {
+ serializer: el => el // so that .content is returned as DOM element instead of HTML
+ });
+
+ const article = readability.parse();
+
+ if (!article) {
+ throw new Error('Could not parse HTML document with Readability');
+ }
+
+ return {
+ title: article.title,
+ body: article.content,
+ }
+}
+
+function getDocumentDates() {
+ var dates = {
+ publishedDate: null,
+ modifiedDate: null,
+ };
+
+ const articlePublishedTime = document.querySelector("meta[property='article:published_time']");
+ if (articlePublishedTime && articlePublishedTime.getAttribute('content')) {
+ dates.publishedDate = new Date(articlePublishedTime.getAttribute('content'));
+ }
+
+ const articleModifiedTime = document.querySelector("meta[property='article:modified_time']");
+ if (articleModifiedTime && articleModifiedTime.getAttribute('content')) {
+ dates.modifiedDate = new Date(articleModifiedTime.getAttribute('content'));
+ }
+
+ // TODO: if we didn't get dates from meta, then try to get them from JSON-LD
+
+ return dates;
+}
+
+function getRectangleArea() {
+ return new Promise((resolve, reject) => {
+ const overlay = document.createElement('div');
+ overlay.style.opacity = '0.6';
+ overlay.style.background = 'black';
+ overlay.style.width = '100%';
+ overlay.style.height = '100%';
+ overlay.style.zIndex = 99999999;
+ overlay.style.top = 0;
+ overlay.style.left = 0;
+ overlay.style.position = 'fixed';
+
+ document.body.appendChild(overlay);
+
+ const messageComp = document.createElement('div');
+
+ const messageCompWidth = 300;
+ messageComp.setAttribute("tabindex", "0"); // so that it can be focused
+ messageComp.style.position = 'fixed';
+ messageComp.style.opacity = '0.95';
+ messageComp.style.fontSize = '14px';
+ messageComp.style.width = messageCompWidth + 'px';
+ messageComp.style.maxWidth = messageCompWidth + 'px';
+ messageComp.style.border = '1px solid black';
+ messageComp.style.background = 'white';
+ messageComp.style.color = 'black';
+ messageComp.style.top = '10px';
+ messageComp.style.textAlign = 'center';
+ messageComp.style.padding = '10px';
+ messageComp.style.left = Math.round(document.body.clientWidth / 2 - messageCompWidth / 2) + 'px';
+ messageComp.style.zIndex = overlay.style.zIndex + 1;
+
+ messageComp.textContent = 'Drag and release to capture a screenshot';
+
+ document.body.appendChild(messageComp);
+
+ const selection = document.createElement('div');
+ selection.style.opacity = '0.5';
+ selection.style.border = '1px solid red';
+ selection.style.background = 'white';
+ selection.style.border = '2px solid black';
+ selection.style.zIndex = overlay.style.zIndex - 1;
+ selection.style.top = 0;
+ selection.style.left = 0;
+ selection.style.position = 'fixed';
+
+ document.body.appendChild(selection);
+
+ messageComp.focus(); // we listen on keypresses on this element to cancel on escape
+
+ let isDragging = false;
+ let draggingStartPos = null;
+ let selectionArea = {};
+
+ function updateSelection() {
+ selection.style.left = selectionArea.x + 'px';
+ selection.style.top = selectionArea.y + 'px';
+ selection.style.width = selectionArea.width + 'px';
+ selection.style.height = selectionArea.height + 'px';
+ }
+
+ function setSelectionSizeFromMouse(event) {
+ if (event.clientX < draggingStartPos.x) {
+ selectionArea.x = event.clientX;
+ }
+
+ if (event.clientY < draggingStartPos.y) {
+ selectionArea.y = event.clientY;
+ }
+
+ selectionArea.width = Math.max(1, Math.abs(event.clientX - draggingStartPos.x));
+ selectionArea.height = Math.max(1, Math.abs(event.clientY - draggingStartPos.y));
+ updateSelection();
+ }
+
+ function selection_mouseDown(event) {
+ selectionArea = {x: event.clientX, y: event.clientY, width: 0, height: 0};
+ draggingStartPos = {x: event.clientX, y: event.clientY};
+ isDragging = true;
+ updateSelection();
+ }
+
+ function selection_mouseMove(event) {
+ if (!isDragging) return;
+ setSelectionSizeFromMouse(event);
+ }
+
+ function removeOverlay() {
+ isDragging = false;
+
+ overlay.removeEventListener('mousedown', selection_mouseDown);
+ overlay.removeEventListener('mousemove', selection_mouseMove);
+ overlay.removeEventListener('mouseup', selection_mouseUp);
+
+ document.body.removeChild(overlay);
+ document.body.removeChild(selection);
+ document.body.removeChild(messageComp);
+ }
+
+ function selection_mouseUp(event) {
+ setSelectionSizeFromMouse(event);
+
+ removeOverlay();
+
+ console.info('selectionArea:', selectionArea);
+
+ if (!selectionArea || !selectionArea.width || !selectionArea.height) {
+ return;
+ }
+
+ // Need to wait a bit before taking the screenshot to make sure
+ // the overlays have been removed and don't appear in the
+ // screenshot. 10ms is not enough.
+ setTimeout(() => resolve(selectionArea), 100);
+ }
+
+ function cancel(event) {
+ if (event.key === "Escape") {
+ removeOverlay();
+ }
+ }
+
+ overlay.addEventListener('mousedown', selection_mouseDown);
+ overlay.addEventListener('mousemove', selection_mouseMove);
+ overlay.addEventListener('mouseup', selection_mouseUp);
+ overlay.addEventListener('mouseup', selection_mouseUp);
+ messageComp.addEventListener('keydown', cancel);
+ });
+}
+
+function makeLinksAbsolute(container) {
+ for (const link of container.getElementsByTagName('a')) {
+ if (link.href) {
+ link.href = absoluteUrl(link.href);
+ }
+ }
+}
+
+function getImages(container) {
+ const images = [];
+
+ for (const img of container.getElementsByTagName('img')) {
+ if (!img.src) {
+ continue;
+ }
+
+ const existingImage = images.find(image => image.src === img.src);
+
+ if (existingImage) {
+ img.src = existingImage.imageId;
+ }
+ else {
+ const imageId = randomString(20);
+
+ images.push({
+ imageId: imageId,
+ src: img.src
+ });
+
+ img.src = imageId;
+ }
+ }
+
+ return images;
+}
+
+function createLink(clickAction, text, color = "lightskyblue") {
+ const link = document.createElement('a');
+ link.href = "javascript:";
+ link.style.color = color;
+ link.appendChild(document.createTextNode(text));
+ link.addEventListener("click", () => {
+ browser.runtime.sendMessage(null, clickAction)
+ });
+
+ return link
+}
+
+async function prepareMessageResponse(message) {
+ console.info('Message: ' + message.name);
+
+ if (message.name === "toast") {
+ let messageText;
+
+ if (message.noteId) {
+ messageText = document.createElement('p');
+ messageText.setAttribute("style", "padding: 0; margin: 0; font-size: larger;")
+ messageText.appendChild(document.createTextNode(message.message + " "));
+ messageText.appendChild(createLink(
+ {name: 'openNoteInTrilium', noteId: message.noteId},
+ "Open in Trilium."
+ ));
+
+ // only after saving tabs
+ if (message.tabIds) {
+ messageText.appendChild(document.createElement("br"));
+ messageText.appendChild(createLink(
+ {name: 'closeTabs', tabIds: message.tabIds},
+ "Close saved tabs.",
+ "tomato"
+ ));
+ }
+ }
+ else {
+ messageText = message.message;
+ }
+
+ await requireLib('/lib/toast.js');
+
+ showToast(messageText, {
+ settings: {
+ duration: 7000
+ }
+ });
+ }
+ else if (message.name === "trilium-save-selection") {
+ const container = document.createElement('div');
+
+ const selection = window.getSelection();
+
+ for (let i = 0; i < selection.rangeCount; i++) {
+ const range = selection.getRangeAt(i);
+
+ container.appendChild(range.cloneContents());
+ }
+
+ makeLinksAbsolute(container);
+
+ const images = getImages(container);
+
+ return {
+ title: pageTitle(),
+ content: container.innerHTML,
+ images: images,
+ pageUrl: getPageLocationOrigin() + location.pathname + location.search + location.hash
+ };
+
+ }
+ else if (message.name === 'trilium-get-rectangle-for-screenshot') {
+ return getRectangleArea();
+ }
+ else if (message.name === "trilium-save-page") {
+ await requireLib("/lib/JSDOMParser.js");
+ await requireLib("/lib/Readability.js");
+ await requireLib("/lib/Readability-readerable.js");
+
+ const {title, body} = getReadableDocument();
+
+ makeLinksAbsolute(body);
+
+ const images = getImages(body);
+
+ var labels = {};
+ const dates = getDocumentDates();
+ if (dates.publishedDate) {
+ labels['publishedDate'] = dates.publishedDate.toISOString().substring(0, 10);
+ }
+ if (dates.modifiedDate) {
+ labels['modifiedDate'] = dates.publishedDate.toISOString().substring(0, 10);
+ }
+
+ return {
+ title: title,
+ content: body.innerHTML,
+ images: images,
+ pageUrl: getPageLocationOrigin() + location.pathname + location.search,
+ clipType: 'page',
+ labels: labels
+ };
+ }
+ else {
+ throw new Error('Unknown command: ' + JSON.stringify(message));
+ }
+}
+
+browser.runtime.onMessage.addListener(prepareMessageResponse);
+
+const loadedLibs = [];
+
+async function requireLib(libPath) {
+ if (!loadedLibs.includes(libPath)) {
+ loadedLibs.push(libPath);
+
+ await browser.runtime.sendMessage({name: 'load-script', file: libPath});
+ }
+}
diff --git a/apps/web-clipper/icons/32-dev.png b/apps/web-clipper/icons/32-dev.png
new file mode 100644
index 000000000..d280a31bb
Binary files /dev/null and b/apps/web-clipper/icons/32-dev.png differ
diff --git a/apps/web-clipper/icons/32.png b/apps/web-clipper/icons/32.png
new file mode 100644
index 000000000..9aeeb66fe
Binary files /dev/null and b/apps/web-clipper/icons/32.png differ
diff --git a/apps/web-clipper/icons/48.png b/apps/web-clipper/icons/48.png
new file mode 100644
index 000000000..da66c56f6
Binary files /dev/null and b/apps/web-clipper/icons/48.png differ
diff --git a/apps/web-clipper/icons/96.png b/apps/web-clipper/icons/96.png
new file mode 100644
index 000000000..f4783da58
Binary files /dev/null and b/apps/web-clipper/icons/96.png differ
diff --git a/apps/web-clipper/lib/JSDOMParser.js b/apps/web-clipper/lib/JSDOMParser.js
new file mode 100644
index 000000000..7bfa2acf5
--- /dev/null
+++ b/apps/web-clipper/lib/JSDOMParser.js
@@ -0,0 +1,1196 @@
+/*eslint-env es6:false*/
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ * You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * This is a relatively lightweight DOMParser that is safe to use in a web
+ * worker. This is far from a complete DOM implementation; however, it should
+ * contain the minimal set of functionality necessary for Readability.js.
+ *
+ * Aside from not implementing the full DOM API, there are other quirks to be
+ * aware of when using the JSDOMParser:
+ *
+ * 1) Properly formed HTML/XML must be used. This means you should be extra
+ * careful when using this parser on anything received directly from an
+ * XMLHttpRequest. Providing a serialized string from an XMLSerializer,
+ * however, should be safe (since the browser's XMLSerializer should
+ * generate valid HTML/XML). Therefore, if parsing a document from an XHR,
+ * the recommended approach is to do the XHR in the main thread, use
+ * XMLSerializer.serializeToString() on the responseXML, and pass the
+ * resulting string to the worker.
+ *
+ * 2) Live NodeLists are not supported. DOM methods and properties such as
+ * getElementsByTagName() and childNodes return standard arrays. If you
+ * want these lists to be updated when nodes are removed or added to the
+ * document, you must take care to manually update them yourself.
+ */
+(function (global) {
+
+ // XML only defines these and the numeric ones:
+
+ var entityTable = {
+ "lt": "<",
+ "gt": ">",
+ "amp": "&",
+ "quot": '"',
+ "apos": "'",
+ };
+
+ var reverseEntityTable = {
+ "<": "<",
+ ">": ">",
+ "&": "&",
+ '"': """,
+ "'": "'",
+ };
+
+ function encodeTextContentHTML(s) {
+ return s.replace(/[&<>]/g, function(x) {
+ return reverseEntityTable[x];
+ });
+ }
+
+ function encodeHTML(s) {
+ return s.replace(/[&<>'"]/g, function(x) {
+ return reverseEntityTable[x];
+ });
+ }
+
+ function decodeHTML(str) {
+ return str.replace(/&(quot|amp|apos|lt|gt);/g, function(match, tag) {
+ return entityTable[tag];
+ }).replace(/(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi, function(match, hex, numStr) {
+ var num = parseInt(hex || numStr, hex ? 16 : 10); // read num
+ return String.fromCharCode(num);
+ });
+ }
+
+ // When a style is set in JS, map it to the corresponding CSS attribute
+ var styleMap = {
+ "alignmentBaseline": "alignment-baseline",
+ "background": "background",
+ "backgroundAttachment": "background-attachment",
+ "backgroundClip": "background-clip",
+ "backgroundColor": "background-color",
+ "backgroundImage": "background-image",
+ "backgroundOrigin": "background-origin",
+ "backgroundPosition": "background-position",
+ "backgroundPositionX": "background-position-x",
+ "backgroundPositionY": "background-position-y",
+ "backgroundRepeat": "background-repeat",
+ "backgroundRepeatX": "background-repeat-x",
+ "backgroundRepeatY": "background-repeat-y",
+ "backgroundSize": "background-size",
+ "baselineShift": "baseline-shift",
+ "border": "border",
+ "borderBottom": "border-bottom",
+ "borderBottomColor": "border-bottom-color",
+ "borderBottomLeftRadius": "border-bottom-left-radius",
+ "borderBottomRightRadius": "border-bottom-right-radius",
+ "borderBottomStyle": "border-bottom-style",
+ "borderBottomWidth": "border-bottom-width",
+ "borderCollapse": "border-collapse",
+ "borderColor": "border-color",
+ "borderImage": "border-image",
+ "borderImageOutset": "border-image-outset",
+ "borderImageRepeat": "border-image-repeat",
+ "borderImageSlice": "border-image-slice",
+ "borderImageSource": "border-image-source",
+ "borderImageWidth": "border-image-width",
+ "borderLeft": "border-left",
+ "borderLeftColor": "border-left-color",
+ "borderLeftStyle": "border-left-style",
+ "borderLeftWidth": "border-left-width",
+ "borderRadius": "border-radius",
+ "borderRight": "border-right",
+ "borderRightColor": "border-right-color",
+ "borderRightStyle": "border-right-style",
+ "borderRightWidth": "border-right-width",
+ "borderSpacing": "border-spacing",
+ "borderStyle": "border-style",
+ "borderTop": "border-top",
+ "borderTopColor": "border-top-color",
+ "borderTopLeftRadius": "border-top-left-radius",
+ "borderTopRightRadius": "border-top-right-radius",
+ "borderTopStyle": "border-top-style",
+ "borderTopWidth": "border-top-width",
+ "borderWidth": "border-width",
+ "bottom": "bottom",
+ "boxShadow": "box-shadow",
+ "boxSizing": "box-sizing",
+ "captionSide": "caption-side",
+ "clear": "clear",
+ "clip": "clip",
+ "clipPath": "clip-path",
+ "clipRule": "clip-rule",
+ "color": "color",
+ "colorInterpolation": "color-interpolation",
+ "colorInterpolationFilters": "color-interpolation-filters",
+ "colorProfile": "color-profile",
+ "colorRendering": "color-rendering",
+ "content": "content",
+ "counterIncrement": "counter-increment",
+ "counterReset": "counter-reset",
+ "cursor": "cursor",
+ "direction": "direction",
+ "display": "display",
+ "dominantBaseline": "dominant-baseline",
+ "emptyCells": "empty-cells",
+ "enableBackground": "enable-background",
+ "fill": "fill",
+ "fillOpacity": "fill-opacity",
+ "fillRule": "fill-rule",
+ "filter": "filter",
+ "cssFloat": "float",
+ "floodColor": "flood-color",
+ "floodOpacity": "flood-opacity",
+ "font": "font",
+ "fontFamily": "font-family",
+ "fontSize": "font-size",
+ "fontStretch": "font-stretch",
+ "fontStyle": "font-style",
+ "fontVariant": "font-variant",
+ "fontWeight": "font-weight",
+ "glyphOrientationHorizontal": "glyph-orientation-horizontal",
+ "glyphOrientationVertical": "glyph-orientation-vertical",
+ "height": "height",
+ "imageRendering": "image-rendering",
+ "kerning": "kerning",
+ "left": "left",
+ "letterSpacing": "letter-spacing",
+ "lightingColor": "lighting-color",
+ "lineHeight": "line-height",
+ "listStyle": "list-style",
+ "listStyleImage": "list-style-image",
+ "listStylePosition": "list-style-position",
+ "listStyleType": "list-style-type",
+ "margin": "margin",
+ "marginBottom": "margin-bottom",
+ "marginLeft": "margin-left",
+ "marginRight": "margin-right",
+ "marginTop": "margin-top",
+ "marker": "marker",
+ "markerEnd": "marker-end",
+ "markerMid": "marker-mid",
+ "markerStart": "marker-start",
+ "mask": "mask",
+ "maxHeight": "max-height",
+ "maxWidth": "max-width",
+ "minHeight": "min-height",
+ "minWidth": "min-width",
+ "opacity": "opacity",
+ "orphans": "orphans",
+ "outline": "outline",
+ "outlineColor": "outline-color",
+ "outlineOffset": "outline-offset",
+ "outlineStyle": "outline-style",
+ "outlineWidth": "outline-width",
+ "overflow": "overflow",
+ "overflowX": "overflow-x",
+ "overflowY": "overflow-y",
+ "padding": "padding",
+ "paddingBottom": "padding-bottom",
+ "paddingLeft": "padding-left",
+ "paddingRight": "padding-right",
+ "paddingTop": "padding-top",
+ "page": "page",
+ "pageBreakAfter": "page-break-after",
+ "pageBreakBefore": "page-break-before",
+ "pageBreakInside": "page-break-inside",
+ "pointerEvents": "pointer-events",
+ "position": "position",
+ "quotes": "quotes",
+ "resize": "resize",
+ "right": "right",
+ "shapeRendering": "shape-rendering",
+ "size": "size",
+ "speak": "speak",
+ "src": "src",
+ "stopColor": "stop-color",
+ "stopOpacity": "stop-opacity",
+ "stroke": "stroke",
+ "strokeDasharray": "stroke-dasharray",
+ "strokeDashoffset": "stroke-dashoffset",
+ "strokeLinecap": "stroke-linecap",
+ "strokeLinejoin": "stroke-linejoin",
+ "strokeMiterlimit": "stroke-miterlimit",
+ "strokeOpacity": "stroke-opacity",
+ "strokeWidth": "stroke-width",
+ "tableLayout": "table-layout",
+ "textAlign": "text-align",
+ "textAnchor": "text-anchor",
+ "textDecoration": "text-decoration",
+ "textIndent": "text-indent",
+ "textLineThrough": "text-line-through",
+ "textLineThroughColor": "text-line-through-color",
+ "textLineThroughMode": "text-line-through-mode",
+ "textLineThroughStyle": "text-line-through-style",
+ "textLineThroughWidth": "text-line-through-width",
+ "textOverflow": "text-overflow",
+ "textOverline": "text-overline",
+ "textOverlineColor": "text-overline-color",
+ "textOverlineMode": "text-overline-mode",
+ "textOverlineStyle": "text-overline-style",
+ "textOverlineWidth": "text-overline-width",
+ "textRendering": "text-rendering",
+ "textShadow": "text-shadow",
+ "textTransform": "text-transform",
+ "textUnderline": "text-underline",
+ "textUnderlineColor": "text-underline-color",
+ "textUnderlineMode": "text-underline-mode",
+ "textUnderlineStyle": "text-underline-style",
+ "textUnderlineWidth": "text-underline-width",
+ "top": "top",
+ "unicodeBidi": "unicode-bidi",
+ "unicodeRange": "unicode-range",
+ "vectorEffect": "vector-effect",
+ "verticalAlign": "vertical-align",
+ "visibility": "visibility",
+ "whiteSpace": "white-space",
+ "widows": "widows",
+ "width": "width",
+ "wordBreak": "word-break",
+ "wordSpacing": "word-spacing",
+ "wordWrap": "word-wrap",
+ "writingMode": "writing-mode",
+ "zIndex": "z-index",
+ "zoom": "zoom",
+ };
+
+ // Elements that can be self-closing
+ var voidElems = {
+ "area": true,
+ "base": true,
+ "br": true,
+ "col": true,
+ "command": true,
+ "embed": true,
+ "hr": true,
+ "img": true,
+ "input": true,
+ "link": true,
+ "meta": true,
+ "param": true,
+ "source": true,
+ "wbr": true
+ };
+
+ var whitespace = [" ", "\t", "\n", "\r"];
+
+ // See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
+ var nodeTypes = {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ };
+
+ function getElementsByTagName(tag) {
+ tag = tag.toUpperCase();
+ var elems = [];
+ var allTags = (tag === "*");
+ function getElems(node) {
+ var length = node.children.length;
+ for (var i = 0; i < length; i++) {
+ var child = node.children[i];
+ if (allTags || (child.tagName === tag))
+ elems.push(child);
+ getElems(child);
+ }
+ }
+ getElems(this);
+ elems._isLiveNodeList = true;
+ return elems;
+ }
+
+ var Node = function () {};
+
+ Node.prototype = {
+ attributes: null,
+ childNodes: null,
+ localName: null,
+ nodeName: null,
+ parentNode: null,
+ textContent: null,
+ nextSibling: null,
+ previousSibling: null,
+
+ get firstChild() {
+ return this.childNodes[0] || null;
+ },
+
+ get firstElementChild() {
+ return this.children[0] || null;
+ },
+
+ get lastChild() {
+ return this.childNodes[this.childNodes.length - 1] || null;
+ },
+
+ get lastElementChild() {
+ return this.children[this.children.length - 1] || null;
+ },
+
+ appendChild: function (child) {
+ if (child.parentNode) {
+ child.parentNode.removeChild(child);
+ }
+
+ var last = this.lastChild;
+ if (last)
+ last.nextSibling = child;
+ child.previousSibling = last;
+
+ if (child.nodeType === Node.ELEMENT_NODE) {
+ child.previousElementSibling = this.children[this.children.length - 1] || null;
+ this.children.push(child);
+ child.previousElementSibling && (child.previousElementSibling.nextElementSibling = child);
+ }
+ this.childNodes.push(child);
+ child.parentNode = this;
+ },
+
+ removeChild: function (child) {
+ var childNodes = this.childNodes;
+ var childIndex = childNodes.indexOf(child);
+ if (childIndex === -1) {
+ throw "removeChild: node not found";
+ } else {
+ child.parentNode = null;
+ var prev = child.previousSibling;
+ var next = child.nextSibling;
+ if (prev)
+ prev.nextSibling = next;
+ if (next)
+ next.previousSibling = prev;
+
+ if (child.nodeType === Node.ELEMENT_NODE) {
+ prev = child.previousElementSibling;
+ next = child.nextElementSibling;
+ if (prev)
+ prev.nextElementSibling = next;
+ if (next)
+ next.previousElementSibling = prev;
+ this.children.splice(this.children.indexOf(child), 1);
+ }
+
+ child.previousSibling = child.nextSibling = null;
+ child.previousElementSibling = child.nextElementSibling = null;
+
+ return childNodes.splice(childIndex, 1)[0];
+ }
+ },
+
+ replaceChild: function (newNode, oldNode) {
+ var childNodes = this.childNodes;
+ var childIndex = childNodes.indexOf(oldNode);
+ if (childIndex === -1) {
+ throw "replaceChild: node not found";
+ } else {
+ // This will take care of updating the new node if it was somewhere else before:
+ if (newNode.parentNode)
+ newNode.parentNode.removeChild(newNode);
+
+ childNodes[childIndex] = newNode;
+
+ // update the new node's sibling properties, and its new siblings' sibling properties
+ newNode.nextSibling = oldNode.nextSibling;
+ newNode.previousSibling = oldNode.previousSibling;
+ if (newNode.nextSibling)
+ newNode.nextSibling.previousSibling = newNode;
+ if (newNode.previousSibling)
+ newNode.previousSibling.nextSibling = newNode;
+
+ newNode.parentNode = this;
+
+ // Now deal with elements before we clear out those values for the old node,
+ // because it can help us take shortcuts here:
+ if (newNode.nodeType === Node.ELEMENT_NODE) {
+ if (oldNode.nodeType === Node.ELEMENT_NODE) {
+ // Both were elements, which makes this easier, we just swap things out:
+ newNode.previousElementSibling = oldNode.previousElementSibling;
+ newNode.nextElementSibling = oldNode.nextElementSibling;
+ if (newNode.previousElementSibling)
+ newNode.previousElementSibling.nextElementSibling = newNode;
+ if (newNode.nextElementSibling)
+ newNode.nextElementSibling.previousElementSibling = newNode;
+ this.children[this.children.indexOf(oldNode)] = newNode;
+ } else {
+ // Hard way:
+ newNode.previousElementSibling = (function() {
+ for (var i = childIndex - 1; i >= 0; i--) {
+ if (childNodes[i].nodeType === Node.ELEMENT_NODE)
+ return childNodes[i];
+ }
+ return null;
+ })();
+ if (newNode.previousElementSibling) {
+ newNode.nextElementSibling = newNode.previousElementSibling.nextElementSibling;
+ } else {
+ newNode.nextElementSibling = (function() {
+ for (var i = childIndex + 1; i < childNodes.length; i++) {
+ if (childNodes[i].nodeType === Node.ELEMENT_NODE)
+ return childNodes[i];
+ }
+ return null;
+ })();
+ }
+ if (newNode.previousElementSibling)
+ newNode.previousElementSibling.nextElementSibling = newNode;
+ if (newNode.nextElementSibling)
+ newNode.nextElementSibling.previousElementSibling = newNode;
+
+ if (newNode.nextElementSibling)
+ this.children.splice(this.children.indexOf(newNode.nextElementSibling), 0, newNode);
+ else
+ this.children.push(newNode);
+ }
+ } else if (oldNode.nodeType === Node.ELEMENT_NODE) {
+ // new node is not an element node.
+ // if the old one was, update its element siblings:
+ if (oldNode.previousElementSibling)
+ oldNode.previousElementSibling.nextElementSibling = oldNode.nextElementSibling;
+ if (oldNode.nextElementSibling)
+ oldNode.nextElementSibling.previousElementSibling = oldNode.previousElementSibling;
+ this.children.splice(this.children.indexOf(oldNode), 1);
+
+ // If the old node wasn't an element, neither the new nor the old node was an element,
+ // and the children array and its members shouldn't need any updating.
+ }
+
+
+ oldNode.parentNode = null;
+ oldNode.previousSibling = null;
+ oldNode.nextSibling = null;
+ if (oldNode.nodeType === Node.ELEMENT_NODE) {
+ oldNode.previousElementSibling = null;
+ oldNode.nextElementSibling = null;
+ }
+ return oldNode;
+ }
+ },
+
+ __JSDOMParser__: true,
+ };
+
+ for (var nodeType in nodeTypes) {
+ Node[nodeType] = Node.prototype[nodeType] = nodeTypes[nodeType];
+ }
+
+ var Attribute = function (name, value) {
+ this.name = name;
+ this._value = value;
+ };
+
+ Attribute.prototype = {
+ get value() {
+ return this._value;
+ },
+ setValue: function(newValue) {
+ this._value = newValue;
+ },
+ getEncodedValue: function() {
+ return encodeHTML(this._value);
+ },
+ };
+
+ var Comment = function () {
+ this.childNodes = [];
+ };
+
+ Comment.prototype = {
+ __proto__: Node.prototype,
+
+ nodeName: "#comment",
+ nodeType: Node.COMMENT_NODE
+ };
+
+ var Text = function () {
+ this.childNodes = [];
+ };
+
+ Text.prototype = {
+ __proto__: Node.prototype,
+
+ nodeName: "#text",
+ nodeType: Node.TEXT_NODE,
+ get textContent() {
+ if (typeof this._textContent === "undefined") {
+ this._textContent = decodeHTML(this._innerHTML || "");
+ }
+ return this._textContent;
+ },
+ get innerHTML() {
+ if (typeof this._innerHTML === "undefined") {
+ this._innerHTML = encodeTextContentHTML(this._textContent || "");
+ }
+ return this._innerHTML;
+ },
+
+ set innerHTML(newHTML) {
+ this._innerHTML = newHTML;
+ delete this._textContent;
+ },
+ set textContent(newText) {
+ this._textContent = newText;
+ delete this._innerHTML;
+ },
+ };
+
+ var Document = function (url) {
+ this.documentURI = url;
+ this.styleSheets = [];
+ this.childNodes = [];
+ this.children = [];
+ };
+
+ Document.prototype = {
+ __proto__: Node.prototype,
+
+ nodeName: "#document",
+ nodeType: Node.DOCUMENT_NODE,
+ title: "",
+
+ getElementsByTagName: getElementsByTagName,
+
+ getElementById: function (id) {
+ function getElem(node) {
+ var length = node.children.length;
+ if (node.id === id)
+ return node;
+ for (var i = 0; i < length; i++) {
+ var el = getElem(node.children[i]);
+ if (el)
+ return el;
+ }
+ return null;
+ }
+ return getElem(this);
+ },
+
+ createElement: function (tag) {
+ var node = new Element(tag);
+ return node;
+ },
+
+ createTextNode: function (text) {
+ var node = new Text();
+ node.textContent = text;
+ return node;
+ },
+
+ get baseURI() {
+ if (!this.hasOwnProperty("_baseURI")) {
+ this._baseURI = this.documentURI;
+ var baseElements = this.getElementsByTagName("base");
+ var href = baseElements[0] && baseElements[0].getAttribute("href");
+ if (href) {
+ try {
+ this._baseURI = (new URL(href, this._baseURI)).href;
+ } catch (ex) {/* Just fall back to documentURI */}
+ }
+ }
+ return this._baseURI;
+ },
+ };
+
+ var Element = function (tag) {
+ // We use this to find the closing tag.
+ this._matchingTag = tag;
+ // We're explicitly a non-namespace aware parser, we just pretend it's all HTML.
+ var lastColonIndex = tag.lastIndexOf(":");
+ if (lastColonIndex != -1) {
+ tag = tag.substring(lastColonIndex + 1);
+ }
+ this.attributes = [];
+ this.childNodes = [];
+ this.children = [];
+ this.nextElementSibling = this.previousElementSibling = null;
+ this.localName = tag.toLowerCase();
+ this.tagName = tag.toUpperCase();
+ this.style = new Style(this);
+ };
+
+ Element.prototype = {
+ __proto__: Node.prototype,
+
+ nodeType: Node.ELEMENT_NODE,
+
+ getElementsByTagName: getElementsByTagName,
+
+ get className() {
+ return this.getAttribute("class") || "";
+ },
+
+ set className(str) {
+ this.setAttribute("class", str);
+ },
+
+ get id() {
+ return this.getAttribute("id") || "";
+ },
+
+ set id(str) {
+ this.setAttribute("id", str);
+ },
+
+ get href() {
+ return this.getAttribute("href") || "";
+ },
+
+ set href(str) {
+ this.setAttribute("href", str);
+ },
+
+ get src() {
+ return this.getAttribute("src") || "";
+ },
+
+ set src(str) {
+ this.setAttribute("src", str);
+ },
+
+ get srcset() {
+ return this.getAttribute("srcset") || "";
+ },
+
+ set srcset(str) {
+ this.setAttribute("srcset", str);
+ },
+
+ get nodeName() {
+ return this.tagName;
+ },
+
+ get innerHTML() {
+ function getHTML(node) {
+ var i = 0;
+ for (i = 0; i < node.childNodes.length; i++) {
+ var child = node.childNodes[i];
+ if (child.localName) {
+ arr.push("<" + child.localName);
+
+ // serialize attribute list
+ for (var j = 0; j < child.attributes.length; j++) {
+ var attr = child.attributes[j];
+ // the attribute value will be HTML escaped.
+ var val = attr.getEncodedValue();
+ var quote = (val.indexOf('"') === -1 ? '"' : "'");
+ arr.push(" " + attr.name + "=" + quote + val + quote);
+ }
+
+ if (child.localName in voidElems && !child.childNodes.length) {
+ // if this is a self-closing element, end it here
+ arr.push("/>");
+ } else {
+ // otherwise, add its children
+ arr.push(">");
+ getHTML(child);
+ arr.push("" + child.localName + ">");
+ }
+ } else {
+ // This is a text node, so asking for innerHTML won't recurse.
+ arr.push(child.innerHTML);
+ }
+ }
+ }
+
+ // Using Array.join() avoids the overhead from lazy string concatenation.
+ var arr = [];
+ getHTML(this);
+ return arr.join("");
+ },
+
+ set innerHTML(html) {
+ var parser = new JSDOMParser();
+ var node = parser.parse(html);
+ var i;
+ for (i = this.childNodes.length; --i >= 0;) {
+ this.childNodes[i].parentNode = null;
+ }
+ this.childNodes = node.childNodes;
+ this.children = node.children;
+ for (i = this.childNodes.length; --i >= 0;) {
+ this.childNodes[i].parentNode = this;
+ }
+ },
+
+ set textContent(text) {
+ // clear parentNodes for existing children
+ for (var i = this.childNodes.length; --i >= 0;) {
+ this.childNodes[i].parentNode = null;
+ }
+
+ var node = new Text();
+ this.childNodes = [ node ];
+ this.children = [];
+ node.textContent = text;
+ node.parentNode = this;
+ },
+
+ get textContent() {
+ function getText(node) {
+ var nodes = node.childNodes;
+ for (var i = 0; i < nodes.length; i++) {
+ var child = nodes[i];
+ if (child.nodeType === 3) {
+ text.push(child.textContent);
+ } else {
+ getText(child);
+ }
+ }
+ }
+
+ // Using Array.join() avoids the overhead from lazy string concatenation.
+ // See http://blog.cdleary.com/2012/01/string-representation-in-spidermonkey/#ropes
+ var text = [];
+ getText(this);
+ return text.join("");
+ },
+
+ getAttribute: function (name) {
+ for (var i = this.attributes.length; --i >= 0;) {
+ var attr = this.attributes[i];
+ if (attr.name === name) {
+ return attr.value;
+ }
+ }
+ return undefined;
+ },
+
+ setAttribute: function (name, value) {
+ for (var i = this.attributes.length; --i >= 0;) {
+ var attr = this.attributes[i];
+ if (attr.name === name) {
+ attr.setValue(value);
+ return;
+ }
+ }
+ this.attributes.push(new Attribute(name, value));
+ },
+
+ removeAttribute: function (name) {
+ for (var i = this.attributes.length; --i >= 0;) {
+ var attr = this.attributes[i];
+ if (attr.name === name) {
+ this.attributes.splice(i, 1);
+ break;
+ }
+ }
+ },
+
+ hasAttribute: function (name) {
+ return this.attributes.some(function (attr) {
+ return attr.name == name;
+ });
+ },
+ };
+
+ var Style = function (node) {
+ this.node = node;
+ };
+
+ // getStyle() and setStyle() use the style attribute string directly. This
+ // won't be very efficient if there are a lot of style manipulations, but
+ // it's the easiest way to make sure the style attribute string and the JS
+ // style property stay in sync. Readability.js doesn't do many style
+ // manipulations, so this should be okay.
+ Style.prototype = {
+ getStyle: function (styleName) {
+ var attr = this.node.getAttribute("style");
+ if (!attr)
+ return undefined;
+
+ var styles = attr.split(";");
+ for (var i = 0; i < styles.length; i++) {
+ var style = styles[i].split(":");
+ var name = style[0].trim();
+ if (name === styleName)
+ return style[1].trim();
+ }
+
+ return undefined;
+ },
+
+ setStyle: function (styleName, styleValue) {
+ var value = this.node.getAttribute("style") || "";
+ var index = 0;
+ do {
+ var next = value.indexOf(";", index) + 1;
+ var length = next - index - 1;
+ var style = (length > 0 ? value.substr(index, length) : value.substr(index));
+ if (style.substr(0, style.indexOf(":")).trim() === styleName) {
+ value = value.substr(0, index).trim() + (next ? " " + value.substr(next).trim() : "");
+ break;
+ }
+ index = next;
+ } while (index);
+
+ value += " " + styleName + ": " + styleValue + ";";
+ this.node.setAttribute("style", value.trim());
+ }
+ };
+
+ // For each item in styleMap, define a getter and setter on the style
+ // property.
+ for (var jsName in styleMap) {
+ (function (cssName) {
+ Style.prototype.__defineGetter__(jsName, function () {
+ return this.getStyle(cssName);
+ });
+ Style.prototype.__defineSetter__(jsName, function (value) {
+ this.setStyle(cssName, value);
+ });
+ })(styleMap[jsName]);
+ }
+
+ var JSDOMParser = function () {
+ this.currentChar = 0;
+
+ // In makeElementNode() we build up many strings one char at a time. Using
+ // += for this results in lots of short-lived intermediate strings. It's
+ // better to build an array of single-char strings and then join() them
+ // together at the end. And reusing a single array (i.e. |this.strBuf|)
+ // over and over for this purpose uses less memory than using a new array
+ // for each string.
+ this.strBuf = [];
+
+ // Similarly, we reuse this array to return the two arguments from
+ // makeElementNode(), which saves us from having to allocate a new array
+ // every time.
+ this.retPair = [];
+
+ this.errorState = "";
+ };
+
+ JSDOMParser.prototype = {
+ error: function(m) {
+ if (typeof dump !== "undefined") {
+ dump("JSDOMParser error: " + m + "\n");
+ } else if (typeof console !== "undefined") {
+ console.log("JSDOMParser error: " + m + "\n");
+ }
+ this.errorState += m + "\n";
+ },
+
+ /**
+ * Look at the next character without advancing the index.
+ */
+ peekNext: function () {
+ return this.html[this.currentChar];
+ },
+
+ /**
+ * Get the next character and advance the index.
+ */
+ nextChar: function () {
+ return this.html[this.currentChar++];
+ },
+
+ /**
+ * Called after a quote character is read. This finds the next quote
+ * character and returns the text string in between.
+ */
+ readString: function (quote) {
+ var str;
+ var n = this.html.indexOf(quote, this.currentChar);
+ if (n === -1) {
+ this.currentChar = this.html.length;
+ str = null;
+ } else {
+ str = this.html.substring(this.currentChar, n);
+ this.currentChar = n + 1;
+ }
+
+ return str;
+ },
+
+ /**
+ * Called when parsing a node. This finds the next name/value attribute
+ * pair and adds the result to the attributes list.
+ */
+ readAttribute: function (node) {
+ var name = "";
+
+ var n = this.html.indexOf("=", this.currentChar);
+ if (n === -1) {
+ this.currentChar = this.html.length;
+ } else {
+ // Read until a '=' character is hit; this will be the attribute key
+ name = this.html.substring(this.currentChar, n);
+ this.currentChar = n + 1;
+ }
+
+ if (!name)
+ return;
+
+ // After a '=', we should see a '"' for the attribute value
+ var c = this.nextChar();
+ if (c !== '"' && c !== "'") {
+ this.error("Error reading attribute " + name + ", expecting '\"'");
+ return;
+ }
+
+ // Read the attribute value (and consume the matching quote)
+ var value = this.readString(c);
+
+ node.attributes.push(new Attribute(name, decodeHTML(value)));
+
+ return;
+ },
+
+ /**
+ * Parses and returns an Element node. This is called after a '<' has been
+ * read.
+ *
+ * @returns an array; the first index of the array is the parsed node;
+ * the second index is a boolean indicating whether this is a void
+ * Element
+ */
+ makeElementNode: function (retPair) {
+ var c = this.nextChar();
+
+ // Read the Element tag name
+ var strBuf = this.strBuf;
+ strBuf.length = 0;
+ while (whitespace.indexOf(c) == -1 && c !== ">" && c !== "/") {
+ if (c === undefined)
+ return false;
+ strBuf.push(c);
+ c = this.nextChar();
+ }
+ var tag = strBuf.join("");
+
+ if (!tag)
+ return false;
+
+ var node = new Element(tag);
+
+ // Read Element attributes
+ while (c !== "/" && c !== ">") {
+ if (c === undefined)
+ return false;
+ while (whitespace.indexOf(this.html[this.currentChar++]) != -1) {
+ // Advance cursor to first non-whitespace char.
+ }
+ this.currentChar--;
+ c = this.nextChar();
+ if (c !== "/" && c !== ">") {
+ --this.currentChar;
+ this.readAttribute(node);
+ }
+ }
+
+ // If this is a self-closing tag, read '/>'
+ var closed = false;
+ if (c === "/") {
+ closed = true;
+ c = this.nextChar();
+ if (c !== ">") {
+ this.error("expected '>' to close " + tag);
+ return false;
+ }
+ }
+
+ retPair[0] = node;
+ retPair[1] = closed;
+ return true;
+ },
+
+ /**
+ * If the current input matches this string, advance the input index;
+ * otherwise, do nothing.
+ *
+ * @returns whether input matched string
+ */
+ match: function (str) {
+ var strlen = str.length;
+ if (this.html.substr(this.currentChar, strlen).toLowerCase() === str.toLowerCase()) {
+ this.currentChar += strlen;
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * Searches the input until a string is found and discards all input up to
+ * and including the matched string.
+ */
+ discardTo: function (str) {
+ var index = this.html.indexOf(str, this.currentChar) + str.length;
+ if (index === -1)
+ this.currentChar = this.html.length;
+ this.currentChar = index;
+ },
+
+ /**
+ * Reads child nodes for the given node.
+ */
+ readChildren: function (node) {
+ var child;
+ while ((child = this.readNode())) {
+ // Don't keep Comment nodes
+ if (child.nodeType !== 8) {
+ node.appendChild(child);
+ }
+ }
+ },
+
+ discardNextComment: function() {
+ if (this.match("--")) {
+ this.discardTo("-->");
+ } else {
+ var c = this.nextChar();
+ while (c !== ">") {
+ if (c === undefined)
+ return null;
+ if (c === '"' || c === "'")
+ this.readString(c);
+ c = this.nextChar();
+ }
+ }
+ return new Comment();
+ },
+
+
+ /**
+ * Reads the next child node from the input. If we're reading a closing
+ * tag, or if we've reached the end of input, return null.
+ *
+ * @returns the node
+ */
+ readNode: function () {
+ var c = this.nextChar();
+
+ if (c === undefined)
+ return null;
+
+ // Read any text as Text node
+ var textNode;
+ if (c !== "<") {
+ --this.currentChar;
+ textNode = new Text();
+ var n = this.html.indexOf("<", this.currentChar);
+ if (n === -1) {
+ textNode.innerHTML = this.html.substring(this.currentChar, this.html.length);
+ this.currentChar = this.html.length;
+ } else {
+ textNode.innerHTML = this.html.substring(this.currentChar, n);
+ this.currentChar = n;
+ }
+ return textNode;
+ }
+
+ if (this.match("![CDATA[")) {
+ var endChar = this.html.indexOf("]]>", this.currentChar);
+ if (endChar === -1) {
+ this.error("unclosed CDATA section");
+ return null;
+ }
+ textNode = new Text();
+ textNode.textContent = this.html.substring(this.currentChar, endChar);
+ this.currentChar = endChar + ("]]>").length;
+ return textNode;
+ }
+
+ c = this.peekNext();
+
+ // Read Comment node. Normally, Comment nodes know their inner
+ // textContent, but we don't really care about Comment nodes (we throw
+ // them away in readChildren()). So just returning an empty Comment node
+ // here is sufficient.
+ if (c === "!" || c === "?") {
+ // We're still before the ! or ? that is starting this comment:
+ this.currentChar++;
+ return this.discardNextComment();
+ }
+
+ // If we're reading a closing tag, return null. This means we've reached
+ // the end of this set of child nodes.
+ if (c === "/") {
+ --this.currentChar;
+ return null;
+ }
+
+ // Otherwise, we're looking at an Element node
+ var result = this.makeElementNode(this.retPair);
+ if (!result)
+ return null;
+
+ var node = this.retPair[0];
+ var closed = this.retPair[1];
+ var localName = node.localName;
+
+ // If this isn't a void Element, read its child nodes
+ if (!closed) {
+ this.readChildren(node);
+ var closingTag = "" + node._matchingTag + ">";
+ if (!this.match(closingTag)) {
+ this.error("expected '" + closingTag + "' and got " + this.html.substr(this.currentChar, closingTag.length));
+ return null;
+ }
+ }
+
+ // Only use the first title, because SVG might have other
+ // title elements which we don't care about (medium.com
+ // does this, at least).
+ if (localName === "title" && !this.doc.title) {
+ this.doc.title = node.textContent.trim();
+ } else if (localName === "head") {
+ this.doc.head = node;
+ } else if (localName === "body") {
+ this.doc.body = node;
+ } else if (localName === "html") {
+ this.doc.documentElement = node;
+ }
+
+ return node;
+ },
+
+ /**
+ * Parses an HTML string and returns a JS implementation of the Document.
+ */
+ parse: function (html, url) {
+ this.html = html;
+ var doc = this.doc = new Document(url);
+ this.readChildren(doc);
+
+ // If this is an HTML document, remove root-level children except for the
+ // node
+ if (doc.documentElement) {
+ for (var i = doc.childNodes.length; --i >= 0;) {
+ var child = doc.childNodes[i];
+ if (child !== doc.documentElement) {
+ doc.removeChild(child);
+ }
+ }
+ }
+
+ return doc;
+ }
+ };
+
+ // Attach the standard DOM types to the global scope
+ global.Node = Node;
+ global.Comment = Comment;
+ global.Document = Document;
+ global.Element = Element;
+ global.Text = Text;
+
+ // Attach JSDOMParser to the global scope
+ global.JSDOMParser = JSDOMParser;
+
+})(this);
+
+if (typeof module === "object") {
+ module.exports = this.JSDOMParser;
+}
diff --git a/apps/web-clipper/lib/Readability-readerable.js b/apps/web-clipper/lib/Readability-readerable.js
new file mode 100644
index 000000000..64be5e15e
--- /dev/null
+++ b/apps/web-clipper/lib/Readability-readerable.js
@@ -0,0 +1,108 @@
+/* eslint-env es6:false */
+/*
+ * Copyright (c) 2010 Arc90 Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This code is heavily based on Arc90's readability.js (1.7.1) script
+ * available at: http://code.google.com/p/arc90labs-readability
+ */
+
+var REGEXPS = {
+ // NOTE: These two regular expressions are duplicated in
+ // Readability.js. Please keep both copies in sync.
+ unlikelyCandidates: /-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,
+ okMaybeItsACandidate: /and|article|body|column|content|main|shadow/i,
+};
+
+function isNodeVisible(node) {
+ // Have to null-check node.style and node.className.indexOf to deal with SVG and MathML nodes.
+ return (!node.style || node.style.display != "none")
+ && !node.hasAttribute("hidden")
+ //check for "fallback-image" so that wikimedia math images are displayed
+ && (!node.hasAttribute("aria-hidden") || node.getAttribute("aria-hidden") != "true" || (node.className && node.className.indexOf && node.className.indexOf("fallback-image") !== -1));
+}
+
+/**
+ * Decides whether or not the document is reader-able without parsing the whole thing.
+ * @param {Object} options Configuration object.
+ * @param {number} [options.minContentLength=140] The minimum node content length used to decide if the document is readerable.
+ * @param {number} [options.minScore=20] The minumum cumulated 'score' used to determine if the document is readerable.
+ * @param {Function} [options.visibilityChecker=isNodeVisible] The function used to determine if a node is visible.
+ * @return {boolean} Whether or not we suspect Readability.parse() will suceeed at returning an article object.
+ */
+function isProbablyReaderable(doc, options = {}) {
+ // For backward compatibility reasons 'options' can either be a configuration object or the function used
+ // to determine if a node is visible.
+ if (typeof options == "function") {
+ options = { visibilityChecker: options };
+ }
+
+ var defaultOptions = { minScore: 20, minContentLength: 140, visibilityChecker: isNodeVisible };
+ options = Object.assign(defaultOptions, options);
+
+ var nodes = doc.querySelectorAll("p, pre, article");
+
+ // Get nodes which have
node(s) and append them into the `nodes` variable.
+ // Some articles' DOM structures might look like
+ //
+ // Sentences
+ //
+ // Sentences
+ //
+ var brNodes = doc.querySelectorAll("div > br");
+ if (brNodes.length) {
+ var set = new Set(nodes);
+ [].forEach.call(brNodes, function (node) {
+ set.add(node.parentNode);
+ });
+ nodes = Array.from(set);
+ }
+
+ var score = 0;
+ // This is a little cheeky, we use the accumulator 'score' to decide what to return from
+ // this callback:
+ return [].some.call(nodes, function (node) {
+ if (!options.visibilityChecker(node)) {
+ return false;
+ }
+
+ var matchString = node.className + " " + node.id;
+ if (REGEXPS.unlikelyCandidates.test(matchString) &&
+ !REGEXPS.okMaybeItsACandidate.test(matchString)) {
+ return false;
+ }
+
+ if (node.matches("li p")) {
+ return false;
+ }
+
+ var textContentLength = node.textContent.trim().length;
+ if (textContentLength < options.minContentLength) {
+ return false;
+ }
+
+ score += Math.sqrt(textContentLength - options.minContentLength);
+
+ if (score > options.minScore) {
+ return true;
+ }
+ return false;
+ });
+}
+
+if (typeof module === "object") {
+ module.exports = isProbablyReaderable;
+}
diff --git a/apps/web-clipper/lib/Readability.js b/apps/web-clipper/lib/Readability.js
new file mode 100644
index 000000000..ce06df459
--- /dev/null
+++ b/apps/web-clipper/lib/Readability.js
@@ -0,0 +1,2283 @@
+/*eslint-env es6:false*/
+/*
+ * Copyright (c) 2010 Arc90 Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This code is heavily based on Arc90's readability.js (1.7.1) script
+ * available at: http://code.google.com/p/arc90labs-readability
+ */
+
+/**
+ * Public constructor.
+ * @param {HTMLDocument} doc The document to parse.
+ * @param {Object} options The options object.
+ */
+function Readability(doc, options) {
+ // In some older versions, people passed a URI as the first argument. Cope:
+ if (options && options.documentElement) {
+ doc = options;
+ options = arguments[2];
+ } else if (!doc || !doc.documentElement) {
+ throw new Error("First argument to Readability constructor should be a document object.");
+ }
+ options = options || {};
+
+ this._doc = doc;
+ this._docJSDOMParser = this._doc.firstChild.__JSDOMParser__;
+ this._articleTitle = null;
+ this._articleByline = null;
+ this._articleDir = null;
+ this._articleSiteName = null;
+ this._attempts = [];
+
+ // Configurable options
+ this._debug = !!options.debug;
+ this._maxElemsToParse = options.maxElemsToParse || this.DEFAULT_MAX_ELEMS_TO_PARSE;
+ this._nbTopCandidates = options.nbTopCandidates || this.DEFAULT_N_TOP_CANDIDATES;
+ this._charThreshold = options.charThreshold || this.DEFAULT_CHAR_THRESHOLD;
+ this._classesToPreserve = this.CLASSES_TO_PRESERVE.concat(options.classesToPreserve || []);
+ this._keepClasses = !!options.keepClasses;
+ this._serializer = options.serializer || function(el) {
+ return el.innerHTML;
+ };
+ this._disableJSONLD = !!options.disableJSONLD;
+
+ // Start with all flags set
+ this._flags = this.FLAG_STRIP_UNLIKELYS |
+ this.FLAG_WEIGHT_CLASSES |
+ this.FLAG_CLEAN_CONDITIONALLY;
+
+
+ // Control whether log messages are sent to the console
+ if (this._debug) {
+ let logNode = function(node) {
+ if (node.nodeType == node.TEXT_NODE) {
+ return `${node.nodeName} ("${node.textContent}")`;
+ }
+ let attrPairs = Array.from(node.attributes || [], function(attr) {
+ return `${attr.name}="${attr.value}"`;
+ }).join(" ");
+ return `<${node.localName} ${attrPairs}>`;
+ };
+ this.log = function () {
+ if (typeof dump !== "undefined") {
+ var msg = Array.prototype.map.call(arguments, function(x) {
+ return (x && x.nodeName) ? logNode(x) : x;
+ }).join(" ");
+ dump("Reader: (Readability) " + msg + "\n");
+ } else if (typeof console !== "undefined") {
+ let args = Array.from(arguments, arg => {
+ if (arg && arg.nodeType == this.ELEMENT_NODE) {
+ return logNode(arg);
+ }
+ return arg;
+ });
+ args.unshift("Reader: (Readability)");
+ console.log.apply(console, args);
+ }
+ };
+ } else {
+ this.log = function () {};
+ }
+}
+
+Readability.prototype = {
+ FLAG_STRIP_UNLIKELYS: 0x1,
+ FLAG_WEIGHT_CLASSES: 0x2,
+ FLAG_CLEAN_CONDITIONALLY: 0x4,
+
+ // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
+ ELEMENT_NODE: 1,
+ TEXT_NODE: 3,
+
+ // Max number of nodes supported by this parser. Default: 0 (no limit)
+ DEFAULT_MAX_ELEMS_TO_PARSE: 0,
+
+ // The number of top candidates to consider when analysing how
+ // tight the competition is among candidates.
+ DEFAULT_N_TOP_CANDIDATES: 5,
+
+ // Element tags to score by default.
+ DEFAULT_TAGS_TO_SCORE: "section,h2,h3,h4,h5,h6,p,td,pre".toUpperCase().split(","),
+
+ // The default number of chars an article must have in order to return a result
+ DEFAULT_CHAR_THRESHOLD: 500,
+
+ // All of the regular expressions in use within readability.
+ // Defined up here so we don't instantiate them repeatedly in loops.
+ REGEXPS: {
+ // NOTE: These two regular expressions are duplicated in
+ // Readability-readerable.js. Please keep both copies in sync.
+ unlikelyCandidates: /-ad-|ai2html|banner|breadcrumbs|combx|comment|community|cover-wrap|disqus|extra|footer|gdpr|header|legends|menu|related|remark|replies|rss|shoutbox|sidebar|skyscraper|social|sponsor|supplemental|ad-break|agegate|pagination|pager|popup|yom-remote/i,
+ okMaybeItsACandidate: /and|article|body|column|content|main|shadow/i,
+
+ positive: /article|body|content|entry|hentry|h-entry|main|page|pagination|post|text|blog|story/i,
+ negative: /-ad-|hidden|^hid$| hid$| hid |^hid |banner|combx|comment|com-|contact|foot|footer|footnote|gdpr|masthead|media|meta|outbrain|promo|related|scroll|share|shoutbox|sidebar|skyscraper|sponsor|shopping|tags|tool|widget/i,
+ extraneous: /print|archive|comment|discuss|e[\-]?mail|share|reply|all|login|sign|single|utility/i,
+ byline: /byline|author|dateline|writtenby|p-author/i,
+ replaceFonts: /<(\/?)font[^>]*>/gi,
+ normalize: /\s{2,}/g,
+ videos: /\/\/(www\.)?((dailymotion|youtube|youtube-nocookie|player\.vimeo|v\.qq)\.com|(archive|upload\.wikimedia)\.org|player\.twitch\.tv)/i,
+ shareElements: /(\b|_)(share|sharedaddy)(\b|_)/i,
+ nextLink: /(next|weiter|continue|>([^\|]|$)|»([^\|]|$))/i,
+ prevLink: /(prev|earl|old|new|<|«)/i,
+ tokenize: /\W+/g,
+ whitespace: /^\s*$/,
+ hasContent: /\S$/,
+ hashUrl: /^#.+/,
+ srcsetUrl: /(\S+)(\s+[\d.]+[xw])?(\s*(?:,|$))/g,
+ b64DataUrl: /^data:\s*([^\s;,]+)\s*;\s*base64\s*,/i,
+ // See: https://schema.org/Article
+ jsonLdArticleTypes: /^Article|AdvertiserContentArticle|NewsArticle|AnalysisNewsArticle|AskPublicNewsArticle|BackgroundNewsArticle|OpinionNewsArticle|ReportageNewsArticle|ReviewNewsArticle|Report|SatiricalArticle|ScholarlyArticle|MedicalScholarlyArticle|SocialMediaPosting|BlogPosting|LiveBlogPosting|DiscussionForumPosting|TechArticle|APIReference$/
+ },
+
+ UNLIKELY_ROLES: [ "menu", "menubar", "complementary", "navigation", "alert", "alertdialog", "dialog" ],
+
+ DIV_TO_P_ELEMS: new Set([ "BLOCKQUOTE", "DL", "DIV", "IMG", "OL", "P", "PRE", "TABLE", "UL" ]),
+
+ ALTER_TO_DIV_EXCEPTIONS: ["DIV", "ARTICLE", "SECTION", "P"],
+
+ PRESENTATIONAL_ATTRIBUTES: [ "align", "background", "bgcolor", "border", "cellpadding", "cellspacing", "frame", "hspace", "rules", "style", "valign", "vspace" ],
+
+ DEPRECATED_SIZE_ATTRIBUTE_ELEMS: [ "TABLE", "TH", "TD", "HR", "PRE" ],
+
+ // The commented out elements qualify as phrasing content but tend to be
+ // removed by readability when put into paragraphs, so we ignore them here.
+ PHRASING_ELEMS: [
+ // "CANVAS", "IFRAME", "SVG", "VIDEO",
+ "ABBR", "AUDIO", "B", "BDO", "BR", "BUTTON", "CITE", "CODE", "DATA",
+ "DATALIST", "DFN", "EM", "EMBED", "I", "IMG", "INPUT", "KBD", "LABEL",
+ "MARK", "MATH", "METER", "NOSCRIPT", "OBJECT", "OUTPUT", "PROGRESS", "Q",
+ "RUBY", "SAMP", "SCRIPT", "SELECT", "SMALL", "SPAN", "STRONG", "SUB",
+ "SUP", "TEXTAREA", "TIME", "VAR", "WBR"
+ ],
+
+ // These are the classes that readability sets itself.
+ CLASSES_TO_PRESERVE: [ "page" ],
+
+ // These are the list of HTML entities that need to be escaped.
+ HTML_ESCAPE_MAP: {
+ "lt": "<",
+ "gt": ">",
+ "amp": "&",
+ "quot": '"',
+ "apos": "'",
+ },
+
+ /**
+ * Run any post-process modifications to article content as necessary.
+ *
+ * @param Element
+ * @return void
+ **/
+ _postProcessContent: function(articleContent) {
+ // Readability cannot open relative uris so we convert them to absolute uris.
+ this._fixRelativeUris(articleContent);
+
+ this._simplifyNestedElements(articleContent);
+
+ if (!this._keepClasses) {
+ // Remove classes.
+ this._cleanClasses(articleContent);
+ }
+ },
+
+ /**
+ * Iterates over a NodeList, calls `filterFn` for each node and removes node
+ * if function returned `true`.
+ *
+ * If function is not passed, removes all the nodes in node list.
+ *
+ * @param NodeList nodeList The nodes to operate on
+ * @param Function filterFn the function to use as a filter
+ * @return void
+ */
+ _removeNodes: function(nodeList, filterFn) {
+ // Avoid ever operating on live node lists.
+ if (this._docJSDOMParser && nodeList._isLiveNodeList) {
+ throw new Error("Do not pass live node lists to _removeNodes");
+ }
+ for (var i = nodeList.length - 1; i >= 0; i--) {
+ var node = nodeList[i];
+ var parentNode = node.parentNode;
+ if (parentNode) {
+ if (!filterFn || filterFn.call(this, node, i, nodeList)) {
+ parentNode.removeChild(node);
+ }
+ }
+ }
+ },
+
+ /**
+ * Iterates over a NodeList, and calls _setNodeTag for each node.
+ *
+ * @param NodeList nodeList The nodes to operate on
+ * @param String newTagName the new tag name to use
+ * @return void
+ */
+ _replaceNodeTags: function(nodeList, newTagName) {
+ // Avoid ever operating on live node lists.
+ if (this._docJSDOMParser && nodeList._isLiveNodeList) {
+ throw new Error("Do not pass live node lists to _replaceNodeTags");
+ }
+ for (const node of nodeList) {
+ this._setNodeTag(node, newTagName);
+ }
+ },
+
+ /**
+ * Iterate over a NodeList, which doesn't natively fully implement the Array
+ * interface.
+ *
+ * For convenience, the current object context is applied to the provided
+ * iterate function.
+ *
+ * @param NodeList nodeList The NodeList.
+ * @param Function fn The iterate function.
+ * @return void
+ */
+ _forEachNode: function(nodeList, fn) {
+ Array.prototype.forEach.call(nodeList, fn, this);
+ },
+
+ /**
+ * Iterate over a NodeList, and return the first node that passes
+ * the supplied test function
+ *
+ * For convenience, the current object context is applied to the provided
+ * test function.
+ *
+ * @param NodeList nodeList The NodeList.
+ * @param Function fn The test function.
+ * @return void
+ */
+ _findNode: function(nodeList, fn) {
+ return Array.prototype.find.call(nodeList, fn, this);
+ },
+
+ /**
+ * Iterate over a NodeList, return true if any of the provided iterate
+ * function calls returns true, false otherwise.
+ *
+ * For convenience, the current object context is applied to the
+ * provided iterate function.
+ *
+ * @param NodeList nodeList The NodeList.
+ * @param Function fn The iterate function.
+ * @return Boolean
+ */
+ _someNode: function(nodeList, fn) {
+ return Array.prototype.some.call(nodeList, fn, this);
+ },
+
+ /**
+ * Iterate over a NodeList, return true if all of the provided iterate
+ * function calls return true, false otherwise.
+ *
+ * For convenience, the current object context is applied to the
+ * provided iterate function.
+ *
+ * @param NodeList nodeList The NodeList.
+ * @param Function fn The iterate function.
+ * @return Boolean
+ */
+ _everyNode: function(nodeList, fn) {
+ return Array.prototype.every.call(nodeList, fn, this);
+ },
+
+ /**
+ * Concat all nodelists passed as arguments.
+ *
+ * @return ...NodeList
+ * @return Array
+ */
+ _concatNodeLists: function() {
+ var slice = Array.prototype.slice;
+ var args = slice.call(arguments);
+ var nodeLists = args.map(function(list) {
+ return slice.call(list);
+ });
+ return Array.prototype.concat.apply([], nodeLists);
+ },
+
+ _getAllNodesWithTag: function(node, tagNames) {
+ if (node.querySelectorAll) {
+ return node.querySelectorAll(tagNames.join(","));
+ }
+ return [].concat.apply([], tagNames.map(function(tag) {
+ var collection = node.getElementsByTagName(tag);
+ return Array.isArray(collection) ? collection : Array.from(collection);
+ }));
+ },
+
+ /**
+ * Removes the class="" attribute from every element in the given
+ * subtree, except those that match CLASSES_TO_PRESERVE and
+ * the classesToPreserve array from the options object.
+ *
+ * @param Element
+ * @return void
+ */
+ _cleanClasses: function(node) {
+ var classesToPreserve = this._classesToPreserve;
+ var className = (node.getAttribute("class") || "")
+ .split(/\s+/)
+ .filter(function(cls) {
+ return classesToPreserve.indexOf(cls) != -1;
+ })
+ .join(" ");
+
+ if (className) {
+ node.setAttribute("class", className);
+ } else {
+ node.removeAttribute("class");
+ }
+
+ for (node = node.firstElementChild; node; node = node.nextElementSibling) {
+ this._cleanClasses(node);
+ }
+ },
+
+ /**
+ * Converts each
and uri in the given element to an absolute URI,
+ * ignoring #ref URIs.
+ *
+ * @param Element
+ * @return void
+ */
+ _fixRelativeUris: function(articleContent) {
+ var baseURI = this._doc.baseURI;
+ var documentURI = this._doc.documentURI;
+ function toAbsoluteURI(uri) {
+ // Leave hash links alone if the base URI matches the document URI:
+ if (baseURI == documentURI && uri.charAt(0) == "#") {
+ return uri;
+ }
+
+ // Otherwise, resolve against base URI:
+ try {
+ return new URL(uri, baseURI).href;
+ } catch (ex) {
+ // Something went wrong, just return the original:
+ }
+ return uri;
+ }
+
+ var links = this._getAllNodesWithTag(articleContent, ["a"]);
+ this._forEachNode(links, function(link) {
+ var href = link.getAttribute("href");
+ if (href) {
+ // Remove links with javascript: URIs, since
+ // they won't work after scripts have been removed from the page.
+ if (href.indexOf("javascript:") === 0) {
+ // if the link only contains simple text content, it can be converted to a text node
+ if (link.childNodes.length === 1 && link.childNodes[0].nodeType === this.TEXT_NODE) {
+ var text = this._doc.createTextNode(link.textContent);
+ link.parentNode.replaceChild(text, link);
+ } else {
+ // if the link has multiple children, they should all be preserved
+ var container = this._doc.createElement("span");
+ while (link.firstChild) {
+ container.appendChild(link.firstChild);
+ }
+ link.parentNode.replaceChild(container, link);
+ }
+ } else {
+ link.setAttribute("href", toAbsoluteURI(href));
+ }
+ }
+ });
+
+ var medias = this._getAllNodesWithTag(articleContent, [
+ "img", "picture", "figure", "video", "audio", "source"
+ ]);
+
+ this._forEachNode(medias, function(media) {
+ var src = media.getAttribute("src");
+ var poster = media.getAttribute("poster");
+ var srcset = media.getAttribute("srcset");
+
+ if (src) {
+ media.setAttribute("src", toAbsoluteURI(src));
+ }
+
+ if (poster) {
+ media.setAttribute("poster", toAbsoluteURI(poster));
+ }
+
+ if (srcset) {
+ var newSrcset = srcset.replace(this.REGEXPS.srcsetUrl, function(_, p1, p2, p3) {
+ return toAbsoluteURI(p1) + (p2 || "") + p3;
+ });
+
+ media.setAttribute("srcset", newSrcset);
+ }
+ });
+ },
+
+ _simplifyNestedElements: function(articleContent) {
+ var node = articleContent;
+
+ while (node) {
+ if (node.parentNode && ["DIV", "SECTION"].includes(node.tagName) && !(node.id && node.id.startsWith("readability"))) {
+ if (this._isElementWithoutContent(node)) {
+ node = this._removeAndGetNext(node);
+ continue;
+ } else if (this._hasSingleTagInsideElement(node, "DIV") || this._hasSingleTagInsideElement(node, "SECTION")) {
+ var child = node.children[0];
+ for (var i = 0; i < node.attributes.length; i++) {
+ child.setAttribute(node.attributes[i].name, node.attributes[i].value);
+ }
+ node.parentNode.replaceChild(child, node);
+ node = child;
+ continue;
+ }
+ }
+
+ node = this._getNextNode(node);
+ }
+ },
+
+ /**
+ * Get the article title as an H1.
+ *
+ * @return string
+ **/
+ _getArticleTitle: function() {
+ var doc = this._doc;
+ var curTitle = "";
+ var origTitle = "";
+
+ try {
+ curTitle = origTitle = doc.title.trim();
+
+ // If they had an element with id "title" in their HTML
+ if (typeof curTitle !== "string")
+ curTitle = origTitle = this._getInnerText(doc.getElementsByTagName("title")[0]);
+ } catch (e) {/* ignore exceptions setting the title. */}
+
+ var titleHadHierarchicalSeparators = false;
+ function wordCount(str) {
+ return str.split(/\s+/).length;
+ }
+
+ // If there's a separator in the title, first remove the final part
+ if ((/ [\|\-\\\/>»] /).test(curTitle)) {
+ titleHadHierarchicalSeparators = / [\\\/>»] /.test(curTitle);
+ curTitle = origTitle.replace(/(.*)[\|\-\\\/>»] .*/gi, "$1");
+
+ // If the resulting title is too short (3 words or fewer), remove
+ // the first part instead:
+ if (wordCount(curTitle) < 3)
+ curTitle = origTitle.replace(/[^\|\-\\\/>»]*[\|\-\\\/>»](.*)/gi, "$1");
+ } else if (curTitle.indexOf(": ") !== -1) {
+ // Check if we have an heading containing this exact string, so we
+ // could assume it's the full title.
+ var headings = this._concatNodeLists(
+ doc.getElementsByTagName("h1"),
+ doc.getElementsByTagName("h2")
+ );
+ var trimmedTitle = curTitle.trim();
+ var match = this._someNode(headings, function(heading) {
+ return heading.textContent.trim() === trimmedTitle;
+ });
+
+ // If we don't, let's extract the title out of the original title string.
+ if (!match) {
+ curTitle = origTitle.substring(origTitle.lastIndexOf(":") + 1);
+
+ // If the title is now too short, try the first colon instead:
+ if (wordCount(curTitle) < 3) {
+ curTitle = origTitle.substring(origTitle.indexOf(":") + 1);
+ // But if we have too many words before the colon there's something weird
+ // with the titles and the H tags so let's just use the original title instead
+ } else if (wordCount(origTitle.substr(0, origTitle.indexOf(":"))) > 5) {
+ curTitle = origTitle;
+ }
+ }
+ } else if (curTitle.length > 150 || curTitle.length < 15) {
+ var hOnes = doc.getElementsByTagName("h1");
+
+ if (hOnes.length === 1)
+ curTitle = this._getInnerText(hOnes[0]);
+ }
+
+ curTitle = curTitle.trim().replace(this.REGEXPS.normalize, " ");
+ // If we now have 4 words or fewer as our title, and either no
+ // 'hierarchical' separators (\, /, > or ») were found in the original
+ // title or we decreased the number of words by more than 1 word, use
+ // the original title.
+ var curTitleWordCount = wordCount(curTitle);
+ if (curTitleWordCount <= 4 &&
+ (!titleHadHierarchicalSeparators ||
+ curTitleWordCount != wordCount(origTitle.replace(/[\|\-\\\/>»]+/g, "")) - 1)) {
+ curTitle = origTitle;
+ }
+
+ return curTitle;
+ },
+
+ /**
+ * Prepare the HTML document for readability to scrape it.
+ * This includes things like stripping javascript, CSS, and handling terrible markup.
+ *
+ * @return void
+ **/
+ _prepDocument: function() {
+ var doc = this._doc;
+
+ // Remove all style tags in head
+ this._removeNodes(this._getAllNodesWithTag(doc, ["style"]));
+
+ if (doc.body) {
+ this._replaceBrs(doc.body);
+ }
+
+ this._replaceNodeTags(this._getAllNodesWithTag(doc, ["font"]), "SPAN");
+ },
+
+ /**
+ * Finds the next node, starting from the given node, and ignoring
+ * whitespace in between. If the given node is an element, the same node is
+ * returned.
+ */
+ _nextNode: function (node) {
+ var next = node;
+ while (next
+ && (next.nodeType != this.ELEMENT_NODE)
+ && this.REGEXPS.whitespace.test(next.textContent)) {
+ next = next.nextSibling;
+ }
+ return next;
+ },
+
+ /**
+ * Replaces 2 or more successive elements with a single .
+ * Whitespace between elements are ignored. For example:
+ *
foo bar abc
+ * will become:
+ *
+ */
+ _replaceBrs: function (elem) {
+ this._forEachNode(this._getAllNodesWithTag(elem, ["br"]), function(br) {
+ var next = br.nextSibling;
+
+ // Whether 2 or more elements have been found and replaced with a
+ // block.
+ var replaced = false;
+
+ // If we find a chain, remove the s until we hit another node
+ // or non-whitespace. This leaves behind the first in the chain
+ // (which will be replaced with a
later).
+ while ((next = this._nextNode(next)) && (next.tagName == "BR")) {
+ replaced = true;
+ var brSibling = next.nextSibling;
+ next.parentNode.removeChild(next);
+ next = brSibling;
+ }
+
+ // If we removed a chain, replace the remaining with a
. Add
+ // all sibling nodes as children of the
until we hit another
+ // chain.
+ if (replaced) {
+ var p = this._doc.createElement("p");
+ br.parentNode.replaceChild(p, br);
+
+ next = p.nextSibling;
+ while (next) {
+ // If we've hit another , we're done adding children to this
.
+ if (next.tagName == "BR") {
+ var nextElem = this._nextNode(next.nextSibling);
+ if (nextElem && nextElem.tagName == "BR")
+ break;
+ }
+
+ if (!this._isPhrasingContent(next))
+ break;
+
+ // Otherwise, make this node a child of the new
.
+ var sibling = next.nextSibling;
+ p.appendChild(next);
+ next = sibling;
+ }
+
+ while (p.lastChild && this._isWhitespace(p.lastChild)) {
+ p.removeChild(p.lastChild);
+ }
+
+ if (p.parentNode.tagName === "P")
+ this._setNodeTag(p.parentNode, "DIV");
+ }
+ });
+ },
+
+ _setNodeTag: function (node, tag) {
+ this.log("_setNodeTag", node, tag);
+ if (this._docJSDOMParser) {
+ node.localName = tag.toLowerCase();
+ node.tagName = tag.toUpperCase();
+ return node;
+ }
+
+ var replacement = node.ownerDocument.createElement(tag);
+ while (node.firstChild) {
+ replacement.appendChild(node.firstChild);
+ }
+ node.parentNode.replaceChild(replacement, node);
+ if (node.readability)
+ replacement.readability = node.readability;
+
+ for (var i = 0; i < node.attributes.length; i++) {
+ try {
+ replacement.setAttribute(node.attributes[i].name, node.attributes[i].value);
+ } catch (ex) {
+ /* it's possible for setAttribute() to throw if the attribute name
+ * isn't a valid XML Name. Such attributes can however be parsed from
+ * source in HTML docs, see https://github.com/whatwg/html/issues/4275,
+ * so we can hit them here and then throw. We don't care about such
+ * attributes so we ignore them.
+ */
+ }
+ }
+ return replacement;
+ },
+
+ /**
+ * Prepare the article node for display. Clean out any inline styles,
+ * iframes, forms, strip extraneous
tags, etc.
+ *
+ * @param Element
+ * @return void
+ **/
+ _prepArticle: function(articleContent) {
+ this._cleanStyles(articleContent);
+
+ // Check for data tables before we continue, to avoid removing items in
+ // those tables, which will often be isolated even though they're
+ // visually linked to other content-ful elements (text, images, etc.).
+ this._markDataTables(articleContent);
+
+ this._fixLazyImages(articleContent);
+
+ // Clean out junk from the article content
+ this._cleanConditionally(articleContent, "form");
+ this._cleanConditionally(articleContent, "fieldset");
+ this._clean(articleContent, "object");
+ this._clean(articleContent, "embed");
+ this._clean(articleContent, "footer");
+ this._clean(articleContent, "link");
+ this._clean(articleContent, "aside");
+
+ // Clean out elements with little content that have "share" in their id/class combinations from final top candidates,
+ // which means we don't remove the top candidates even they have "share".
+
+ var shareElementThreshold = this.DEFAULT_CHAR_THRESHOLD;
+
+ this._forEachNode(articleContent.children, function (topCandidate) {
+ this._cleanMatchedNodes(topCandidate, function (node, matchString) {
+ return this.REGEXPS.shareElements.test(matchString) && node.textContent.length < shareElementThreshold;
+ });
+ });
+
+ this._clean(articleContent, "iframe");
+ this._clean(articleContent, "input");
+ this._clean(articleContent, "textarea");
+ this._clean(articleContent, "select");
+ this._clean(articleContent, "button");
+ this._cleanHeaders(articleContent);
+
+ // Do these last as the previous stuff may have removed junk
+ // that will affect these
+ this._cleanConditionally(articleContent, "table");
+ this._cleanConditionally(articleContent, "ul");
+ this._cleanConditionally(articleContent, "div");
+
+ // replace H1 with H2 as H1 should be only title that is displayed separately
+ this._replaceNodeTags(this._getAllNodesWithTag(articleContent, ["h1"]), "h2");
+
+ // Remove extra paragraphs
+ this._removeNodes(this._getAllNodesWithTag(articleContent, ["p"]), function (paragraph) {
+ var imgCount = paragraph.getElementsByTagName("img").length;
+ var embedCount = paragraph.getElementsByTagName("embed").length;
+ var objectCount = paragraph.getElementsByTagName("object").length;
+ // At this point, nasty iframes have been removed, only remain embedded video ones.
+ var iframeCount = paragraph.getElementsByTagName("iframe").length;
+ var totalCount = imgCount + embedCount + objectCount + iframeCount;
+
+ return totalCount === 0 && !this._getInnerText(paragraph, false);
+ });
+
+ this._forEachNode(this._getAllNodesWithTag(articleContent, ["br"]), function(br) {
+ var next = this._nextNode(br.nextSibling);
+ if (next && next.tagName == "P")
+ br.parentNode.removeChild(br);
+ });
+
+ // Remove single-cell tables
+ this._forEachNode(this._getAllNodesWithTag(articleContent, ["table"]), function(table) {
+ var tbody = this._hasSingleTagInsideElement(table, "TBODY") ? table.firstElementChild : table;
+ if (this._hasSingleTagInsideElement(tbody, "TR")) {
+ var row = tbody.firstElementChild;
+ if (this._hasSingleTagInsideElement(row, "TD")) {
+ var cell = row.firstElementChild;
+ cell = this._setNodeTag(cell, this._everyNode(cell.childNodes, this._isPhrasingContent) ? "P" : "DIV");
+ table.parentNode.replaceChild(cell, table);
+ }
+ }
+ });
+ },
+
+ /**
+ * Initialize a node with the readability object. Also checks the
+ * className/id for special names to add to its score.
+ *
+ * @param Element
+ * @return void
+ **/
+ _initializeNode: function(node) {
+ node.readability = {"contentScore": 0};
+
+ switch (node.tagName) {
+ case "DIV":
+ node.readability.contentScore += 5;
+ break;
+
+ case "PRE":
+ case "TD":
+ case "BLOCKQUOTE":
+ node.readability.contentScore += 3;
+ break;
+
+ case "ADDRESS":
+ case "OL":
+ case "UL":
+ case "DL":
+ case "DD":
+ case "DT":
+ case "LI":
+ case "FORM":
+ node.readability.contentScore -= 3;
+ break;
+
+ case "H1":
+ case "H2":
+ case "H3":
+ case "H4":
+ case "H5":
+ case "H6":
+ case "TH":
+ node.readability.contentScore -= 5;
+ break;
+ }
+
+ node.readability.contentScore += this._getClassWeight(node);
+ },
+
+ _removeAndGetNext: function(node) {
+ var nextNode = this._getNextNode(node, true);
+ node.parentNode.removeChild(node);
+ return nextNode;
+ },
+
+ /**
+ * Traverse the DOM from node to node, starting at the node passed in.
+ * Pass true for the second parameter to indicate this node itself
+ * (and its kids) are going away, and we want the next node over.
+ *
+ * Calling this in a loop will traverse the DOM depth-first.
+ */
+ _getNextNode: function(node, ignoreSelfAndKids) {
+ // First check for kids if those aren't being ignored
+ if (!ignoreSelfAndKids && node.firstElementChild) {
+ return node.firstElementChild;
+ }
+ // Then for siblings...
+ if (node.nextElementSibling) {
+ return node.nextElementSibling;
+ }
+ // And finally, move up the parent chain *and* find a sibling
+ // (because this is depth-first traversal, we will have already
+ // seen the parent nodes themselves).
+ do {
+ node = node.parentNode;
+ } while (node && !node.nextElementSibling);
+ return node && node.nextElementSibling;
+ },
+
+ // compares second text to first one
+ // 1 = same text, 0 = completely different text
+ // works the way that it splits both texts into words and then finds words that are unique in second text
+ // the result is given by the lower length of unique parts
+ _textSimilarity: function(textA, textB) {
+ var tokensA = textA.toLowerCase().split(this.REGEXPS.tokenize).filter(Boolean);
+ var tokensB = textB.toLowerCase().split(this.REGEXPS.tokenize).filter(Boolean);
+ if (!tokensA.length || !tokensB.length) {
+ return 0;
+ }
+ var uniqTokensB = tokensB.filter(token => !tokensA.includes(token));
+ var distanceB = uniqTokensB.join(" ").length / tokensB.join(" ").length;
+ return 1 - distanceB;
+ },
+
+ _checkByline: function(node, matchString) {
+ if (this._articleByline) {
+ return false;
+ }
+
+ if (node.getAttribute !== undefined) {
+ var rel = node.getAttribute("rel");
+ var itemprop = node.getAttribute("itemprop");
+ }
+
+ if ((rel === "author" || (itemprop && itemprop.indexOf("author") !== -1) || this.REGEXPS.byline.test(matchString)) && this._isValidByline(node.textContent)) {
+ this._articleByline = node.textContent.trim();
+ return true;
+ }
+
+ return false;
+ },
+
+ _getNodeAncestors: function(node, maxDepth) {
+ maxDepth = maxDepth || 0;
+ var i = 0, ancestors = [];
+ while (node.parentNode) {
+ ancestors.push(node.parentNode);
+ if (maxDepth && ++i === maxDepth)
+ break;
+ node = node.parentNode;
+ }
+ return ancestors;
+ },
+
+ /***
+ * grabArticle - Using a variety of metrics (content score, classname, element types), find the content that is
+ * most likely to be the stuff a user wants to read. Then return it wrapped up in a div.
+ *
+ * @param page a document to run upon. Needs to be a full document, complete with body.
+ * @return Element
+ **/
+ _grabArticle: function (page) {
+ this.log("**** grabArticle ****");
+ var doc = this._doc;
+ var isPaging = page !== null;
+ page = page ? page : this._doc.body;
+
+ // We can't grab an article if we don't have a page!
+ if (!page) {
+ this.log("No body found in document. Abort.");
+ return null;
+ }
+
+ var pageCacheHtml = page.innerHTML;
+
+ while (true) {
+ this.log("Starting grabArticle loop");
+ var stripUnlikelyCandidates = this._flagIsActive(this.FLAG_STRIP_UNLIKELYS);
+
+ // First, node prepping. Trash nodes that look cruddy (like ones with the
+ // class name "comment", etc), and turn divs into P tags where they have been
+ // used inappropriately (as in, where they contain no other block level elements.)
+ var elementsToScore = [];
+ var node = this._doc.documentElement;
+
+ let shouldRemoveTitleHeader = true;
+
+ while (node) {
+
+ if (node.tagName === "HTML") {
+ this._articleLang = node.getAttribute("lang");
+ }
+
+ var matchString = node.className + " " + node.id;
+
+ if (!this._isProbablyVisible(node)) {
+ this.log("Removing hidden node - " + matchString);
+ node = this._removeAndGetNext(node);
+ continue;
+ }
+
+ // Check to see if this node is a byline, and remove it if it is.
+ if (this._checkByline(node, matchString)) {
+ node = this._removeAndGetNext(node);
+ continue;
+ }
+
+ if (shouldRemoveTitleHeader && this._headerDuplicatesTitle(node)) {
+ this.log("Removing header: ", node.textContent.trim(), this._articleTitle.trim());
+ shouldRemoveTitleHeader = false;
+ node = this._removeAndGetNext(node);
+ continue;
+ }
+
+ // Remove unlikely candidates
+ if (stripUnlikelyCandidates) {
+ if (this.REGEXPS.unlikelyCandidates.test(matchString) &&
+ !this.REGEXPS.okMaybeItsACandidate.test(matchString) &&
+ !this._hasAncestorTag(node, "table") &&
+ !this._hasAncestorTag(node, "code") &&
+ node.tagName !== "BODY" &&
+ node.tagName !== "A") {
+ this.log("Removing unlikely candidate - " + matchString);
+ node = this._removeAndGetNext(node);
+ continue;
+ }
+
+ if (this.UNLIKELY_ROLES.includes(node.getAttribute("role"))) {
+ this.log("Removing content with role " + node.getAttribute("role") + " - " + matchString);
+ node = this._removeAndGetNext(node);
+ continue;
+ }
+ }
+
+ // Remove DIV, SECTION, and HEADER nodes without any content(e.g. text, image, video, or iframe).
+ if ((node.tagName === "DIV" || node.tagName === "SECTION" || node.tagName === "HEADER" ||
+ node.tagName === "H1" || node.tagName === "H2" || node.tagName === "H3" ||
+ node.tagName === "H4" || node.tagName === "H5" || node.tagName === "H6") &&
+ this._isElementWithoutContent(node)) {
+ node = this._removeAndGetNext(node);
+ continue;
+ }
+
+ if (this.DEFAULT_TAGS_TO_SCORE.indexOf(node.tagName) !== -1) {
+ elementsToScore.push(node);
+ }
+
+ // Turn all divs that don't have children block level elements into p's
+ if (node.tagName === "DIV") {
+ // Put phrasing content into paragraphs.
+ var p = null;
+ var childNode = node.firstChild;
+ while (childNode) {
+ var nextSibling = childNode.nextSibling;
+ if (this._isPhrasingContent(childNode)) {
+ if (p !== null) {
+ p.appendChild(childNode);
+ } else if (!this._isWhitespace(childNode)) {
+ p = doc.createElement("p");
+ node.replaceChild(p, childNode);
+ p.appendChild(childNode);
+ }
+ } else if (p !== null) {
+ while (p.lastChild && this._isWhitespace(p.lastChild)) {
+ p.removeChild(p.lastChild);
+ }
+ p = null;
+ }
+ childNode = nextSibling;
+ }
+
+ // Sites like http://mobile.slate.com encloses each paragraph with a DIV
+ // element. DIVs with only a P element inside and no text content can be
+ // safely converted into plain P elements to avoid confusing the scoring
+ // algorithm with DIVs with are, in practice, paragraphs.
+ if (this._hasSingleTagInsideElement(node, "P") && this._getLinkDensity(node) < 0.25) {
+ var newNode = node.children[0];
+ node.parentNode.replaceChild(newNode, node);
+ node = newNode;
+ elementsToScore.push(node);
+ } else if (!this._hasChildBlockElement(node)) {
+ node = this._setNodeTag(node, "P");
+ elementsToScore.push(node);
+ }
+ }
+ node = this._getNextNode(node);
+ }
+
+ /**
+ * Loop through all paragraphs, and assign a score to them based on how content-y they look.
+ * Then add their score to their parent node.
+ *
+ * A score is determined by things like number of commas, class names, etc. Maybe eventually link density.
+ **/
+ var candidates = [];
+ this._forEachNode(elementsToScore, function(elementToScore) {
+ if (!elementToScore.parentNode || typeof(elementToScore.parentNode.tagName) === "undefined")
+ return;
+
+ // If this paragraph is less than 25 characters, don't even count it.
+ var innerText = this._getInnerText(elementToScore);
+ if (innerText.length < 25)
+ return;
+
+ // Exclude nodes with no ancestor.
+ var ancestors = this._getNodeAncestors(elementToScore, 5);
+ if (ancestors.length === 0)
+ return;
+
+ var contentScore = 0;
+
+ // Add a point for the paragraph itself as a base.
+ contentScore += 1;
+
+ // Add points for any commas within this paragraph.
+ contentScore += innerText.split(",").length;
+
+ // For every 100 characters in this paragraph, add another point. Up to 3 points.
+ contentScore += Math.min(Math.floor(innerText.length / 100), 3);
+
+ // Initialize and score ancestors.
+ this._forEachNode(ancestors, function(ancestor, level) {
+ if (!ancestor.tagName || !ancestor.parentNode || typeof(ancestor.parentNode.tagName) === "undefined")
+ return;
+
+ if (typeof(ancestor.readability) === "undefined") {
+ this._initializeNode(ancestor);
+ candidates.push(ancestor);
+ }
+
+ // Node score divider:
+ // - parent: 1 (no division)
+ // - grandparent: 2
+ // - great grandparent+: ancestor level * 3
+ if (level === 0)
+ var scoreDivider = 1;
+ else if (level === 1)
+ scoreDivider = 2;
+ else
+ scoreDivider = level * 3;
+ ancestor.readability.contentScore += contentScore / scoreDivider;
+ });
+ });
+
+ // After we've calculated scores, loop through all of the possible
+ // candidate nodes we found and find the one with the highest score.
+ var topCandidates = [];
+ for (var c = 0, cl = candidates.length; c < cl; c += 1) {
+ var candidate = candidates[c];
+
+ // Scale the final candidates score based on link density. Good content
+ // should have a relatively small link density (5% or less) and be mostly
+ // unaffected by this operation.
+ var candidateScore = candidate.readability.contentScore * (1 - this._getLinkDensity(candidate));
+ candidate.readability.contentScore = candidateScore;
+
+ this.log("Candidate:", candidate, "with score " + candidateScore);
+
+ for (var t = 0; t < this._nbTopCandidates; t++) {
+ var aTopCandidate = topCandidates[t];
+
+ if (!aTopCandidate || candidateScore > aTopCandidate.readability.contentScore) {
+ topCandidates.splice(t, 0, candidate);
+ if (topCandidates.length > this._nbTopCandidates)
+ topCandidates.pop();
+ break;
+ }
+ }
+ }
+
+ var topCandidate = topCandidates[0] || null;
+ var neededToCreateTopCandidate = false;
+ var parentOfTopCandidate;
+
+ // If we still have no top candidate, just use the body as a last resort.
+ // We also have to copy the body node so it is something we can modify.
+ if (topCandidate === null || topCandidate.tagName === "BODY") {
+ // Move all of the page's children into topCandidate
+ topCandidate = doc.createElement("DIV");
+ neededToCreateTopCandidate = true;
+ // Move everything (not just elements, also text nodes etc.) into the container
+ // so we even include text directly in the body:
+ while (page.firstChild) {
+ this.log("Moving child out:", page.firstChild);
+ topCandidate.appendChild(page.firstChild);
+ }
+
+ page.appendChild(topCandidate);
+
+ this._initializeNode(topCandidate);
+ } else if (topCandidate) {
+ // Find a better top candidate node if it contains (at least three) nodes which belong to `topCandidates` array
+ // and whose scores are quite closed with current `topCandidate` node.
+ var alternativeCandidateAncestors = [];
+ for (var i = 1; i < topCandidates.length; i++) {
+ if (topCandidates[i].readability.contentScore / topCandidate.readability.contentScore >= 0.75) {
+ alternativeCandidateAncestors.push(this._getNodeAncestors(topCandidates[i]));
+ }
+ }
+ var MINIMUM_TOPCANDIDATES = 3;
+ if (alternativeCandidateAncestors.length >= MINIMUM_TOPCANDIDATES) {
+ parentOfTopCandidate = topCandidate.parentNode;
+ while (parentOfTopCandidate.tagName !== "BODY") {
+ var listsContainingThisAncestor = 0;
+ for (var ancestorIndex = 0; ancestorIndex < alternativeCandidateAncestors.length && listsContainingThisAncestor < MINIMUM_TOPCANDIDATES; ancestorIndex++) {
+ listsContainingThisAncestor += Number(alternativeCandidateAncestors[ancestorIndex].includes(parentOfTopCandidate));
+ }
+ if (listsContainingThisAncestor >= MINIMUM_TOPCANDIDATES) {
+ topCandidate = parentOfTopCandidate;
+ break;
+ }
+ parentOfTopCandidate = parentOfTopCandidate.parentNode;
+ }
+ }
+ if (!topCandidate.readability) {
+ this._initializeNode(topCandidate);
+ }
+
+ // Because of our bonus system, parents of candidates might have scores
+ // themselves. They get half of the node. There won't be nodes with higher
+ // scores than our topCandidate, but if we see the score going *up* in the first
+ // few steps up the tree, that's a decent sign that there might be more content
+ // lurking in other places that we want to unify in. The sibling stuff
+ // below does some of that - but only if we've looked high enough up the DOM
+ // tree.
+ parentOfTopCandidate = topCandidate.parentNode;
+ var lastScore = topCandidate.readability.contentScore;
+ // The scores shouldn't get too low.
+ var scoreThreshold = lastScore / 3;
+ while (parentOfTopCandidate.tagName !== "BODY") {
+ if (!parentOfTopCandidate.readability) {
+ parentOfTopCandidate = parentOfTopCandidate.parentNode;
+ continue;
+ }
+ var parentScore = parentOfTopCandidate.readability.contentScore;
+ if (parentScore < scoreThreshold)
+ break;
+ if (parentScore > lastScore) {
+ // Alright! We found a better parent to use.
+ topCandidate = parentOfTopCandidate;
+ break;
+ }
+ lastScore = parentOfTopCandidate.readability.contentScore;
+ parentOfTopCandidate = parentOfTopCandidate.parentNode;
+ }
+
+ // If the top candidate is the only child, use parent instead. This will help sibling
+ // joining logic when adjacent content is actually located in parent's sibling node.
+ parentOfTopCandidate = topCandidate.parentNode;
+ while (parentOfTopCandidate.tagName != "BODY" && parentOfTopCandidate.children.length == 1) {
+ topCandidate = parentOfTopCandidate;
+ parentOfTopCandidate = topCandidate.parentNode;
+ }
+ if (!topCandidate.readability) {
+ this._initializeNode(topCandidate);
+ }
+ }
+
+ // Now that we have the top candidate, look through its siblings for content
+ // that might also be related. Things like preambles, content split by ads
+ // that we removed, etc.
+ var articleContent = doc.createElement("DIV");
+ if (isPaging)
+ articleContent.id = "readability-content";
+
+ var siblingScoreThreshold = Math.max(10, topCandidate.readability.contentScore * 0.2);
+ // Keep potential top candidate's parent node to try to get text direction of it later.
+ parentOfTopCandidate = topCandidate.parentNode;
+ var siblings = parentOfTopCandidate.children;
+
+ for (var s = 0, sl = siblings.length; s < sl; s++) {
+ var sibling = siblings[s];
+ var append = false;
+
+ this.log("Looking at sibling node:", sibling, sibling.readability ? ("with score " + sibling.readability.contentScore) : "");
+ this.log("Sibling has score", sibling.readability ? sibling.readability.contentScore : "Unknown");
+
+ if (sibling === topCandidate) {
+ append = true;
+ } else {
+ var contentBonus = 0;
+
+ // Give a bonus if sibling nodes and top candidates have the example same classname
+ if (sibling.className === topCandidate.className && topCandidate.className !== "")
+ contentBonus += topCandidate.readability.contentScore * 0.2;
+
+ if (sibling.readability &&
+ ((sibling.readability.contentScore + contentBonus) >= siblingScoreThreshold)) {
+ append = true;
+ } else if (sibling.nodeName === "P") {
+ var linkDensity = this._getLinkDensity(sibling);
+ var nodeContent = this._getInnerText(sibling);
+ var nodeLength = nodeContent.length;
+
+ if (nodeLength > 80 && linkDensity < 0.25) {
+ append = true;
+ } else if (nodeLength < 80 && nodeLength > 0 && linkDensity === 0 &&
+ nodeContent.search(/\.( |$)/) !== -1) {
+ append = true;
+ }
+ }
+ }
+
+ if (append) {
+ this.log("Appending node:", sibling);
+
+ if (this.ALTER_TO_DIV_EXCEPTIONS.indexOf(sibling.nodeName) === -1) {
+ // We have a node that isn't a common block level element, like a form or td tag.
+ // Turn it into a div so it doesn't get filtered out later by accident.
+ this.log("Altering sibling:", sibling, "to div.");
+
+ sibling = this._setNodeTag(sibling, "DIV");
+ }
+
+ articleContent.appendChild(sibling);
+ // Fetch children again to make it compatible
+ // with DOM parsers without live collection support.
+ siblings = parentOfTopCandidate.children;
+ // siblings is a reference to the children array, and
+ // sibling is removed from the array when we call appendChild().
+ // As a result, we must revisit this index since the nodes
+ // have been shifted.
+ s -= 1;
+ sl -= 1;
+ }
+ }
+
+ if (this._debug)
+ this.log("Article content pre-prep: " + articleContent.innerHTML);
+ // So we have all of the content that we need. Now we clean it up for presentation.
+ this._prepArticle(articleContent);
+ if (this._debug)
+ this.log("Article content post-prep: " + articleContent.innerHTML);
+
+ if (neededToCreateTopCandidate) {
+ // We already created a fake div thing, and there wouldn't have been any siblings left
+ // for the previous loop, so there's no point trying to create a new div, and then
+ // move all the children over. Just assign IDs and class names here. No need to append
+ // because that already happened anyway.
+ topCandidate.id = "readability-page-1";
+ topCandidate.className = "page";
+ } else {
+ var div = doc.createElement("DIV");
+ div.id = "readability-page-1";
+ div.className = "page";
+ while (articleContent.firstChild) {
+ div.appendChild(articleContent.firstChild);
+ }
+ articleContent.appendChild(div);
+ }
+
+ if (this._debug)
+ this.log("Article content after paging: " + articleContent.innerHTML);
+
+ var parseSuccessful = true;
+
+ // Now that we've gone through the full algorithm, check to see if
+ // we got any meaningful content. If we didn't, we may need to re-run
+ // grabArticle with different flags set. This gives us a higher likelihood of
+ // finding the content, and the sieve approach gives us a higher likelihood of
+ // finding the -right- content.
+ var textLength = this._getInnerText(articleContent, true).length;
+ if (textLength < this._charThreshold) {
+ parseSuccessful = false;
+ page.innerHTML = pageCacheHtml;
+
+ if (this._flagIsActive(this.FLAG_STRIP_UNLIKELYS)) {
+ this._removeFlag(this.FLAG_STRIP_UNLIKELYS);
+ this._attempts.push({articleContent: articleContent, textLength: textLength});
+ } else if (this._flagIsActive(this.FLAG_WEIGHT_CLASSES)) {
+ this._removeFlag(this.FLAG_WEIGHT_CLASSES);
+ this._attempts.push({articleContent: articleContent, textLength: textLength});
+ } else if (this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY)) {
+ this._removeFlag(this.FLAG_CLEAN_CONDITIONALLY);
+ this._attempts.push({articleContent: articleContent, textLength: textLength});
+ } else {
+ this._attempts.push({articleContent: articleContent, textLength: textLength});
+ // No luck after removing flags, just return the longest text we found during the different loops
+ this._attempts.sort(function (a, b) {
+ return b.textLength - a.textLength;
+ });
+
+ // But first check if we actually have something
+ if (!this._attempts[0].textLength) {
+ return null;
+ }
+
+ articleContent = this._attempts[0].articleContent;
+ parseSuccessful = true;
+ }
+ }
+
+ if (parseSuccessful) {
+ // Find out text direction from ancestors of final top candidate.
+ var ancestors = [parentOfTopCandidate, topCandidate].concat(this._getNodeAncestors(parentOfTopCandidate));
+ this._someNode(ancestors, function(ancestor) {
+ if (!ancestor.tagName)
+ return false;
+ var articleDir = ancestor.getAttribute("dir");
+ if (articleDir) {
+ this._articleDir = articleDir;
+ return true;
+ }
+ return false;
+ });
+ return articleContent;
+ }
+ }
+ },
+
+ /**
+ * Check whether the input string could be a byline.
+ * This verifies that the input is a string, and that the length
+ * is less than 100 chars.
+ *
+ * @param possibleByline {string} - a string to check whether its a byline.
+ * @return Boolean - whether the input string is a byline.
+ */
+ _isValidByline: function(byline) {
+ if (typeof byline == "string" || byline instanceof String) {
+ byline = byline.trim();
+ return (byline.length > 0) && (byline.length < 100);
+ }
+ return false;
+ },
+
+ /**
+ * Converts some of the common HTML entities in string to their corresponding characters.
+ *
+ * @param str {string} - a string to unescape.
+ * @return string without HTML entity.
+ */
+ _unescapeHtmlEntities: function(str) {
+ if (!str) {
+ return str;
+ }
+
+ var htmlEscapeMap = this.HTML_ESCAPE_MAP;
+ return str.replace(/&(quot|amp|apos|lt|gt);/g, function(_, tag) {
+ return htmlEscapeMap[tag];
+ }).replace(/(?:x([0-9a-z]{1,4})|([0-9]{1,4}));/gi, function(_, hex, numStr) {
+ var num = parseInt(hex || numStr, hex ? 16 : 10);
+ return String.fromCharCode(num);
+ });
+ },
+
+ /**
+ * Try to extract metadata from JSON-LD object.
+ * For now, only Schema.org objects of type Article or its subtypes are supported.
+ * @return Object with any metadata that could be extracted (possibly none)
+ */
+ _getJSONLD: function (doc) {
+ var scripts = this._getAllNodesWithTag(doc, ["script"]);
+
+ var metadata;
+
+ this._forEachNode(scripts, function(jsonLdElement) {
+ if (!metadata && jsonLdElement.getAttribute("type") === "application/ld+json") {
+ try {
+ // Strip CDATA markers if present
+ var content = jsonLdElement.textContent.replace(/^\s*\s*$/g, "");
+ var parsed = JSON.parse(content);
+ if (
+ !parsed["@context"] ||
+ !parsed["@context"].match(/^https?\:\/\/schema\.org$/)
+ ) {
+ return;
+ }
+
+ if (!parsed["@type"] && Array.isArray(parsed["@graph"])) {
+ parsed = parsed["@graph"].find(function(it) {
+ return (it["@type"] || "").match(
+ this.REGEXPS.jsonLdArticleTypes
+ );
+ });
+ }
+
+ if (
+ !parsed ||
+ !parsed["@type"] ||
+ !parsed["@type"].match(this.REGEXPS.jsonLdArticleTypes)
+ ) {
+ return;
+ }
+
+ metadata = {};
+
+ if (typeof parsed.name === "string" && typeof parsed.headline === "string" && parsed.name !== parsed.headline) {
+ // we have both name and headline element in the JSON-LD. They should both be the same but some websites like aktualne.cz
+ // put their own name into "name" and the article title to "headline" which confuses Readability. So we try to check if either
+ // "name" or "headline" closely matches the html title, and if so, use that one. If not, then we use "name" by default.
+
+ var title = this._getArticleTitle();
+ var nameMatches = this._textSimilarity(parsed.name, title) > 0.75;
+ var headlineMatches = this._textSimilarity(parsed.headline, title) > 0.75;
+
+ if (headlineMatches && !nameMatches) {
+ metadata.title = parsed.headline;
+ } else {
+ metadata.title = parsed.name;
+ }
+ } else if (typeof parsed.name === "string") {
+ metadata.title = parsed.name.trim();
+ } else if (typeof parsed.headline === "string") {
+ metadata.title = parsed.headline.trim();
+ }
+ if (parsed.author) {
+ if (typeof parsed.author.name === "string") {
+ metadata.byline = parsed.author.name.trim();
+ } else if (Array.isArray(parsed.author) && parsed.author[0] && typeof parsed.author[0].name === "string") {
+ metadata.byline = parsed.author
+ .filter(function(author) {
+ return author && typeof author.name === "string";
+ })
+ .map(function(author) {
+ return author.name.trim();
+ })
+ .join(", ");
+ }
+ }
+ if (typeof parsed.description === "string") {
+ metadata.excerpt = parsed.description.trim();
+ }
+ if (
+ parsed.publisher &&
+ typeof parsed.publisher.name === "string"
+ ) {
+ metadata.siteName = parsed.publisher.name.trim();
+ }
+ return;
+ } catch (err) {
+ this.log(err.message);
+ }
+ }
+ });
+ return metadata ? metadata : {};
+ },
+
+ /**
+ * Attempts to get excerpt and byline metadata for the article.
+ *
+ * @param {Object} jsonld — object containing any metadata that
+ * could be extracted from JSON-LD object.
+ *
+ * @return Object with optional "excerpt" and "byline" properties
+ */
+ _getArticleMetadata: function(jsonld) {
+ var metadata = {};
+ var values = {};
+ var metaElements = this._doc.getElementsByTagName("meta");
+
+ // property is a space-separated list of values
+ var propertyPattern = /\s*(dc|dcterm|og|twitter)\s*:\s*(author|creator|description|title|site_name)\s*/gi;
+
+ // name is a single value
+ var namePattern = /^\s*(?:(dc|dcterm|og|twitter|weibo:(article|webpage))\s*[\.:]\s*)?(author|creator|description|title|site_name)\s*$/i;
+
+ // Find description tags.
+ this._forEachNode(metaElements, function(element) {
+ var elementName = element.getAttribute("name");
+ var elementProperty = element.getAttribute("property");
+ var content = element.getAttribute("content");
+ if (!content) {
+ return;
+ }
+ var matches = null;
+ var name = null;
+
+ if (elementProperty) {
+ matches = elementProperty.match(propertyPattern);
+ if (matches) {
+ // Convert to lowercase, and remove any whitespace
+ // so we can match below.
+ name = matches[0].toLowerCase().replace(/\s/g, "");
+ // multiple authors
+ values[name] = content.trim();
+ }
+ }
+ if (!matches && elementName && namePattern.test(elementName)) {
+ name = elementName;
+ if (content) {
+ // Convert to lowercase, remove any whitespace, and convert dots
+ // to colons so we can match below.
+ name = name.toLowerCase().replace(/\s/g, "").replace(/\./g, ":");
+ values[name] = content.trim();
+ }
+ }
+ });
+
+ // get title
+ metadata.title = jsonld.title ||
+ values["dc:title"] ||
+ values["dcterm:title"] ||
+ values["og:title"] ||
+ values["weibo:article:title"] ||
+ values["weibo:webpage:title"] ||
+ values["title"] ||
+ values["twitter:title"];
+
+ if (!metadata.title) {
+ metadata.title = this._getArticleTitle();
+ }
+
+ // get author
+ metadata.byline = jsonld.byline ||
+ values["dc:creator"] ||
+ values["dcterm:creator"] ||
+ values["author"];
+
+ // get description
+ metadata.excerpt = jsonld.excerpt ||
+ values["dc:description"] ||
+ values["dcterm:description"] ||
+ values["og:description"] ||
+ values["weibo:article:description"] ||
+ values["weibo:webpage:description"] ||
+ values["description"] ||
+ values["twitter:description"];
+
+ // get site name
+ metadata.siteName = jsonld.siteName ||
+ values["og:site_name"];
+
+ // in many sites the meta value is escaped with HTML entities,
+ // so here we need to unescape it
+ metadata.title = this._unescapeHtmlEntities(metadata.title);
+ metadata.byline = this._unescapeHtmlEntities(metadata.byline);
+ metadata.excerpt = this._unescapeHtmlEntities(metadata.excerpt);
+ metadata.siteName = this._unescapeHtmlEntities(metadata.siteName);
+
+ return metadata;
+ },
+
+ /**
+ * Check if node is image, or if node contains exactly only one image
+ * whether as a direct child or as its descendants.
+ *
+ * @param Element
+ **/
+ _isSingleImage: function(node) {
+ if (node.tagName === "IMG") {
+ return true;
+ }
+
+ if (node.children.length !== 1 || node.textContent.trim() !== "") {
+ return false;
+ }
+
+ return this._isSingleImage(node.children[0]);
+ },
+
+ /**
+ * Find all that are located after nodes, and which contain only one
+ * element. Replace the first image with the image from inside the tag,
+ * and remove the tag. This improves the quality of the images we use on
+ * some sites (e.g. Medium).
+ *
+ * @param Element
+ **/
+ _unwrapNoscriptImages: function(doc) {
+ // Find img without source or attributes that might contains image, and remove it.
+ // This is done to prevent a placeholder img is replaced by img from noscript in next step.
+ var imgs = Array.from(doc.getElementsByTagName("img"));
+ this._forEachNode(imgs, function(img) {
+ for (var i = 0; i < img.attributes.length; i++) {
+ var attr = img.attributes[i];
+ switch (attr.name) {
+ case "src":
+ case "srcset":
+ case "data-src":
+ case "data-srcset":
+ return;
+ }
+
+ if (/\.(jpg|jpeg|png|webp)/i.test(attr.value)) {
+ return;
+ }
+ }
+
+ img.parentNode.removeChild(img);
+ });
+
+ // Next find noscript and try to extract its image
+ var noscripts = Array.from(doc.getElementsByTagName("noscript"));
+ this._forEachNode(noscripts, function(noscript) {
+ // Parse content of noscript and make sure it only contains image
+ var tmp = doc.createElement("div");
+ tmp.innerHTML = noscript.innerHTML;
+ if (!this._isSingleImage(tmp)) {
+ return;
+ }
+
+ // If noscript has previous sibling and it only contains image,
+ // replace it with noscript content. However we also keep old
+ // attributes that might contains image.
+ var prevElement = noscript.previousElementSibling;
+ if (prevElement && this._isSingleImage(prevElement)) {
+ var prevImg = prevElement;
+ if (prevImg.tagName !== "IMG") {
+ prevImg = prevElement.getElementsByTagName("img")[0];
+ }
+
+ var newImg = tmp.getElementsByTagName("img")[0];
+ for (var i = 0; i < prevImg.attributes.length; i++) {
+ var attr = prevImg.attributes[i];
+ if (attr.value === "") {
+ continue;
+ }
+
+ if (attr.name === "src" || attr.name === "srcset" || /\.(jpg|jpeg|png|webp)/i.test(attr.value)) {
+ if (newImg.getAttribute(attr.name) === attr.value) {
+ continue;
+ }
+
+ var attrName = attr.name;
+ if (newImg.hasAttribute(attrName)) {
+ attrName = "data-old-" + attrName;
+ }
+
+ newImg.setAttribute(attrName, attr.value);
+ }
+ }
+
+ noscript.parentNode.replaceChild(tmp.firstElementChild, prevElement);
+ }
+ });
+ },
+
+ /**
+ * Removes script tags from the document.
+ *
+ * @param Element
+ **/
+ _removeScripts: function(doc) {
+ this._removeNodes(this._getAllNodesWithTag(doc, ["script"]), function(scriptNode) {
+ scriptNode.nodeValue = "";
+ scriptNode.removeAttribute("src");
+ return true;
+ });
+ this._removeNodes(this._getAllNodesWithTag(doc, ["noscript"]));
+ },
+
+ /**
+ * Check if this node has only whitespace and a single element with given tag
+ * Returns false if the DIV node contains non-empty text nodes
+ * or if it contains no element with given tag or more than 1 element.
+ *
+ * @param Element
+ * @param string tag of child element
+ **/
+ _hasSingleTagInsideElement: function(element, tag) {
+ // There should be exactly 1 element child with given tag
+ if (element.children.length != 1 || element.children[0].tagName !== tag) {
+ return false;
+ }
+
+ // And there should be no text nodes with real content
+ return !this._someNode(element.childNodes, function(node) {
+ return node.nodeType === this.TEXT_NODE &&
+ this.REGEXPS.hasContent.test(node.textContent);
+ });
+ },
+
+ _isElementWithoutContent: function(node) {
+ return node.nodeType === this.ELEMENT_NODE &&
+ node.textContent.trim().length == 0 &&
+ (node.children.length == 0 ||
+ node.children.length == node.getElementsByTagName("br").length + node.getElementsByTagName("hr").length);
+ },
+
+ /**
+ * Determine whether element has any children block level elements.
+ *
+ * @param Element
+ */
+ _hasChildBlockElement: function (element) {
+ return this._someNode(element.childNodes, function(node) {
+ return this.DIV_TO_P_ELEMS.has(node.tagName) ||
+ this._hasChildBlockElement(node);
+ });
+ },
+
+ /***
+ * Determine if a node qualifies as phrasing content.
+ * https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
+ **/
+ _isPhrasingContent: function(node) {
+ return node.nodeType === this.TEXT_NODE || this.PHRASING_ELEMS.indexOf(node.tagName) !== -1 ||
+ ((node.tagName === "A" || node.tagName === "DEL" || node.tagName === "INS") &&
+ this._everyNode(node.childNodes, this._isPhrasingContent));
+ },
+
+ _isWhitespace: function(node) {
+ return (node.nodeType === this.TEXT_NODE && node.textContent.trim().length === 0) ||
+ (node.nodeType === this.ELEMENT_NODE && node.tagName === "BR");
+ },
+
+ /**
+ * Get the inner text of a node - cross browser compatibly.
+ * This also strips out any excess whitespace to be found.
+ *
+ * @param Element
+ * @param Boolean normalizeSpaces (default: true)
+ * @return string
+ **/
+ _getInnerText: function(e, normalizeSpaces) {
+ normalizeSpaces = (typeof normalizeSpaces === "undefined") ? true : normalizeSpaces;
+ var textContent = e.textContent.trim();
+
+ if (normalizeSpaces) {
+ return textContent.replace(this.REGEXPS.normalize, " ");
+ }
+ return textContent;
+ },
+
+ /**
+ * Get the number of times a string s appears in the node e.
+ *
+ * @param Element
+ * @param string - what to split on. Default is ","
+ * @return number (integer)
+ **/
+ _getCharCount: function(e, s) {
+ s = s || ",";
+ return this._getInnerText(e).split(s).length - 1;
+ },
+
+ /**
+ * Remove the style attribute on every e and under.
+ * TODO: Test if getElementsByTagName(*) is faster.
+ *
+ * @param Element
+ * @return void
+ **/
+ _cleanStyles: function(e) {
+ if (!e || e.tagName.toLowerCase() === "svg")
+ return;
+
+ // Remove `style` and deprecated presentational attributes
+ for (var i = 0; i < this.PRESENTATIONAL_ATTRIBUTES.length; i++) {
+ e.removeAttribute(this.PRESENTATIONAL_ATTRIBUTES[i]);
+ }
+
+ if (this.DEPRECATED_SIZE_ATTRIBUTE_ELEMS.indexOf(e.tagName) !== -1) {
+ e.removeAttribute("width");
+ e.removeAttribute("height");
+ }
+
+ var cur = e.firstElementChild;
+ while (cur !== null) {
+ this._cleanStyles(cur);
+ cur = cur.nextElementSibling;
+ }
+ },
+
+ /**
+ * Get the density of links as a percentage of the content
+ * This is the amount of text that is inside a link divided by the total text in the node.
+ *
+ * @param Element
+ * @return number (float)
+ **/
+ _getLinkDensity: function(element) {
+ var textLength = this._getInnerText(element).length;
+ if (textLength === 0)
+ return 0;
+
+ var linkLength = 0;
+
+ // XXX implement _reduceNodeList?
+ this._forEachNode(element.getElementsByTagName("a"), function(linkNode) {
+ var href = linkNode.getAttribute("href");
+ var coefficient = href && this.REGEXPS.hashUrl.test(href) ? 0.3 : 1;
+ linkLength += this._getInnerText(linkNode).length * coefficient;
+ });
+
+ return linkLength / textLength;
+ },
+
+ /**
+ * Get an elements class/id weight. Uses regular expressions to tell if this
+ * element looks good or bad.
+ *
+ * @param Element
+ * @return number (Integer)
+ **/
+ _getClassWeight: function(e) {
+ if (!this._flagIsActive(this.FLAG_WEIGHT_CLASSES))
+ return 0;
+
+ var weight = 0;
+
+ // Look for a special classname
+ if (typeof(e.className) === "string" && e.className !== "") {
+ if (this.REGEXPS.negative.test(e.className))
+ weight -= 25;
+
+ if (this.REGEXPS.positive.test(e.className))
+ weight += 25;
+ }
+
+ // Look for a special ID
+ if (typeof(e.id) === "string" && e.id !== "") {
+ if (this.REGEXPS.negative.test(e.id))
+ weight -= 25;
+
+ if (this.REGEXPS.positive.test(e.id))
+ weight += 25;
+ }
+
+ return weight;
+ },
+
+ /**
+ * Clean a node of all elements of type "tag".
+ * (Unless it's a youtube/vimeo video. People love movies.)
+ *
+ * @param Element
+ * @param string tag to clean
+ * @return void
+ **/
+ _clean: function(e, tag) {
+ var isEmbed = ["object", "embed", "iframe"].indexOf(tag) !== -1;
+
+ this._removeNodes(this._getAllNodesWithTag(e, [tag]), function(element) {
+ // Allow youtube and vimeo videos through as people usually want to see those.
+ if (isEmbed) {
+ // First, check the elements attributes to see if any of them contain youtube or vimeo
+ for (var i = 0; i < element.attributes.length; i++) {
+ if (this.REGEXPS.videos.test(element.attributes[i].value)) {
+ return false;
+ }
+ }
+
+ // For embed with tag, check inner HTML as well.
+ if (element.tagName === "object" && this.REGEXPS.videos.test(element.innerHTML)) {
+ return false;
+ }
+ }
+
+ return true;
+ });
+ },
+
+ /**
+ * Check if a given node has one of its ancestor tag name matching the
+ * provided one.
+ * @param HTMLElement node
+ * @param String tagName
+ * @param Number maxDepth
+ * @param Function filterFn a filter to invoke to determine whether this node 'counts'
+ * @return Boolean
+ */
+ _hasAncestorTag: function(node, tagName, maxDepth, filterFn) {
+ maxDepth = maxDepth || 3;
+ tagName = tagName.toUpperCase();
+ var depth = 0;
+ while (node.parentNode) {
+ if (maxDepth > 0 && depth > maxDepth)
+ return false;
+ if (node.parentNode.tagName === tagName && (!filterFn || filterFn(node.parentNode)))
+ return true;
+ node = node.parentNode;
+ depth++;
+ }
+ return false;
+ },
+
+ /**
+ * Return an object indicating how many rows and columns this table has.
+ */
+ _getRowAndColumnCount: function(table) {
+ var rows = 0;
+ var columns = 0;
+ var trs = table.getElementsByTagName("tr");
+ for (var i = 0; i < trs.length; i++) {
+ var rowspan = trs[i].getAttribute("rowspan") || 0;
+ if (rowspan) {
+ rowspan = parseInt(rowspan, 10);
+ }
+ rows += (rowspan || 1);
+
+ // Now look for column-related info
+ var columnsInThisRow = 0;
+ var cells = trs[i].getElementsByTagName("td");
+ for (var j = 0; j < cells.length; j++) {
+ var colspan = cells[j].getAttribute("colspan") || 0;
+ if (colspan) {
+ colspan = parseInt(colspan, 10);
+ }
+ columnsInThisRow += (colspan || 1);
+ }
+ columns = Math.max(columns, columnsInThisRow);
+ }
+ return {rows: rows, columns: columns};
+ },
+
+ /**
+ * Look for 'data' (as opposed to 'layout') tables, for which we use
+ * similar checks as
+ * https://searchfox.org/mozilla-central/rev/f82d5c549f046cb64ce5602bfd894b7ae807c8f8/accessible/generic/TableAccessible.cpp#19
+ */
+ _markDataTables: function(root) {
+ var tables = root.getElementsByTagName("table");
+ for (var i = 0; i < tables.length; i++) {
+ var table = tables[i];
+ var role = table.getAttribute("role");
+ if (role == "presentation") {
+ table._readabilityDataTable = false;
+ continue;
+ }
+ var datatable = table.getAttribute("datatable");
+ if (datatable == "0") {
+ table._readabilityDataTable = false;
+ continue;
+ }
+ var summary = table.getAttribute("summary");
+ if (summary) {
+ table._readabilityDataTable = true;
+ continue;
+ }
+
+ var caption = table.getElementsByTagName("caption")[0];
+ if (caption && caption.childNodes.length > 0) {
+ table._readabilityDataTable = true;
+ continue;
+ }
+
+ // If the table has a descendant with any of these tags, consider a data table:
+ var dataTableDescendants = ["col", "colgroup", "tfoot", "thead", "th"];
+ var descendantExists = function(tag) {
+ return !!table.getElementsByTagName(tag)[0];
+ };
+ if (dataTableDescendants.some(descendantExists)) {
+ this.log("Data table because found data-y descendant");
+ table._readabilityDataTable = true;
+ continue;
+ }
+
+ // Nested tables indicate a layout table:
+ if (table.getElementsByTagName("table")[0]) {
+ table._readabilityDataTable = false;
+ continue;
+ }
+
+ var sizeInfo = this._getRowAndColumnCount(table);
+ if (sizeInfo.rows >= 10 || sizeInfo.columns > 4) {
+ table._readabilityDataTable = true;
+ continue;
+ }
+ // Now just go by size entirely:
+ table._readabilityDataTable = sizeInfo.rows * sizeInfo.columns > 10;
+ }
+ },
+
+ /* convert images and figures that have properties like data-src into images that can be loaded without JS */
+ _fixLazyImages: function (root) {
+ this._forEachNode(this._getAllNodesWithTag(root, ["img", "picture", "figure"]), function (elem) {
+ // In some sites (e.g. Kotaku), they put 1px square image as base64 data uri in the src attribute.
+ // So, here we check if the data uri is too short, just might as well remove it.
+ if (elem.src && this.REGEXPS.b64DataUrl.test(elem.src)) {
+ // Make sure it's not SVG, because SVG can have a meaningful image in under 133 bytes.
+ var parts = this.REGEXPS.b64DataUrl.exec(elem.src);
+ if (parts[1] === "image/svg+xml") {
+ return;
+ }
+
+ // Make sure this element has other attributes which contains image.
+ // If it doesn't, then this src is important and shouldn't be removed.
+ var srcCouldBeRemoved = false;
+ for (var i = 0; i < elem.attributes.length; i++) {
+ var attr = elem.attributes[i];
+ if (attr.name === "src") {
+ continue;
+ }
+
+ if (/\.(jpg|jpeg|png|webp)/i.test(attr.value)) {
+ srcCouldBeRemoved = true;
+ break;
+ }
+ }
+
+ // Here we assume if image is less than 100 bytes (or 133B after encoded to base64)
+ // it will be too small, therefore it might be placeholder image.
+ if (srcCouldBeRemoved) {
+ var b64starts = elem.src.search(/base64\s*/i) + 7;
+ var b64length = elem.src.length - b64starts;
+ if (b64length < 133) {
+ elem.removeAttribute("src");
+ }
+ }
+ }
+
+ // also check for "null" to work around https://github.com/jsdom/jsdom/issues/2580
+ if ((elem.src || (elem.srcset && elem.srcset != "null")) && elem.className.toLowerCase().indexOf("lazy") === -1) {
+ return;
+ }
+
+ for (var j = 0; j < elem.attributes.length; j++) {
+ attr = elem.attributes[j];
+ if (attr.name === "src" || attr.name === "srcset" || attr.name === "alt") {
+ continue;
+ }
+ var copyTo = null;
+ if (/\.(jpg|jpeg|png|webp)\s+\d/.test(attr.value)) {
+ copyTo = "srcset";
+ } else if (/^\s*\S+\.(jpg|jpeg|png|webp)\S*\s*$/.test(attr.value)) {
+ copyTo = "src";
+ }
+ if (copyTo) {
+ //if this is an img or picture, set the attribute directly
+ if (elem.tagName === "IMG" || elem.tagName === "PICTURE") {
+ elem.setAttribute(copyTo, attr.value);
+ } else if (elem.tagName === "FIGURE" && !this._getAllNodesWithTag(elem, ["img", "picture"]).length) {
+ //if the item is a that does not contain an image or picture, create one and place it inside the figure
+ //see the nytimes-3 testcase for an example
+ var img = this._doc.createElement("img");
+ img.setAttribute(copyTo, attr.value);
+ elem.appendChild(img);
+ }
+ }
+ }
+ });
+ },
+
+ _getTextDensity: function(e, tags) {
+ var textLength = this._getInnerText(e, true).length;
+ if (textLength === 0) {
+ return 0;
+ }
+ var childrenLength = 0;
+ var children = this._getAllNodesWithTag(e, tags);
+ this._forEachNode(children, (child) => childrenLength += this._getInnerText(child, true).length);
+ return childrenLength / textLength;
+ },
+
+ /**
+ * Clean an element of all tags of type "tag" if they look fishy.
+ * "Fishy" is an algorithm based on content length, classnames, link density, number of images & embeds, etc.
+ *
+ * @return void
+ **/
+ _cleanConditionally: function(e, tag) {
+ if (!this._flagIsActive(this.FLAG_CLEAN_CONDITIONALLY))
+ return;
+
+ // Gather counts for other typical elements embedded within.
+ // Traverse backwards so we can remove nodes at the same time
+ // without effecting the traversal.
+ //
+ // TODO: Consider taking into account original contentScore here.
+ this._removeNodes(this._getAllNodesWithTag(e, [tag]), function(node) {
+ // First check if this node IS data table, in which case don't remove it.
+ var isDataTable = function(t) {
+ return t._readabilityDataTable;
+ };
+
+ var isList = tag === "ul" || tag === "ol";
+ if (!isList) {
+ var listLength = 0;
+ var listNodes = this._getAllNodesWithTag(node, ["ul", "ol"]);
+ this._forEachNode(listNodes, (list) => listLength += this._getInnerText(list).length);
+ isList = listLength / this._getInnerText(node).length > 0.9;
+ }
+
+ if (tag === "table" && isDataTable(node)) {
+ return false;
+ }
+
+ // Next check if we're inside a data table, in which case don't remove it as well.
+ if (this._hasAncestorTag(node, "table", -1, isDataTable)) {
+ return false;
+ }
+
+ if (this._hasAncestorTag(node, "code")) {
+ return false;
+ }
+
+ var weight = this._getClassWeight(node);
+
+ this.log("Cleaning Conditionally", node);
+
+ var contentScore = 0;
+
+ if (weight + contentScore < 0) {
+ return true;
+ }
+
+ if (this._getCharCount(node, ",") < 10) {
+ // If there are not very many commas, and the number of
+ // non-paragraph elements is more than paragraphs or other
+ // ominous signs, remove the element.
+ var p = node.getElementsByTagName("p").length;
+ var img = node.getElementsByTagName("img").length;
+ var li = node.getElementsByTagName("li").length - 100;
+ var input = node.getElementsByTagName("input").length;
+ var headingDensity = this._getTextDensity(node, ["h1", "h2", "h3", "h4", "h5", "h6"]);
+
+ var embedCount = 0;
+ var embeds = this._getAllNodesWithTag(node, ["object", "embed", "iframe"]);
+
+ for (var i = 0; i < embeds.length; i++) {
+ // If this embed has attribute that matches video regex, don't delete it.
+ for (var j = 0; j < embeds[i].attributes.length; j++) {
+ if (this.REGEXPS.videos.test(embeds[i].attributes[j].value)) {
+ return false;
+ }
+ }
+
+ // For embed with tag, check inner HTML as well.
+ if (embeds[i].tagName === "object" && this.REGEXPS.videos.test(embeds[i].innerHTML)) {
+ return false;
+ }
+
+ embedCount++;
+ }
+
+ var linkDensity = this._getLinkDensity(node);
+ var contentLength = this._getInnerText(node).length;
+
+ var haveToRemove =
+ (img > 1 && p / img < 0.5 && !this._hasAncestorTag(node, "figure")) ||
+ (!isList && li > p) ||
+ (input > Math.floor(p/3)) ||
+ (!isList && headingDensity < 0.9 && contentLength < 25 && (img === 0 || img > 2) && !this._hasAncestorTag(node, "figure")) ||
+ (!isList && weight < 25 && linkDensity > 0.2) ||
+ (weight >= 25 && linkDensity > 0.5) ||
+ ((embedCount === 1 && contentLength < 75) || embedCount > 1);
+ return haveToRemove;
+ }
+ return false;
+ });
+ },
+
+ /**
+ * Clean out elements that match the specified conditions
+ *
+ * @param Element
+ * @param Function determines whether a node should be removed
+ * @return void
+ **/
+ _cleanMatchedNodes: function(e, filter) {
+ var endOfSearchMarkerNode = this._getNextNode(e, true);
+ var next = this._getNextNode(e);
+ while (next && next != endOfSearchMarkerNode) {
+ if (filter.call(this, next, next.className + " " + next.id)) {
+ next = this._removeAndGetNext(next);
+ } else {
+ next = this._getNextNode(next);
+ }
+ }
+ },
+
+ /**
+ * Clean out spurious headers from an Element.
+ *
+ * @param Element
+ * @return void
+ **/
+ _cleanHeaders: function(e) {
+ let headingNodes = this._getAllNodesWithTag(e, ["h1", "h2"]);
+ this._removeNodes(headingNodes, function(node) {
+ let shouldRemove = this._getClassWeight(node) < 0;
+ if (shouldRemove) {
+ this.log("Removing header with low class weight:", node);
+ }
+ return shouldRemove;
+ });
+ },
+
+ /**
+ * Check if this node is an H1 or H2 element whose content is mostly
+ * the same as the article title.
+ *
+ * @param Element the node to check.
+ * @return boolean indicating whether this is a title-like header.
+ */
+ _headerDuplicatesTitle: function(node) {
+ if (node.tagName != "H1" && node.tagName != "H2") {
+ return false;
+ }
+ var heading = this._getInnerText(node, false);
+ this.log("Evaluating similarity of header:", heading, this._articleTitle);
+ return this._textSimilarity(this._articleTitle, heading) > 0.75;
+ },
+
+ _flagIsActive: function(flag) {
+ return (this._flags & flag) > 0;
+ },
+
+ _removeFlag: function(flag) {
+ this._flags = this._flags & ~flag;
+ },
+
+ _isProbablyVisible: function(node) {
+ // Have to null-check node.style and node.className.indexOf to deal with SVG and MathML nodes.
+ return (!node.style || node.style.display != "none")
+ && !node.hasAttribute("hidden")
+ //check for "fallback-image" so that wikimedia math images are displayed
+ && (!node.hasAttribute("aria-hidden") || node.getAttribute("aria-hidden") != "true" || (node.className && node.className.indexOf && node.className.indexOf("fallback-image") !== -1));
+ },
+
+ /**
+ * Runs readability.
+ *
+ * Workflow:
+ * 1. Prep the document by removing script tags, css, etc.
+ * 2. Build readability's DOM tree.
+ * 3. Grab the article content from the current dom tree.
+ * 4. Replace the current DOM tree with the new one.
+ * 5. Read peacefully.
+ *
+ * @return void
+ **/
+ parse: function () {
+ // Avoid parsing too large documents, as per configuration option
+ if (this._maxElemsToParse > 0) {
+ var numTags = this._doc.getElementsByTagName("*").length;
+ if (numTags > this._maxElemsToParse) {
+ throw new Error("Aborting parsing document; " + numTags + " elements found");
+ }
+ }
+
+ // Unwrap image from noscript
+ this._unwrapNoscriptImages(this._doc);
+
+ // Extract JSON-LD metadata before removing scripts
+ var jsonLd = this._disableJSONLD ? {} : this._getJSONLD(this._doc);
+
+ // Remove script tags from the document.
+ this._removeScripts(this._doc);
+
+ this._prepDocument();
+
+ var metadata = this._getArticleMetadata(jsonLd);
+ this._articleTitle = metadata.title;
+
+ var articleContent = this._grabArticle();
+ if (!articleContent)
+ return null;
+
+ this.log("Grabbed: " + articleContent.innerHTML);
+
+ this._postProcessContent(articleContent);
+
+ // If we haven't found an excerpt in the article's metadata, use the article's
+ // first paragraph as the excerpt. This is used for displaying a preview of
+ // the article's content.
+ if (!metadata.excerpt) {
+ var paragraphs = articleContent.getElementsByTagName("p");
+ if (paragraphs.length > 0) {
+ metadata.excerpt = paragraphs[0].textContent.trim();
+ }
+ }
+
+ var textContent = articleContent.textContent;
+ return {
+ title: this._articleTitle,
+ byline: metadata.byline || this._articleByline,
+ dir: this._articleDir,
+ lang: this._articleLang,
+ content: this._serializer(articleContent),
+ textContent: textContent,
+ length: textContent.length,
+ excerpt: metadata.excerpt,
+ siteName: metadata.siteName || this._articleSiteName
+ };
+ }
+};
+
+if (typeof module === "object") {
+ module.exports = Readability;
+}
diff --git a/apps/web-clipper/lib/browser-polyfill.js b/apps/web-clipper/lib/browser-polyfill.js
new file mode 100644
index 000000000..c0b5dfd07
--- /dev/null
+++ b/apps/web-clipper/lib/browser-polyfill.js
@@ -0,0 +1,1224 @@
+(function (global, factory) {
+ if (typeof define === "function" && define.amd) {
+ define("webextension-polyfill", ["module"], factory);
+ } else if (typeof exports !== "undefined") {
+ factory(module);
+ } else {
+ var mod = {
+ exports: {}
+ };
+ factory(mod);
+ global.browser = mod.exports;
+ }
+})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (module) {
+ /* webextension-polyfill - v0.6.0 - Mon Dec 23 2019 12:32:53 */
+
+ /* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
+
+ /* vim: set sts=2 sw=2 et tw=80: */
+
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ "use strict";
+
+ if (typeof browser === "undefined" || Object.getPrototypeOf(browser) !== Object.prototype) {
+ const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received.";
+ const SEND_RESPONSE_DEPRECATION_WARNING = "Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)"; // Wrapping the bulk of this polyfill in a one-time-use function is a minor
+ // optimization for Firefox. Since Spidermonkey does not fully parse the
+ // contents of a function until the first time it's called, and since it will
+ // never actually need to be called, this allows the polyfill to be included
+ // in Firefox nearly for free.
+
+ const wrapAPIs = extensionAPIs => {
+ // NOTE: apiMetadata is associated to the content of the api-metadata.json file
+ // at build time by replacing the following "include" with the content of the
+ // JSON file.
+ const apiMetadata = {
+ "alarms": {
+ "clear": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "clearAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "get": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "bookmarks": {
+ "create": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "get": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getChildren": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getRecent": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getSubTree": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getTree": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "move": {
+ "minArgs": 2,
+ "maxArgs": 2
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeTree": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "search": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "update": {
+ "minArgs": 2,
+ "maxArgs": 2
+ }
+ },
+ "browserAction": {
+ "disable": {
+ "minArgs": 0,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "enable": {
+ "minArgs": 0,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "getBadgeBackgroundColor": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getBadgeText": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getPopup": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getTitle": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "openPopup": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "setBadgeBackgroundColor": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "setBadgeText": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "setIcon": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "setPopup": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "setTitle": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ }
+ },
+ "browsingData": {
+ "remove": {
+ "minArgs": 2,
+ "maxArgs": 2
+ },
+ "removeCache": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeCookies": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeDownloads": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeFormData": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeHistory": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeLocalStorage": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removePasswords": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removePluginData": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "settings": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "commands": {
+ "getAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "contextMenus": {
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "update": {
+ "minArgs": 2,
+ "maxArgs": 2
+ }
+ },
+ "cookies": {
+ "get": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getAll": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getAllCookieStores": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "set": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "devtools": {
+ "inspectedWindow": {
+ "eval": {
+ "minArgs": 1,
+ "maxArgs": 2,
+ "singleCallbackArg": false
+ }
+ },
+ "panels": {
+ "create": {
+ "minArgs": 3,
+ "maxArgs": 3,
+ "singleCallbackArg": true
+ }
+ }
+ },
+ "downloads": {
+ "cancel": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "download": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "erase": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getFileIcon": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "open": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "pause": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeFile": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "resume": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "search": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "show": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ }
+ },
+ "extension": {
+ "isAllowedFileSchemeAccess": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "isAllowedIncognitoAccess": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "history": {
+ "addUrl": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "deleteAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "deleteRange": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "deleteUrl": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getVisits": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "search": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "i18n": {
+ "detectLanguage": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getAcceptLanguages": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "identity": {
+ "launchWebAuthFlow": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "idle": {
+ "queryState": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "management": {
+ "get": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "getSelf": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "setEnabled": {
+ "minArgs": 2,
+ "maxArgs": 2
+ },
+ "uninstallSelf": {
+ "minArgs": 0,
+ "maxArgs": 1
+ }
+ },
+ "notifications": {
+ "clear": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "create": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "getAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "getPermissionLevel": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "update": {
+ "minArgs": 2,
+ "maxArgs": 2
+ }
+ },
+ "pageAction": {
+ "getPopup": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getTitle": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "hide": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "setIcon": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "setPopup": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "setTitle": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ },
+ "show": {
+ "minArgs": 1,
+ "maxArgs": 1,
+ "fallbackToNoCallback": true
+ }
+ },
+ "permissions": {
+ "contains": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getAll": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "request": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "runtime": {
+ "getBackgroundPage": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "getPlatformInfo": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "openOptionsPage": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "requestUpdateCheck": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "sendMessage": {
+ "minArgs": 1,
+ "maxArgs": 3
+ },
+ "sendNativeMessage": {
+ "minArgs": 2,
+ "maxArgs": 2
+ },
+ "setUninstallURL": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "sessions": {
+ "getDevices": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getRecentlyClosed": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "restore": {
+ "minArgs": 0,
+ "maxArgs": 1
+ }
+ },
+ "storage": {
+ "local": {
+ "clear": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "get": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getBytesInUse": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "set": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "managed": {
+ "get": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getBytesInUse": {
+ "minArgs": 0,
+ "maxArgs": 1
+ }
+ },
+ "sync": {
+ "clear": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "get": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getBytesInUse": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "set": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ }
+ },
+ "tabs": {
+ "captureVisibleTab": {
+ "minArgs": 0,
+ "maxArgs": 2
+ },
+ "create": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "detectLanguage": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "discard": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "duplicate": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "executeScript": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "get": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getCurrent": {
+ "minArgs": 0,
+ "maxArgs": 0
+ },
+ "getZoom": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getZoomSettings": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "highlight": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "insertCSS": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "move": {
+ "minArgs": 2,
+ "maxArgs": 2
+ },
+ "query": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "reload": {
+ "minArgs": 0,
+ "maxArgs": 2
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "removeCSS": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "sendMessage": {
+ "minArgs": 2,
+ "maxArgs": 3
+ },
+ "setZoom": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "setZoomSettings": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "update": {
+ "minArgs": 1,
+ "maxArgs": 2
+ }
+ },
+ "topSites": {
+ "get": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "webNavigation": {
+ "getAllFrames": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "getFrame": {
+ "minArgs": 1,
+ "maxArgs": 1
+ }
+ },
+ "webRequest": {
+ "handlerBehaviorChanged": {
+ "minArgs": 0,
+ "maxArgs": 0
+ }
+ },
+ "windows": {
+ "create": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "get": {
+ "minArgs": 1,
+ "maxArgs": 2
+ },
+ "getAll": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getCurrent": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "getLastFocused": {
+ "minArgs": 0,
+ "maxArgs": 1
+ },
+ "remove": {
+ "minArgs": 1,
+ "maxArgs": 1
+ },
+ "update": {
+ "minArgs": 2,
+ "maxArgs": 2
+ }
+ }
+ };
+
+ if (Object.keys(apiMetadata).length === 0) {
+ throw new Error("api-metadata.json has not been included in browser-polyfill");
+ }
+ /**
+ * A WeakMap subclass which creates and stores a value for any key which does
+ * not exist when accessed, but behaves exactly as an ordinary WeakMap
+ * otherwise.
+ *
+ * @param {function} createItem
+ * A function which will be called in order to create the value for any
+ * key which does not exist, the first time it is accessed. The
+ * function receives, as its only argument, the key being created.
+ */
+
+
+ class DefaultWeakMap extends WeakMap {
+ constructor(createItem, items = undefined) {
+ super(items);
+ this.createItem = createItem;
+ }
+
+ get(key) {
+ if (!this.has(key)) {
+ this.set(key, this.createItem(key));
+ }
+
+ return super.get(key);
+ }
+
+ }
+ /**
+ * Returns true if the given object is an object with a `then` method, and can
+ * therefore be assumed to behave as a Promise.
+ *
+ * @param {*} value The value to test.
+ * @returns {boolean} True if the value is thenable.
+ */
+
+
+ const isThenable = value => {
+ return value && typeof value === "object" && typeof value.then === "function";
+ };
+ /**
+ * Creates and returns a function which, when called, will resolve or reject
+ * the given promise based on how it is called:
+ *
+ * - If, when called, `chrome.runtime.lastError` contains a non-null object,
+ * the promise is rejected with that value.
+ * - If the function is called with exactly one argument, the promise is
+ * resolved to that value.
+ * - Otherwise, the promise is resolved to an array containing all of the
+ * function's arguments.
+ *
+ * @param {object} promise
+ * An object containing the resolution and rejection functions of a
+ * promise.
+ * @param {function} promise.resolve
+ * The promise's resolution function.
+ * @param {function} promise.rejection
+ * The promise's rejection function.
+ * @param {object} metadata
+ * Metadata about the wrapped method which has created the callback.
+ * @param {integer} metadata.maxResolvedArgs
+ * The maximum number of arguments which may be passed to the
+ * callback created by the wrapped async function.
+ *
+ * @returns {function}
+ * The generated callback function.
+ */
+
+
+ const makeCallback = (promise, metadata) => {
+ return (...callbackArgs) => {
+ if (extensionAPIs.runtime.lastError) {
+ promise.reject(extensionAPIs.runtime.lastError);
+ } else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) {
+ promise.resolve(callbackArgs[0]);
+ } else {
+ promise.resolve(callbackArgs);
+ }
+ };
+ };
+
+ const pluralizeArguments = numArgs => numArgs == 1 ? "argument" : "arguments";
+ /**
+ * Creates a wrapper function for a method with the given name and metadata.
+ *
+ * @param {string} name
+ * The name of the method which is being wrapped.
+ * @param {object} metadata
+ * Metadata about the method being wrapped.
+ * @param {integer} metadata.minArgs
+ * The minimum number of arguments which must be passed to the
+ * function. If called with fewer than this number of arguments, the
+ * wrapper will raise an exception.
+ * @param {integer} metadata.maxArgs
+ * The maximum number of arguments which may be passed to the
+ * function. If called with more than this number of arguments, the
+ * wrapper will raise an exception.
+ * @param {integer} metadata.maxResolvedArgs
+ * The maximum number of arguments which may be passed to the
+ * callback created by the wrapped async function.
+ *
+ * @returns {function(object, ...*)}
+ * The generated wrapper function.
+ */
+
+
+ const wrapAsyncFunction = (name, metadata) => {
+ return function asyncFunctionWrapper(target, ...args) {
+ if (args.length < metadata.minArgs) {
+ throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
+ }
+
+ if (args.length > metadata.maxArgs) {
+ throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
+ }
+
+ return new Promise((resolve, reject) => {
+ if (metadata.fallbackToNoCallback) {
+ // This API method has currently no callback on Chrome, but it return a promise on Firefox,
+ // and so the polyfill will try to call it with a callback first, and it will fallback
+ // to not passing the callback if the first call fails.
+ try {
+ target[name](...args, makeCallback({
+ resolve,
+ reject
+ }, metadata));
+ } catch (cbError) {
+ console.warn(`${name} API method doesn't seem to support the callback parameter, ` + "falling back to call it without a callback: ", cbError);
+ target[name](...args); // Update the API method metadata, so that the next API calls will not try to
+ // use the unsupported callback anymore.
+
+ metadata.fallbackToNoCallback = false;
+ metadata.noCallback = true;
+ resolve();
+ }
+ } else if (metadata.noCallback) {
+ target[name](...args);
+ resolve();
+ } else {
+ target[name](...args, makeCallback({
+ resolve,
+ reject
+ }, metadata));
+ }
+ });
+ };
+ };
+ /**
+ * Wraps an existing method of the target object, so that calls to it are
+ * intercepted by the given wrapper function. The wrapper function receives,
+ * as its first argument, the original `target` object, followed by each of
+ * the arguments passed to the original method.
+ *
+ * @param {object} target
+ * The original target object that the wrapped method belongs to.
+ * @param {function} method
+ * The method being wrapped. This is used as the target of the Proxy
+ * object which is created to wrap the method.
+ * @param {function} wrapper
+ * The wrapper function which is called in place of a direct invocation
+ * of the wrapped method.
+ *
+ * @returns {Proxy}
+ * A Proxy object for the given method, which invokes the given wrapper
+ * method in its place.
+ */
+
+
+ const wrapMethod = (target, method, wrapper) => {
+ return new Proxy(method, {
+ apply(targetMethod, thisObj, args) {
+ return wrapper.call(thisObj, target, ...args);
+ }
+
+ });
+ };
+
+ let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
+ /**
+ * Wraps an object in a Proxy which intercepts and wraps certain methods
+ * based on the given `wrappers` and `metadata` objects.
+ *
+ * @param {object} target
+ * The target object to wrap.
+ *
+ * @param {object} [wrappers = {}]
+ * An object tree containing wrapper functions for special cases. Any
+ * function present in this object tree is called in place of the
+ * method in the same location in the `target` object tree. These
+ * wrapper methods are invoked as described in {@see wrapMethod}.
+ *
+ * @param {object} [metadata = {}]
+ * An object tree containing metadata used to automatically generate
+ * Promise-based wrapper functions for asynchronous. Any function in
+ * the `target` object tree which has a corresponding metadata object
+ * in the same location in the `metadata` tree is replaced with an
+ * automatically-generated wrapper function, as described in
+ * {@see wrapAsyncFunction}
+ *
+ * @returns {Proxy}
+ */
+
+ const wrapObject = (target, wrappers = {}, metadata = {}) => {
+ let cache = Object.create(null);
+ let handlers = {
+ has(proxyTarget, prop) {
+ return prop in target || prop in cache;
+ },
+
+ get(proxyTarget, prop, receiver) {
+ if (prop in cache) {
+ return cache[prop];
+ }
+
+ if (!(prop in target)) {
+ return undefined;
+ }
+
+ let value = target[prop];
+
+ if (typeof value === "function") {
+ // This is a method on the underlying object. Check if we need to do
+ // any wrapping.
+ if (typeof wrappers[prop] === "function") {
+ // We have a special-case wrapper for this method.
+ value = wrapMethod(target, target[prop], wrappers[prop]);
+ } else if (hasOwnProperty(metadata, prop)) {
+ // This is an async method that we have metadata for. Create a
+ // Promise wrapper for it.
+ let wrapper = wrapAsyncFunction(prop, metadata[prop]);
+ value = wrapMethod(target, target[prop], wrapper);
+ } else {
+ // This is a method that we don't know or care about. Return the
+ // original method, bound to the underlying object.
+ value = value.bind(target);
+ }
+ } else if (typeof value === "object" && value !== null && (hasOwnProperty(wrappers, prop) || hasOwnProperty(metadata, prop))) {
+ // This is an object that we need to do some wrapping for the children
+ // of. Create a sub-object wrapper for it with the appropriate child
+ // metadata.
+ value = wrapObject(value, wrappers[prop], metadata[prop]);
+ } else if (hasOwnProperty(metadata, "*")) {
+ // Wrap all properties in * namespace.
+ value = wrapObject(value, wrappers[prop], metadata["*"]);
+ } else {
+ // We don't need to do any wrapping for this property,
+ // so just forward all access to the underlying object.
+ Object.defineProperty(cache, prop, {
+ configurable: true,
+ enumerable: true,
+
+ get() {
+ return target[prop];
+ },
+
+ set(value) {
+ target[prop] = value;
+ }
+
+ });
+ return value;
+ }
+
+ cache[prop] = value;
+ return value;
+ },
+
+ set(proxyTarget, prop, value, receiver) {
+ if (prop in cache) {
+ cache[prop] = value;
+ } else {
+ target[prop] = value;
+ }
+
+ return true;
+ },
+
+ defineProperty(proxyTarget, prop, desc) {
+ return Reflect.defineProperty(cache, prop, desc);
+ },
+
+ deleteProperty(proxyTarget, prop) {
+ return Reflect.deleteProperty(cache, prop);
+ }
+
+ }; // Per contract of the Proxy API, the "get" proxy handler must return the
+ // original value of the target if that value is declared read-only and
+ // non-configurable. For this reason, we create an object with the
+ // prototype set to `target` instead of using `target` directly.
+ // Otherwise we cannot return a custom object for APIs that
+ // are declared read-only and non-configurable, such as `chrome.devtools`.
+ //
+ // The proxy handlers themselves will still use the original `target`
+ // instead of the `proxyTarget`, so that the methods and properties are
+ // dereferenced via the original targets.
+
+ let proxyTarget = Object.create(target);
+ return new Proxy(proxyTarget, handlers);
+ };
+ /**
+ * Creates a set of wrapper functions for an event object, which handles
+ * wrapping of listener functions that those messages are passed.
+ *
+ * A single wrapper is created for each listener function, and stored in a
+ * map. Subsequent calls to `addListener`, `hasListener`, or `removeListener`
+ * retrieve the original wrapper, so that attempts to remove a
+ * previously-added listener work as expected.
+ *
+ * @param {DefaultWeakMap} wrapperMap
+ * A DefaultWeakMap object which will create the appropriate wrapper
+ * for a given listener function when one does not exist, and retrieve
+ * an existing one when it does.
+ *
+ * @returns {object}
+ */
+
+
+ const wrapEvent = wrapperMap => ({
+ addListener(target, listener, ...args) {
+ target.addListener(wrapperMap.get(listener), ...args);
+ },
+
+ hasListener(target, listener) {
+ return target.hasListener(wrapperMap.get(listener));
+ },
+
+ removeListener(target, listener) {
+ target.removeListener(wrapperMap.get(listener));
+ }
+
+ }); // Keep track if the deprecation warning has been logged at least once.
+
+
+ let loggedSendResponseDeprecationWarning = false;
+ const onMessageWrappers = new DefaultWeakMap(listener => {
+ if (typeof listener !== "function") {
+ return listener;
+ }
+ /**
+ * Wraps a message listener function so that it may send responses based on
+ * its return value, rather than by returning a sentinel value and calling a
+ * callback. If the listener function returns a Promise, the response is
+ * sent when the promise either resolves or rejects.
+ *
+ * @param {*} message
+ * The message sent by the other end of the channel.
+ * @param {object} sender
+ * Details about the sender of the message.
+ * @param {function(*)} sendResponse
+ * A callback which, when called with an arbitrary argument, sends
+ * that value as a response.
+ * @returns {boolean}
+ * True if the wrapped listener returned a Promise, which will later
+ * yield a response. False otherwise.
+ */
+
+
+ return function onMessage(message, sender, sendResponse) {
+ let didCallSendResponse = false;
+ let wrappedSendResponse;
+ let sendResponsePromise = new Promise(resolve => {
+ wrappedSendResponse = function (response) {
+ if (!loggedSendResponseDeprecationWarning) {
+ console.warn(SEND_RESPONSE_DEPRECATION_WARNING, new Error().stack);
+ loggedSendResponseDeprecationWarning = true;
+ }
+
+ didCallSendResponse = true;
+ resolve(response);
+ };
+ });
+ let result;
+
+ try {
+ result = listener(message, sender, wrappedSendResponse);
+ } catch (err) {
+ result = Promise.reject(err);
+ }
+
+ const isResultThenable = result !== true && isThenable(result); // If the listener didn't returned true or a Promise, or called
+ // wrappedSendResponse synchronously, we can exit earlier
+ // because there will be no response sent from this listener.
+
+ if (result !== true && !isResultThenable && !didCallSendResponse) {
+ return false;
+ } // A small helper to send the message if the promise resolves
+ // and an error if the promise rejects (a wrapped sendMessage has
+ // to translate the message into a resolved promise or a rejected
+ // promise).
+
+
+ const sendPromisedResult = promise => {
+ promise.then(msg => {
+ // send the message value.
+ sendResponse(msg);
+ }, error => {
+ // Send a JSON representation of the error if the rejected value
+ // is an instance of error, or the object itself otherwise.
+ let message;
+
+ if (error && (error instanceof Error || typeof error.message === "string")) {
+ message = error.message;
+ } else {
+ message = "An unexpected error occurred";
+ }
+
+ sendResponse({
+ __mozWebExtensionPolyfillReject__: true,
+ message
+ });
+ }).catch(err => {
+ // Print an error on the console if unable to send the response.
+ console.error("Failed to send onMessage rejected reply", err);
+ });
+ }; // If the listener returned a Promise, send the resolved value as a
+ // result, otherwise wait the promise related to the wrappedSendResponse
+ // callback to resolve and send it as a response.
+
+
+ if (isResultThenable) {
+ sendPromisedResult(result);
+ } else {
+ sendPromisedResult(sendResponsePromise);
+ } // Let Chrome know that the listener is replying.
+
+
+ return true;
+ };
+ });
+
+ const wrappedSendMessageCallback = ({
+ reject,
+ resolve
+ }, reply) => {
+ if (extensionAPIs.runtime.lastError) {
+ // Detect when none of the listeners replied to the sendMessage call and resolve
+ // the promise to undefined as in Firefox.
+ // See https://github.com/mozilla/webextension-polyfill/issues/130
+ if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) {
+ resolve();
+ } else {
+ reject(extensionAPIs.runtime.lastError);
+ }
+ } else if (reply && reply.__mozWebExtensionPolyfillReject__) {
+ // Convert back the JSON representation of the error into
+ // an Error instance.
+ reject(new Error(reply.message));
+ } else {
+ resolve(reply);
+ }
+ };
+
+ const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => {
+ if (args.length < metadata.minArgs) {
+ throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
+ }
+
+ if (args.length > metadata.maxArgs) {
+ throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
+ }
+
+ return new Promise((resolve, reject) => {
+ const wrappedCb = wrappedSendMessageCallback.bind(null, {
+ resolve,
+ reject
+ });
+ args.push(wrappedCb);
+ apiNamespaceObj.sendMessage(...args);
+ });
+ };
+
+ const staticWrappers = {
+ runtime: {
+ onMessage: wrapEvent(onMessageWrappers),
+ onMessageExternal: wrapEvent(onMessageWrappers),
+ sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
+ minArgs: 1,
+ maxArgs: 3
+ })
+ },
+ tabs: {
+ sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
+ minArgs: 2,
+ maxArgs: 3
+ })
+ }
+ };
+ const settingMetadata = {
+ clear: {
+ minArgs: 1,
+ maxArgs: 1
+ },
+ get: {
+ minArgs: 1,
+ maxArgs: 1
+ },
+ set: {
+ minArgs: 1,
+ maxArgs: 1
+ }
+ };
+ apiMetadata.privacy = {
+ network: {
+ "*": settingMetadata
+ },
+ services: {
+ "*": settingMetadata
+ },
+ websites: {
+ "*": settingMetadata
+ }
+ };
+ return wrapObject(extensionAPIs, staticWrappers, apiMetadata);
+ };
+
+ if (typeof chrome != "object" || !chrome || !chrome.runtime || !chrome.runtime.id) {
+ throw new Error("This script should only be loaded in a browser extension.");
+ } // The build process adds a UMD wrapper around this file, which makes the
+ // `module` variable available.
+
+
+ module.exports = wrapAPIs(chrome);
+ } else {
+ module.exports = browser;
+ }
+});
+//# sourceMappingURL=browser-polyfill.js.map
diff --git a/apps/web-clipper/lib/cash.min.js b/apps/web-clipper/lib/cash.min.js
new file mode 100644
index 000000000..044700612
--- /dev/null
+++ b/apps/web-clipper/lib/cash.min.js
@@ -0,0 +1,40 @@
+/* MIT https://github.com/kenwheeler/cash */
+(function(){
+'use strict';var e={"class":"className",contenteditable:"contentEditable","for":"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function g(a,b){try{return a(b)}catch(c){return b}}
+var m=document,n=window,p=m.documentElement,r=m.createElement.bind(m),aa=r("div"),t=r("table"),ba=r("tbody"),ca=r("tr"),u=Array.isArray,v=Array.prototype,da=v.concat,w=v.filter,ea=v.indexOf,fa=v.map,ha=v.push,ia=v.slice,x=v.some,ja=v.splice,ka=/^#[\w-]*$/,la=/^\.[\w-]*$/,ma=/<.+>/,na=/^\w+$/;function y(a,b){return a&&(A(b)||B(b))?la.test(a)?b.getElementsByClassName(a.slice(1)):na.test(a)?b.getElementsByTagName(a):b.querySelectorAll(a):[]}
+var C=function(){function a(a,c){if(a){if(a instanceof C)return a;var b=a;if(D(a)){if(b=(c instanceof C?c[0]:c)||m,b=ka.test(a)?b.getElementById(a.slice(1)):ma.test(a)?oa(a):y(a,b),!b)return}else if(E(a))return this.ready(a);if(b.nodeType||b===n)b=[b];this.length=b.length;a=0;for(c=this.length;aarguments.length?this[0]&&this[0][a]:this.each(function(c,h){h[a]=b});for(var c in a)this.prop(c,a[c]);return this}};F.get=function(a){if(void 0===a)return ia.call(this);a=Number(a);return this[0>a?a+this.length:a]};F.eq=function(a){return G(this.get(a))};
+F.first=function(){return this.eq(0)};F.last=function(){return this.eq(-1)};function L(a){return D(a)?function(b,c){return qa(c,a)}:E(a)?a:a instanceof C?function(b,c){return a.is(c)}:a?function(b,c){return c===a}:function(){return!1}}F.filter=function(a){var b=L(a);return G(w.call(this,function(a,d){return b.call(a,d,a)}))};function M(a,b){return b?a.filter(b):a}var sa=/\S+/g;function N(a){return D(a)?a.match(sa)||[]:[]}F.hasClass=function(a){return!!a&&x.call(this,function(b){return B(b)&&b.classList.contains(a)})};
+F.removeAttr=function(a){var b=N(a);return this.each(function(a,d){B(d)&&I(b,function(a,b){d.removeAttribute(b)})})};F.attr=function(a,b){if(a){if(D(a)){if(2>arguments.length){if(!this[0]||!B(this[0]))return;var c=this[0].getAttribute(a);return null===c?void 0:c}return void 0===b?this:null===b?this.removeAttr(a):this.each(function(c,h){B(h)&&h.setAttribute(a,b)})}for(c in a)this.attr(c,a[c]);return this}};
+F.toggleClass=function(a,b){var c=N(a),d=void 0!==b;return this.each(function(a,f){B(f)&&I(c,function(a,c){d?b?f.classList.add(c):f.classList.remove(c):f.classList.toggle(c)})})};F.addClass=function(a){return this.toggleClass(a,!0)};F.removeClass=function(a){return arguments.length?this.toggleClass(a,!1):this.attr("class","")};
+function O(a,b,c,d){for(var h=[],f=E(b),k=d&&L(d),q=0,R=a.length;qarguments.length)return this[0]&&Q(this[0],a,c);if(!a)return this;b=xa(a,b,c);return this.each(function(d,f){B(f)&&(c?f.style.setProperty(a,b):f.style[a]=b)})}for(var d in a)this.css(d,a[d]);return this};var ya=/^\s+|\s+$/;function za(a,b){a=a.dataset[b]||a.dataset[H(b)];return ya.test(a)?a:g(JSON.parse,a)}
+F.data=function(a,b){if(!a){if(!this[0])return;var c={},d;for(d in this[0].dataset)c[d]=za(this[0],d);return c}if(D(a))return 2>arguments.length?this[0]&&za(this[0],a):void 0===b?this:this.each(function(c,d){c=b;c=g(JSON.stringify,c);d.dataset[H(a)]=c});for(d in a)this.data(d,a[d]);return this};function Aa(a,b){var c=a.documentElement;return Math.max(a.body["scroll"+b],c["scroll"+b],a.body["offset"+b],c["offset"+b],c["client"+b])}
+function Ba(a,b){return S(a,"border"+(b?"Left":"Top")+"Width")+S(a,"padding"+(b?"Left":"Top"))+S(a,"padding"+(b?"Right":"Bottom"))+S(a,"border"+(b?"Right":"Bottom")+"Width")}
+I([!0,!1],function(a,b){I(["Width","Height"],function(a,d){F[(b?"outer":"inner")+d]=function(c){if(this[0])return K(this[0])?b?this[0]["inner"+d]:this[0].document.documentElement["client"+d]:A(this[0])?Aa(this[0],d):this[0][(b?"offset":"client")+d]+(c&&b?S(this[0],"margin"+(a?"Top":"Left"))+S(this[0],"margin"+(a?"Bottom":"Right")):0)}})});
+I(["Width","Height"],function(a,b){var c=b.toLowerCase();F[c]=function(d){if(!this[0])return void 0===d?void 0:this;if(!arguments.length)return K(this[0])?this[0].document.documentElement["client"+b]:A(this[0])?Aa(this[0],b):this[0].getBoundingClientRect()[c]-Ba(this[0],!a);var h=parseInt(d,10);return this.each(function(b,d){B(d)&&(b=Q(d,"boxSizing"),d.style[c]=xa(c,h+("border-box"===b?Ba(d,!a):0)))})}});var V={};
+F.toggle=function(a){return this.each(function(b,c){if(B(c))if(void 0===a?"none"===Q(c,"display"):a){if(c.style.display=c.___cd||"","none"===Q(c,"display")){b=c.style;c=c.tagName;if(V[c])c=V[c];else{var d=r(c);m.body.insertBefore(d,null);var h=Q(d,"display");m.body.removeChild(d);c=V[c]="none"!==h?h:"block"}b.display=c}}else c.___cd=Q(c,"display"),c.style.display="none"})};F.hide=function(){return this.toggle(!1)};F.show=function(){return this.toggle(!0)};
+function Ca(a,b){return!b||!x.call(b,function(b){return 0>a.indexOf(b)})}var W={focus:"focusin",blur:"focusout"},Da={mouseenter:"mouseover",mouseleave:"mouseout"},Ea=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function Fa(a,b,c,d,h){var f=a.___ce=a.___ce||{};f[b]=f[b]||[];f[b].push([c,d,h]);a.addEventListener(b,h)}function X(a){a=a.split(".");return[a[0],a.slice(1).sort()]}
+function Y(a,b,c,d,h){var f=a.___ce=a.___ce||{};if(b)f[b]&&(f[b]=f[b].filter(function(f){var k=f[0],R=f[1];f=f[2];if(h&&f.guid!==h.guid||!Ca(k,c)||d&&d!==R)return!0;a.removeEventListener(b,f)}));else for(b in f)Y(a,b,c,d,h)}
+F.off=function(a,b,c){var d=this;if(void 0===a)this.each(function(a,b){(B(b)||A(b)||K(b))&&Y(b)});else if(D(a))E(b)&&(c=b,b=""),I(N(a),function(a,h){a=X(Da[h]||W[h]||h);var f=a[0],k=a[1];d.each(function(a,d){(B(d)||A(d)||K(d))&&Y(d,f,k,b,c)})});else for(var h in a)this.off(h,a[h]);return this};
+F.on=function(a,b,c,d,h){var f=this;if(!D(a)){for(var k in a)this.on(k,b,c,a[k],h);return this}D(b)||(void 0!==b&&null!==b&&(void 0!==c&&(d=c),c=b),b="");E(d)||(d=c,c=void 0);if(!d)return this;I(N(a),function(a,k){a=X(Da[k]||W[k]||k);var l=a[0],q=a[1];l&&f.each(function(a,f){if(B(f)||A(f)||K(f))a=function Ja(a){if(!a.namespace||Ca(q,a.namespace.split("."))){var k=f;if(b){for(var z=a.target;!qa(z,b);){if(z===f)return;z=z.parentNode;if(!z)return}k=z;a.___cd=!0}a.___cd&&Object.defineProperty(a,"currentTarget",
+{configurable:!0,get:function(){return k}});Object.defineProperty(a,"data",{configurable:!0,get:function(){return c}});z=d.call(k,a,a.___td);h&&Y(f,l,q,b,Ja);!1===z&&(a.preventDefault(),a.stopPropagation())}},a.guid=d.guid=d.guid||G.guid++,Fa(f,l,q,b,a)})});return this};F.one=function(a,b,c,d){return this.on(a,b,c,d,!0)};F.ready=function(a){function b(){return setTimeout(a,0,G)}"loading"!==m.readyState?b():m.addEventListener("DOMContentLoaded",b);return this};
+F.trigger=function(a,b){if(D(a)){var c=X(a),d=c[0];c=c[1];if(!d)return this;var h=Ea.test(d)?"MouseEvents":"HTMLEvents";a=m.createEvent(h);a.initEvent(d,!0,!0);a.namespace=c.join(".")}a.___td=b;var f=a.type in W;return this.each(function(b,c){if(f&&E(c[a.type]))c[a.type]();else c.dispatchEvent(a)})};function Ga(a){return a.multiple&&a.options?O(w.call(a.options,function(a){return a.selected&&!a.disabled&&!a.parentNode.disabled}),"value"):a.value||""}
+var Ha=/%20/g,Ia=/\r?\n/g,Ka=/file|reset|submit|button|image/i,La=/radio|checkbox/i;F.serialize=function(){var a="";this.each(function(b,c){I(c.elements||[c],function(b,c){c.disabled||!c.name||"FIELDSET"===c.tagName||Ka.test(c.type)||La.test(c.type)&&!c.checked||(b=Ga(c),void 0!==b&&(b=u(b)?b:[b],I(b,function(b,d){b=a;d="&"+encodeURIComponent(c.name)+"="+encodeURIComponent(d.replace(Ia,"\r\n")).replace(Ha,"+");a=b+d})))})});return a.slice(1)};
+F.val=function(a){return arguments.length?this.each(function(b,c){if((b=c.multiple&&c.options)||La.test(c.type)){var d=u(a)?fa.call(a,String):null===a?[]:[String(a)];b?I(c.options,function(a,b){b.selected=0<=d.indexOf(b.value)},!0):c.checked=0<=d.indexOf(c.value)}else c.value=void 0===a||null===a?"":a}):this[0]&&Ga(this[0])};F.clone=function(){return this.map(function(a,b){return b.cloneNode(!0)})};F.detach=function(a){M(this,a).each(function(a,c){c.parentNode&&c.parentNode.removeChild(c)});return this};
+var Ma=/^\s*<(\w+)[^>]*>/,Na=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Oa={"*":aa,tr:ba,td:ca,th:ca,thead:t,tbody:t,tfoot:t};function oa(a){if(!D(a))return[];if(Na.test(a))return[r(RegExp.$1)];var b=Ma.test(a)&&RegExp.$1;b=Oa[b]||Oa["*"];b.innerHTML=a;return G(b.childNodes).detach().get()}G.parseHTML=oa;F.empty=function(){return this.each(function(a,b){for(;b.firstChild;)b.removeChild(b.firstChild)})};
+F.html=function(a){return arguments.length?void 0===a?this:this.each(function(b,c){B(c)&&(c.innerHTML=a)}):this[0]&&this[0].innerHTML};F.remove=function(a){M(this,a).detach().off();return this};F.text=function(a){return void 0===a?this[0]?this[0].textContent:"":this.each(function(b,c){B(c)&&(c.textContent=a)})};F.unwrap=function(){this.parent().each(function(a,b){"BODY"!==b.tagName&&(a=G(b),a.replaceWith(a.children()))});return this};
+F.offset=function(){var a=this[0];if(a)return a=a.getBoundingClientRect(),{top:a.top+n.pageYOffset,left:a.left+n.pageXOffset}};F.offsetParent=function(){return this.map(function(a,b){for(a=b.offsetParent;a&&"static"===Q(a,"position");)a=a.offsetParent;return a||p})};
+F.position=function(){var a=this[0];if(a){var b="fixed"===Q(a,"position"),c=b?a.getBoundingClientRect():this.offset();if(!b){var d=a.ownerDocument;for(b=a.offsetParent||d.documentElement;(b===d.body||b===d.documentElement)&&"static"===Q(b,"position");)b=b.parentNode;b!==a&&B(b)&&(d=G(b).offset(),c.top-=d.top+S(b,"borderTopWidth"),c.left-=d.left+S(b,"borderLeftWidth"))}return{top:c.top-S(a,"marginTop"),left:c.left-S(a,"marginLeft")}}};
+F.children=function(a){return M(G(P(O(this,function(a){return a.children}))),a)};F.contents=function(){return G(P(O(this,function(a){return"IFRAME"===a.tagName?[a.contentDocument]:"TEMPLATE"===a.tagName?a.content.childNodes:a.childNodes})))};F.find=function(a){return G(P(O(this,function(b){return y(a,b)})))};var Pa=/^\s*\s*$/g,Qa=/^$|^module$|\/(java|ecma)script/i,Ra=["type","src","nonce","noModule"];
+function Sa(a,b){a=G(a);a.filter("script").add(a.find("script")).each(function(a,d){if(Qa.test(d.type)&&p.contains(d)){var c=r("script");c.text=d.textContent.replace(Pa,"");I(Ra,function(a,b){d[b]&&(c[b]=d[b])});b.head.insertBefore(c,null);b.head.removeChild(c)}})}
+function Z(a,b,c,d,h,f,k,q){I(a,function(a,f){I(G(f),function(a,f){I(G(b),function(b,k){var l=c?k:f;b=c?a:b;k=c?f:k;l=b?l.cloneNode(!0):l;b=!b;h?k.insertBefore(l,d?k.firstChild:null):k.parentNode.insertBefore(l,d?k:k.nextSibling);b&&Sa(l,k.ownerDocument)},q)},k)},f);return b}F.after=function(){return Z(arguments,this,!1,!1,!1,!0,!0)};F.append=function(){return Z(arguments,this,!1,!1,!0)};F.appendTo=function(a){return Z(arguments,this,!0,!1,!0)};F.before=function(){return Z(arguments,this,!1,!0)};
+F.insertAfter=function(a){return Z(arguments,this,!0,!1,!1,!1,!1,!0)};F.insertBefore=function(a){return Z(arguments,this,!0,!0)};F.prepend=function(){return Z(arguments,this,!1,!0,!0,!0,!0)};F.prependTo=function(a){return Z(arguments,this,!0,!0,!0,!1,!1,!0)};F.replaceWith=function(a){return this.before(a).remove()};F.replaceAll=function(a){G(a).replaceWith(this);return this};F.wrapAll=function(a){a=G(a);for(var b=a[0];b.children.length;)b=b.firstElementChild;this.first().before(a);return this.appendTo(b)};
+F.wrap=function(a){return this.each(function(b,c){var d=G(a)[0];G(c).wrapAll(b?d.cloneNode(!0):d)})};F.wrapInner=function(a){return this.each(function(b,c){b=G(c);c=b.contents();c.length?c.wrapAll(a):b.append(a)})};F.has=function(a){var b=D(a)?function(b,d){return y(a,d).length}:function(b,d){return d.contains(a)};return this.filter(b)};F.is=function(a){var b=L(a);return x.call(this,function(a,d){return b.call(a,d,a)})};F.next=function(a,b,c){return M(G(P(O(this,"nextElementSibling",b,c))),a)};
+F.nextAll=function(a){return this.next(a,!0)};F.nextUntil=function(a,b){return this.next(b,!0,a)};F.not=function(a){var b=L(a);return this.filter(function(c,d){return(!D(a)||B(d))&&!b.call(d,c,d)})};F.parent=function(a){return M(G(P(O(this,"parentNode"))),a)};F.index=function(a){var b=a?G(a)[0]:this[0];a=a?this:G(b).parent().children();return ea.call(a,b)};F.closest=function(a){var b=this.filter(a);if(b.length)return b;var c=this.parent();return c.length?c.closest(a):b};
+F.parents=function(a,b){return M(G(P(O(this,"parentElement",!0,b))),a)};F.parentsUntil=function(a,b){return this.parents(b,a)};F.prev=function(a,b,c){return M(G(P(O(this,"previousElementSibling",b,c))),a)};F.prevAll=function(a){return this.prev(a,!0)};F.prevUntil=function(a,b){return this.prev(b,!0,a)};F.siblings=function(a){return M(G(P(O(this,function(a){return G(a).parent().children().not(a)}))),a)};"undefined"!==typeof exports?module.exports=G:n.cash=n.$=G;
+})();
\ No newline at end of file
diff --git a/apps/web-clipper/lib/toast.js b/apps/web-clipper/lib/toast.js
new file mode 100644
index 000000000..c7bb438b6
--- /dev/null
+++ b/apps/web-clipper/lib/toast.js
@@ -0,0 +1,266 @@
+/***********************************************
+
+ "toast.js"
+
+ Created by Michael Cheng on 05/31/2015 22:34
+ http://michaelcheng.us/
+ michael@michaelcheng.us
+ --All Rights Reserved--
+
+ ***********************************************/
+
+'use strict';
+
+/**
+ * The Toast animation speed; how long the Toast takes to move to and from the screen
+ * @type {Number}
+ */
+const TOAST_ANIMATION_SPEED = 400;
+
+const Transitions = {
+ SHOW: {
+ '-webkit-transition': 'opacity ' + TOAST_ANIMATION_SPEED + 'ms, -webkit-transform ' + TOAST_ANIMATION_SPEED + 'ms',
+ 'transition': 'opacity ' + TOAST_ANIMATION_SPEED + 'ms, transform ' + TOAST_ANIMATION_SPEED + 'ms',
+ 'opacity': '1',
+ '-webkit-transform': 'translateY(-100%) translateZ(0)',
+ 'transform': 'translateY(-100%) translateZ(0)'
+ },
+
+ HIDE: {
+ 'opacity': '0',
+ '-webkit-transform': 'translateY(150%) translateZ(0)',
+ 'transform': 'translateY(150%) translateZ(0)'
+ }
+};
+
+/**
+ * The main Toast object
+ * @param {String} text The text to put inside the Toast
+ * @param {Object} options Optional; the Toast options. See Toast.prototype.DEFAULT_SETTINGS for more information
+ * @param {Object} transitions Optional; the Transitions object. This should not be used unless you know what you're doing
+ */
+function Toast(text, options, transitions) {
+ if(getToastStage() !== null) {
+ // If there is already a Toast being shown, put this Toast in the queue to show later
+ Toast.prototype.toastQueue.push({
+ text: text,
+ options: options,
+ transitions: transitions
+ });
+ } else {
+ Toast.prototype.Transitions = transitions || Transitions;
+ var _options = options || {};
+ _options = Toast.prototype.mergeOptions(Toast.prototype.DEFAULT_SETTINGS, _options);
+
+ Toast.prototype.show(text, _options);
+
+ _options = null;
+ }
+}
+
+
+/**
+ * The toastStage. This is the HTML element in which the toast resides
+ * Getter and setter methods are available privately
+ * @type {Element}
+ */
+var _toastStage = null;
+function getToastStage() {
+ return _toastStage;
+}
+function setToastStage(toastStage) {
+ _toastStage = toastStage;
+}
+
+
+
+
+// define some Toast constants
+
+/**
+ * The default Toast settings
+ * @type {Object}
+ */
+Toast.prototype.DEFAULT_SETTINGS = {
+ style: {
+ main: {
+ 'background': 'rgba(0, 0, 0, .8)',
+ 'box-shadow': '0 0 10px rgba(0, 0, 0, .8)',
+
+ 'border-radius': '3px',
+
+ 'z-index': '99999',
+
+ 'color': 'rgba(255, 255, 255, .9)',
+
+ 'padding': '10px 15px',
+ 'max-width': '60%',
+ 'width': '100%',
+ 'word-break': 'keep-all',
+ 'margin': '0 auto',
+ 'text-align': 'center',
+
+ 'position': 'fixed',
+ 'left': '0',
+ 'right': '0',
+ 'bottom': '0',
+
+ '-webkit-transform': 'translateY(150%) translateZ(0)',
+ 'transform': 'translateY(150%) translateZ(0)',
+ '-webkit-filter': 'blur(0)',
+ 'opacity': '0'
+ }
+ },
+
+ settings: {
+ duration: 4000
+ }
+};
+
+Toast.prototype.Transitions = {};
+
+
+/**
+ * The queue of Toasts waiting to be shown
+ * @type {Array}
+ */
+Toast.prototype.toastQueue = [];
+
+
+/**
+ * The Timeout object for animations.
+ * This should be shared among the Toasts, because timeouts may be cancelled e.g. on explicit call of hide()
+ * @type {Object}
+ */
+Toast.prototype.timeout = null;
+
+
+/**
+ * Merge the DEFAULT_SETTINGS with the user defined options if specified
+ * @param {Object} options The user defined options
+ */
+Toast.prototype.mergeOptions = function(initialOptions, customOptions) {
+ var merged = customOptions;
+ for(var prop in initialOptions) {
+ if(merged.hasOwnProperty(prop)) {
+ if(initialOptions[prop] !== null && initialOptions[prop].constructor === Object) {
+ merged[prop] = Toast.prototype.mergeOptions(initialOptions[prop], merged[prop]);
+ }
+ } else {
+ merged[prop] = initialOptions[prop];
+ }
+ }
+ return merged;
+};
+
+
+/**
+ * Generate the Toast with the specified text.
+ * @param {String|Object} text The text to show inside the Toast, can be an HTML element or plain text
+ * @param {Object} style The style to set for the Toast
+ */
+Toast.prototype.generate = function(text, style) {
+ var toastStage = document.createElement('div');
+
+
+ /**
+ * If the text is a String, create a textNode for appending
+ */
+ if(typeof text === 'string') {
+ text = document.createTextNode(text);
+ }
+ toastStage.appendChild(text);
+
+
+ setToastStage(toastStage);
+ toastStage = null;
+
+ Toast.prototype.stylize(getToastStage(), style);
+};
+
+/**
+ * Stylize the Toast.
+ * @param {Element} element The HTML element to stylize
+ * @param {Object} styles An object containing the style to apply
+ * @return Returns nothing
+ */
+Toast.prototype.stylize = function(element, styles) {
+ Object.keys(styles).forEach(function(style) {
+ element.style[style] = styles[style];
+ });
+};
+
+
+/**
+ * Show the Toast
+ * @param {String} text The text to show inside the Toast
+ * @param {Object} options The object containing the options for the Toast
+ */
+Toast.prototype.show = function(text, options) {
+ this.generate(text, options.style.main);
+
+ var toastStage = getToastStage();
+ document.body.insertBefore(toastStage, document.body.firstChild);
+
+
+
+ // This is a hack to get animations started. Apparently without explicitly redrawing, it'll just attach the class and no animations would be done
+ toastStage.offsetHeight;
+
+
+ Toast.prototype.stylize(toastStage, Toast.prototype.Transitions.SHOW);
+
+
+ toastStage = null;
+
+
+ // Hide the Toast after the specified time
+ clearTimeout(Toast.prototype.timeout);
+ Toast.prototype.timeout = setTimeout(Toast.prototype.hide, options.settings.duration);
+};
+
+
+/**
+ * Hide the Toast that's currently shown
+ */
+Toast.prototype.hide = function() {
+ var toastStage = getToastStage();
+ Toast.prototype.stylize(toastStage, Toast.prototype.Transitions.HIDE);
+
+ // Destroy the Toast element after animations end
+ clearTimeout(Toast.prototype.timeout);
+ toastStage.addEventListener('transitionend', Toast.prototype.animationListener);
+ toastStage = null;
+};
+
+Toast.prototype.animationListener = function() {
+ getToastStage().removeEventListener('transitionend', Toast.prototype.animationListener);
+ Toast.prototype.destroy.call(this);
+};
+
+
+/**
+ * Clean up after the Toast slides away. Namely, removing the Toast from the DOM. After the Toast is cleaned up, display the next Toast in the queue if any exists
+ */
+Toast.prototype.destroy = function() {
+ var toastStage = getToastStage();
+ document.body.removeChild(toastStage);
+
+ toastStage = null;
+ setToastStage(null);
+
+
+ if(Toast.prototype.toastQueue.length > 0) {
+ // Show the rest of the Toasts in the queue if they exist
+
+ var toast = Toast.prototype.toastQueue.shift();
+ Toast(toast.text, toast.options, toast.transitions);
+
+ // clean up
+ toast = null;
+ }
+};
+
+window.showToast = Toast;
+
+"END OF FILE"; // to avoid "result is non-structured-clonable data"
\ No newline at end of file
diff --git a/apps/web-clipper/manifest.json b/apps/web-clipper/manifest.json
new file mode 100644
index 000000000..fe3b98302
--- /dev/null
+++ b/apps/web-clipper/manifest.json
@@ -0,0 +1,75 @@
+{
+ "manifest_version": 2,
+ "name": "Trilium Web Clipper (dev)",
+ "version": "1.0.1",
+ "description": "Save web clippings to Trilium Notes.",
+ "homepage_url": "https://github.com/zadam/trilium-web-clipper",
+ "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
+ "icons": {
+ "32": "icons/32.png",
+ "48": "icons/48.png",
+ "96": "icons/96.png"
+ },
+ "permissions": [
+ "activeTab",
+ "tabs",
+ "http://*/",
+ "https://*/",
+ "",
+ "storage",
+ "contextMenus"
+ ],
+ "browser_action": {
+ "default_icon": "icons/32.png",
+ "default_title": "Trilium Web Clipper",
+ "default_popup": "popup/popup.html"
+ },
+ "content_scripts": [
+ {
+ "matches": [
+ ""
+ ],
+ "js": [
+ "lib/browser-polyfill.js",
+ "utils.js",
+ "content.js"
+ ]
+ }
+ ],
+ "background": {
+ "scripts": [
+ "lib/browser-polyfill.js",
+ "utils.js",
+ "trilium_server_facade.js",
+ "background.js"
+ ]
+ },
+ "options_ui": {
+ "page": "options/options.html"
+ },
+ "commands": {
+ "saveSelection": {
+ "description": "Save the selected text into a note",
+ "suggested_key": {
+ "default": "Ctrl+Shift+S"
+ }
+ },
+ "saveWholePage": {
+ "description": "Save the current page",
+ "suggested_key": {
+ "default": "Alt+Shift+S"
+ }
+ },
+ "saveCroppedScreenshot": {
+ "description": "Take a cropped screenshot of the current page",
+ "suggested_key": {
+ "default": "Ctrl+Shift+E"
+ }
+ }
+ },
+ "browser_specific_settings": {
+ "gecko": {
+ "id": "{1410742d-b377-40e7-a9db-63dc9c6ec99c}"
+ }
+ }
+}
diff --git a/apps/web-clipper/options/options.html b/apps/web-clipper/options/options.html
new file mode 100644
index 000000000..2363567a5
--- /dev/null
+++ b/apps/web-clipper/options/options.html
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+Trilium desktop instance
+
+Web clipper by default tries to find a running desktop instance on port 37740. If you configured your Trilium desktop app to run on a different port, you can specify it here (otherwise keep it empty).
+
+
+
+Trilium server instance
+
+If you have a server instance set up, you can optionally configure it as a fail over target for the clipped notes. Desktop instance will still be given priority, but in cases that the desktop instance is not available (e.g. it's not running), web clipper will send the notes to the server instance instead.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/web-clipper/options/options.js b/apps/web-clipper/options/options.js
new file mode 100644
index 000000000..03c05822c
--- /dev/null
+++ b/apps/web-clipper/options/options.js
@@ -0,0 +1,135 @@
+const $triliumServerUrl = $("#trilium-server-url");
+const $triliumServerPassword = $("#trilium-server-password");
+
+const $errorMessage = $("#error-message");
+const $successMessage = $("#success-message");
+
+function showError(message) {
+ $errorMessage.html(message).show();
+ $successMessage.hide();
+}
+
+function showSuccess(message) {
+ $successMessage.html(message).show();
+ $errorMessage.hide();
+}
+
+async function saveTriliumServerSetup(e) {
+ e.preventDefault();
+
+ if ($triliumServerUrl.val().trim().length === 0
+ || $triliumServerPassword.val().trim().length === 0) {
+ showError("One or more mandatory inputs are missing. Please fill in server URL and password.");
+
+ return;
+ }
+
+ let resp;
+
+ try {
+ resp = await fetch($triliumServerUrl.val() + '/api/login/token', {
+ method: "POST",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({
+ password: $triliumServerPassword.val()
+ })
+ });
+ }
+ catch (e) {
+ showError("Unknown error: " + e.message);
+ return;
+ }
+
+ if (resp.status === 401) {
+ showError("Incorrect credentials.");
+ }
+ else if (resp.status !== 200) {
+ showError("Unrecognised response with status code " + resp.status);
+ }
+ else {
+ const json = await resp.json();
+
+ showSuccess("Authentication against Trilium server has been successful.");
+
+ $triliumServerPassword.val('');
+
+ browser.storage.sync.set({
+ triliumServerUrl: $triliumServerUrl.val(),
+ authToken: json.token
+ });
+
+ await restoreOptions();
+ }
+}
+
+const $triliumServerSetupForm = $("#trilium-server-setup-form");
+const $triliumServerConfiguredDiv = $("#trilium-server-configured");
+const $triliumServerLink = $("#trilium-server-link");
+const $resetTriliumServerSetupLink = $("#reset-trilium-server-setup");
+
+$resetTriliumServerSetupLink.on("click", e => {
+ e.preventDefault();
+
+ browser.storage.sync.set({
+ triliumServerUrl: '',
+ authToken: ''
+ });
+
+ restoreOptions();
+});
+
+$triliumServerSetupForm.on("submit", saveTriliumServerSetup);
+
+const $triliumDesktopPort = $("#trilium-desktop-port");
+const $triilumDesktopSetupForm = $("#trilium-desktop-setup-form");
+
+$triilumDesktopSetupForm.on("submit", e => {
+ e.preventDefault();
+
+ const port = $triliumDesktopPort.val().trim();
+ const portNum = parseInt(port);
+
+ if (port && (isNaN(portNum) || portNum <= 0 || portNum >= 65536)) {
+ showError(`Please enter valid port number.`);
+ return;
+ }
+
+ browser.storage.sync.set({
+ triliumDesktopPort: port
+ });
+
+ showSuccess(`Port number has been saved.`);
+});
+
+async function restoreOptions() {
+ const {triliumServerUrl} = await browser.storage.sync.get("triliumServerUrl");
+ const {authToken} = await browser.storage.sync.get("authToken");
+
+ $errorMessage.hide();
+ $successMessage.hide();
+
+ $triliumServerUrl.val('');
+ $triliumServerPassword.val('');
+
+ if (triliumServerUrl && authToken) {
+ $triliumServerSetupForm.hide();
+ $triliumServerConfiguredDiv.show();
+
+ $triliumServerLink
+ .attr("href", triliumServerUrl)
+ .text(triliumServerUrl);
+ }
+ else {
+ $triliumServerSetupForm.show();
+ $triliumServerConfiguredDiv.hide();
+ }
+
+ const {triliumDesktopPort} = await browser.storage.sync.get("triliumDesktopPort");
+
+ $triliumDesktopPort.val(triliumDesktopPort);
+}
+
+$(restoreOptions);
diff --git a/apps/web-clipper/popup/popup.css b/apps/web-clipper/popup/popup.css
new file mode 100644
index 000000000..7d1258a1c
--- /dev/null
+++ b/apps/web-clipper/popup/popup.css
@@ -0,0 +1,48 @@
+body {
+ width: 300px;
+ font-size: 12px;
+ font-family: sans-serif;
+}
+
+.button {
+ margin: 3% auto;
+ padding: 4px;
+ text-align: center;
+ border: 1px solid #ccc;
+ border-radius: 3px;
+ background-color: #eee;
+ cursor: pointer;
+ color: black;
+}
+
+.wide {
+ min-width: 8em;
+}
+
+.full {
+ display: block;
+ width: 100%;
+}
+
+#save-link-with-note-wrapper {
+ display: none;
+}
+
+#save-link-with-note-textarea {
+ width: 100%;
+}
+
+#save-button {
+ border-color: #0062cc;
+ background-color: #0069d9;
+ color: white;
+}
+
+#check-connection-button {
+ float: right;
+ margin-top: -6px;
+}
+
+button[disabled] {
+ color: #aaa;
+}
diff --git a/apps/web-clipper/popup/popup.html b/apps/web-clipper/popup/popup.html
new file mode 100644
index 000000000..be415744c
--- /dev/null
+++ b/apps/web-clipper/popup/popup.html
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
Trilium Web Clipper
+
+
+
+ Options
+
+ Help
+
+
+
+
+ Crop screen shot
+ Save whole screen shot
+ Save whole page
+ Save link with a note
+ Save window's tabs as a list
+
+
+
+
+
+
+ Keep page title as note title
+
+
+ Save
+
+ Cancel
+
+
+
+
+
check
+
+
Status: unknown
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/web-clipper/popup/popup.js b/apps/web-clipper/popup/popup.js
new file mode 100644
index 000000000..adac36126
--- /dev/null
+++ b/apps/web-clipper/popup/popup.js
@@ -0,0 +1,180 @@
+async function sendMessage(message) {
+ try {
+ return await browser.runtime.sendMessage(message);
+ }
+ catch (e) {
+ console.log("Calling browser runtime failed:", e);
+
+ alert("Calling browser runtime failed. Refreshing page might help.");
+ }
+}
+
+const $showOptionsButton = $("#show-options-button");
+const $saveCroppedScreenShotButton = $("#save-cropped-screenshot-button");
+const $saveWholeScreenShotButton = $("#save-whole-screenshot-button");
+const $saveWholePageButton = $("#save-whole-page-button");
+const $saveTabsButton = $("#save-tabs-button");
+
+$showOptionsButton.on("click", () => browser.runtime.openOptionsPage());
+
+$saveCroppedScreenShotButton.on("click", () => {
+ sendMessage({name: 'save-cropped-screenshot'});
+
+ window.close();
+});
+
+$saveWholeScreenShotButton.on("click", () => {
+ sendMessage({name: 'save-whole-screenshot'});
+
+ window.close();
+});
+
+$saveWholePageButton.on("click", () => sendMessage({name: 'save-whole-page'}));
+
+$saveTabsButton.on("click", () => sendMessage({name: 'save-tabs'}));
+
+const $saveLinkWithNoteWrapper = $("#save-link-with-note-wrapper");
+const $textNote = $("#save-link-with-note-textarea");
+const $keepTitle = $("#keep-title-checkbox");
+
+$textNote.on('keypress', function (event) {
+ if ((event.which === 10 || event.which === 13) && event.ctrlKey) {
+ saveLinkWithNote();
+ return false;
+ }
+
+ return true;
+});
+
+$("#save-link-with-note-button").on("click", () => {
+ $saveLinkWithNoteWrapper.show();
+
+ $textNote[0].focus();
+});
+
+$("#cancel-button").on("click", () => {
+ $saveLinkWithNoteWrapper.hide();
+ $textNote.val("");
+
+ window.close();
+});
+
+async function saveLinkWithNote() {
+ const textNoteVal = $textNote.val().trim();
+ let title, content;
+
+ if (!textNoteVal) {
+ title = '';
+ content = '';
+ }
+ else if ($keepTitle[0].checked){
+ title = '';
+ content = textNoteVal;
+ }
+ else {
+ const match = /^(.*?)([.?!]\s|\n)/.exec(textNoteVal);
+
+ if (match) {
+ title = match[0].trim();
+ content = textNoteVal.substr(title.length).trim();
+ }
+ else {
+ title = textNoteVal;
+ content = '';
+ }
+ }
+
+ content = escapeHtml(content);
+
+ const result = await sendMessage({name: 'save-link-with-note', title, content});
+
+ if (result) {
+ $textNote.val('');
+
+ window.close();
+ }
+}
+
+$("#save-button").on("click", saveLinkWithNote);
+
+$("#show-help-button").on("click", () => {
+ window.open("https://github.com/zadam/trilium/wiki/Web-clipper", '_blank');
+});
+
+function escapeHtml(string) {
+ const pre = document.createElement('pre');
+ const text = document.createTextNode(string);
+ pre.appendChild(text);
+
+ const htmlWithPars = pre.innerHTML.replace(/\n/g, "
");
+
+ return '
' + htmlWithPars + '
';
+}
+
+const $connectionStatus = $("#connection-status");
+const $needsConnection = $(".needs-connection");
+const $alreadyVisited = $("#already-visited");
+
+browser.runtime.onMessage.addListener(request => {
+ if (request.name === 'trilium-search-status') {
+ const {triliumSearch} = request;
+
+ let statusText = triliumSearch.status;
+ let isConnected;
+
+ if (triliumSearch.status === 'not-found') {
+ statusText = `Not found `;
+ isConnected = false;
+ }
+ else if (triliumSearch.status === 'version-mismatch') {
+ const whatToUpgrade = triliumSearch.extensionMajor > triliumSearch.triliumMajor ? "Trilium Notes" : "this extension";
+
+ statusText = `Trilium instance found, but it is not compatible with this extension version. Please update ${whatToUpgrade} to the latest version. `;
+ isConnected = true;
+ }
+ else if (triliumSearch.status === 'found-desktop') {
+ statusText = `Connected on port ${triliumSearch.port} `;
+ isConnected = true;
+ }
+ else if (triliumSearch.status === 'found-server') {
+ statusText = `Connected to the server `;
+ isConnected = true;
+ }
+
+ $connectionStatus.html(statusText);
+
+ if (isConnected) {
+ $needsConnection.removeAttr("disabled");
+ $needsConnection.removeAttr("title");
+ browser.runtime.sendMessage({name: "trigger-trilium-search-note-url"});
+ }
+ else {
+ $needsConnection.attr("disabled", "disabled");
+ $needsConnection.attr("title", "This action can't be performed without active connection to Trilium.");
+ }
+ }
+ else if (request.name == "trilium-previously-visited"){
+ const {searchNote} = request;
+ if (searchNote.status === 'found'){
+ const a = createLink({name: 'openNoteInTrilium', noteId: searchNote.noteId},
+ "Open in Trilium.")
+ noteFound = `Already visited website!`;
+ $alreadyVisited.html(noteFound);
+ $alreadyVisited[0].appendChild(a);
+ }else{
+ $alreadyVisited.html('');
+ }
+
+
+ }
+});
+
+const $checkConnectionButton = $("#check-connection-button");
+
+$checkConnectionButton.on("click", () => {
+ browser.runtime.sendMessage({
+ name: "trigger-trilium-search"
+ })
+});
+
+$(() => browser.runtime.sendMessage({name: "send-trilium-search-status"}));
diff --git a/apps/web-clipper/trilium-web-clipper.iml b/apps/web-clipper/trilium-web-clipper.iml
new file mode 100644
index 000000000..c3e779f97
--- /dev/null
+++ b/apps/web-clipper/trilium-web-clipper.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/apps/web-clipper/trilium_server_facade.js b/apps/web-clipper/trilium_server_facade.js
new file mode 100644
index 000000000..6f46893e5
--- /dev/null
+++ b/apps/web-clipper/trilium_server_facade.js
@@ -0,0 +1,225 @@
+const PROTOCOL_VERSION_MAJOR = 1;
+
+function isDevEnv() {
+ const manifest = browser.runtime.getManifest();
+
+ return manifest.name.endsWith('(dev)');
+}
+
+class TriliumServerFacade {
+ constructor() {
+ this.triggerSearchForTrilium();
+
+ // continually scan for changes (if e.g. desktop app is started after browser)
+ setInterval(() => this.triggerSearchForTrilium(), 60 * 1000);
+ }
+
+ async sendTriliumSearchStatusToPopup() {
+ try {
+ await browser.runtime.sendMessage({
+ name: "trilium-search-status",
+ triliumSearch: this.triliumSearch
+ });
+ }
+ catch (e) {} // nothing might be listening
+ }
+ async sendTriliumSearchNoteToPopup(){
+ try{
+ await browser.runtime.sendMessage({
+ name: "trilium-previously-visited",
+ searchNote: this.triliumSearchNote
+ })
+
+ }
+ catch (e) {} // nothing might be listening
+ }
+
+ setTriliumSearchNote(st){
+ this.triliumSearchNote = st;
+ this.sendTriliumSearchNoteToPopup();
+ }
+
+ setTriliumSearch(ts) {
+ this.triliumSearch = ts;
+
+ this.sendTriliumSearchStatusToPopup();
+ }
+
+ setTriliumSearchWithVersionCheck(json, resp) {
+ const [major, minor] = json.protocolVersion
+ .split(".")
+ .map(chunk => parseInt(chunk));
+
+ // minor version is intended to be used to dynamically limit features provided by extension
+ // if some specific Trilium API is not supported. So far not needed.
+
+ if (major !== PROTOCOL_VERSION_MAJOR) {
+ this.setTriliumSearch({
+ status: 'version-mismatch',
+ extensionMajor: PROTOCOL_VERSION_MAJOR,
+ triliumMajor: major
+ });
+ }
+ else {
+ this.setTriliumSearch(resp);
+ }
+ }
+
+ async triggerSearchForTrilium() {
+ this.setTriliumSearch({ status: 'searching' });
+
+ try {
+ const port = await this.getPort();
+
+ console.debug('Trying port ' + port);
+
+ const resp = await fetch(`http://127.0.0.1:${port}/api/clipper/handshake`);
+
+ const text = await resp.text();
+
+ console.log("Received response:", text);
+
+ const json = JSON.parse(text);
+
+ if (json.appName === 'trilium') {
+ this.setTriliumSearchWithVersionCheck(json, {
+ status: 'found-desktop',
+ port: port,
+ url: 'http://127.0.0.1:' + port
+ });
+
+ return;
+ }
+ }
+ catch (error) {
+ // continue
+ }
+
+ const {triliumServerUrl} = await browser.storage.sync.get("triliumServerUrl");
+ const {authToken} = await browser.storage.sync.get("authToken");
+
+ if (triliumServerUrl && authToken) {
+ try {
+ const resp = await fetch(triliumServerUrl + '/api/clipper/handshake', {
+ headers: {
+ Authorization: authToken
+ }
+ });
+
+ const text = await resp.text();
+
+ console.log("Received response:", text);
+
+ const json = JSON.parse(text);
+
+ if (json.appName === 'trilium') {
+ this.setTriliumSearchWithVersionCheck(json, {
+ status: 'found-server',
+ url: triliumServerUrl,
+ token: authToken
+ });
+
+ return;
+ }
+ }
+ catch (e) {
+ console.log("Request to the configured server instance failed with:", e);
+ }
+ }
+
+ // if all above fails it's not found
+ this.setTriliumSearch({ status: 'not-found' });
+ }
+
+ async triggerSearchNoteByUrl(noteUrl) {
+ const resp = await triliumServerFacade.callService('GET', 'notes-by-url/' + encodeURIComponent(noteUrl))
+ let newStatus = {
+ status: 'not-found',
+ noteId: null
+ }
+ if (resp && resp.noteId) {
+ newStatus.noteId = resp.noteId;
+ newStatus.status = 'found';
+ }
+ this.setTriliumSearchNote(newStatus);
+ }
+ async waitForTriliumSearch() {
+ return new Promise((res, rej) => {
+ const checkStatus = () => {
+ if (this.triliumSearch.status === "searching") {
+ setTimeout(checkStatus, 500);
+ }
+ else if (this.triliumSearch.status === 'not-found') {
+ rej(new Error("Trilium instance has not been found."));
+ }
+ else {
+ res();
+ }
+ };
+
+ checkStatus();
+ });
+ }
+
+ async getPort() {
+ const {triliumDesktopPort} = await browser.storage.sync.get("triliumDesktopPort");
+
+ if (triliumDesktopPort) {
+ return parseInt(triliumDesktopPort);
+ }
+ else {
+ return isDevEnv() ? 37740 : 37840;
+ }
+ }
+
+ async callService(method, path, body) {
+ const fetchOptions = {
+ method: method,
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ };
+
+ if (body) {
+ fetchOptions.body = typeof body === 'string' ? body : JSON.stringify(body);
+ }
+
+ try {
+ await this.waitForTriliumSearch();
+
+ fetchOptions.headers.Authorization = this.triliumSearch.token || "";
+ fetchOptions.headers['trilium-local-now-datetime'] = this.localNowDateTime();
+
+ const url = this.triliumSearch.url + "/api/clipper/" + path;
+
+ console.log(`Sending ${method} request to ${url}`);
+
+ const response = await fetch(url, fetchOptions);
+
+ if (!response.ok) {
+ throw new Error(await response.text());
+ }
+
+ return await response.json();
+ }
+ catch (e) {
+ console.log("Sending request to trilium failed", e);
+
+ toast('Your request failed because we could not contact Trilium instance. Please make sure Trilium is running and is accessible.');
+
+ return null;
+ }
+ }
+
+ localNowDateTime() {
+ const date = new Date();
+ const off = date.getTimezoneOffset();
+ const absoff = Math.abs(off);
+ return (new Date(date.getTime() - off * 60 * 1000).toISOString().substr(0,23).replace("T", " ") +
+ (off > 0 ? '-' : '+') +
+ (absoff / 60).toFixed(0).padStart(2,'0') + ':' +
+ (absoff % 60).toString().padStart(2,'0'));
+ }
+}
+
+window.triliumServerFacade = new TriliumServerFacade();
diff --git a/apps/web-clipper/utils.js b/apps/web-clipper/utils.js
new file mode 100644
index 000000000..9ec82b2c2
--- /dev/null
+++ b/apps/web-clipper/utils.js
@@ -0,0 +1,28 @@
+function randomString(len) {
+ let text = "";
+ const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+
+ for (let i = 0; i < len; i++) {
+ text += possible.charAt(Math.floor(Math.random() * possible.length));
+ }
+
+ return text;
+}
+
+function getBaseUrl() {
+ let output = getPageLocationOrigin() + location.pathname;
+
+ if (output[output.length - 1] !== '/') {
+ output = output.split('/');
+ output.pop();
+ output = output.join('/');
+ }
+
+ return output;
+}
+
+function getPageLocationOrigin() {
+ // location.origin normally returns the protocol + domain + port (eg. https://example.com:8080)
+ // but for file:// protocol this is browser dependant and in particular Firefox returns "null" in this case.
+ return location.protocol === 'file:' ? 'file://' : location.origin;
+}
diff --git a/docs/Release Notes/Release Notes/v0.94.0.md b/docs/Release Notes/Release Notes/v0.94.0.md
index 2d255509e..81e86b293 100644
--- a/docs/Release Notes/Release Notes/v0.94.0.md
+++ b/docs/Release Notes/Release Notes/v0.94.0.md
@@ -27,6 +27,8 @@
* [The update button is sometimes blank](https://github.com/TriliumNext/Notes/pull/1975) by @SiriusXT
* [Unable to handle multi line mathematical formulas when importing markdown](https://github.com/TriliumNext/Notes/pull/1984) by @SiriusXT
* Calendar: became invisible if resizing while not visible
+* [GPX track not rendering on geomap note](https://github.com/TriliumNext/Notes/issues/2085)
+* [GPX icons not working](https://github.com/TriliumNext/Notes/issues/1772)
## ✨ Improvements
@@ -60,6 +62,9 @@
* [improve tab scroll UX by switching from instant to smooth behavior](https://github.com/TriliumNext/Notes/pull/2030) by @SiriusXT
* Calendar view: display calendar view if `#viewType=calendar` is set.
* [Mind map: add search support](https://github.com/TriliumNext/Notes/pull/2055) by @SiriusXT
+* Geo map:
+ * The name, icon and color of the track note are displayed as the starting point.
+ * Added a distinct icon for the end marker.
## 📖 Documentation
diff --git a/docs/User Guide/!!!meta.json b/docs/User Guide/!!!meta.json
index 705ee5099..c6ccb941d 100644
--- a/docs/User Guide/!!!meta.json
+++ b/docs/User Guide/!!!meta.json
@@ -4086,12 +4086,33 @@
"isInheritable": false,
"position": 30
},
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "iPIMuisry3hd",
+ "isInheritable": false,
+ "position": 40
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "oiVPnW8QfnvS",
+ "isInheritable": false,
+ "position": 50
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "QrtTYPmdd1qq",
+ "isInheritable": false,
+ "position": 60
+ },
{
"type": "relation",
"name": "internalLink",
"value": "eIg8jdvaoNNd",
"isInheritable": false,
- "position": 80
+ "position": 70
},
{
"type": "label",
@@ -4106,27 +4127,6 @@
"value": "bx bxs-keyboard",
"isInheritable": false,
"position": 80
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "iPIMuisry3hd",
- "isInheritable": false,
- "position": 90
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "oiVPnW8QfnvS",
- "isInheritable": false,
- "position": 100
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "QrtTYPmdd1qq",
- "isInheritable": false,
- "position": 110
}
],
"format": "markdown",
@@ -6121,39 +6121,39 @@
"mime": "text/html",
"attributes": [
{
- "type": "label",
- "name": "iconClass",
- "value": "bx bxs-keyboard",
+ "type": "relation",
+ "name": "internalLink",
+ "value": "UYuUB1ZekNQU",
"isInheritable": false,
- "position": 30
+ "position": 10
},
{
"type": "relation",
"name": "internalLink",
"value": "MI26XDLSAlCD",
"isInheritable": false,
- "position": 40
+ "position": 20
},
{
"type": "relation",
"name": "internalLink",
"value": "QEAPj01N5f7w",
"isInheritable": false,
- "position": 50
- },
- {
- "type": "relation",
- "name": "internalLink",
- "value": "UYuUB1ZekNQU",
- "isInheritable": false,
- "position": 60
+ "position": 30
},
{
"type": "relation",
"name": "internalLink",
"value": "YfYAtQBcfo5V",
"isInheritable": false,
- "position": 70
+ "position": 40
+ },
+ {
+ "type": "label",
+ "name": "iconClass",
+ "value": "bx bxs-keyboard",
+ "isInheritable": false,
+ "position": 30
}
],
"format": "markdown",
@@ -10727,11 +10727,65 @@
"value": "bx bxs-data",
"isInheritable": false,
"position": 10
+ },
+ {
+ "type": "relation",
+ "name": "internalLink",
+ "value": "bOP3TB56fL1V",
+ "isInheritable": false,
+ "position": 20
}
],
"format": "markdown",
"dataFileName": "Metrics.md",
- "attachments": []
+ "attachments": [
+ {
+ "attachmentId": "6FcnvEg39b88",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "Metrics_image.png"
+ },
+ {
+ "attachmentId": "amOIi8fzVhSM",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "1_Metrics_image.png"
+ },
+ {
+ "attachmentId": "Ojj9cAXPbxJO",
+ "title": "image.png",
+ "role": "image",
+ "mime": "image/png",
+ "position": 10,
+ "dataFileName": "2_Metrics_image.png"
+ }
+ ],
+ "dirFileName": "Metrics",
+ "children": [
+ {
+ "isClone": false,
+ "noteId": "bOP3TB56fL1V",
+ "notePath": [
+ "pOsGYCXsbNQG",
+ "tC7s2alapj8V",
+ "uYF7pmepw27K",
+ "bOP3TB56fL1V"
+ ],
+ "title": "grafana-dashboard.json",
+ "notePosition": 10,
+ "prefix": null,
+ "isExpanded": false,
+ "type": "code",
+ "mime": "application/json",
+ "attributes": [],
+ "dataFileName": "grafana-dashboard.json",
+ "attachments": []
+ }
+ ]
}
]
},
diff --git a/docs/User Guide/User Guide/Advanced Usage/1_Metrics_image.png b/docs/User Guide/User Guide/Advanced Usage/1_Metrics_image.png
new file mode 100644
index 000000000..683789547
Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/1_Metrics_image.png differ
diff --git a/docs/User Guide/User Guide/Advanced Usage/2_Metrics_image.png b/docs/User Guide/User Guide/Advanced Usage/2_Metrics_image.png
new file mode 100644
index 000000000..08181d986
Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/2_Metrics_image.png differ
diff --git a/docs/User Guide/User Guide/Advanced Usage/Metrics.md b/docs/User Guide/User Guide/Advanced Usage/Metrics.md
index a99da0c95..ef0c7b3b5 100644
--- a/docs/User Guide/User Guide/Advanced Usage/Metrics.md
+++ b/docs/User Guide/User Guide/Advanced Usage/Metrics.md
@@ -105,4 +105,16 @@ scrape_configs:
* `400` - Invalid format parameter
* `401` - Missing or invalid ETAPI token
-* `500` - Internal server error
\ No newline at end of file
+* `500` - Internal server error
+
+## **Grafana Dashboard**
+
+
+
+You can also use the Grafana Dashboard that has been created for TriliumNext - just take the JSON from grafana-dashboard.json and then import the dashboard, following these screenshots:
+
+
+
+Then paste the JSON, and hit load:
+
+
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json b/docs/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json
new file mode 100644
index 000000000..2e1e4511e
--- /dev/null
+++ b/docs/User Guide/User Guide/Advanced Usage/Metrics/grafana-dashboard.json
@@ -0,0 +1,1335 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "builtIn": 1,
+ "datasource": {
+ "type": "grafana",
+ "uid": "-- Grafana --"
+ },
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "fiscalYearStartMonth": 0,
+ "graphTooltip": 1,
+ "id": 549,
+ "links": [],
+ "panels": [
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 0
+ },
+ "id": 100,
+ "panels": [],
+ "title": "🏠 Trilium Overview",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Current Trilium version and build information",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "custom": {
+ "align": "auto",
+ "cellOptions": {
+ "type": "auto"
+ },
+ "filterable": false,
+ "inspect": false
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ }
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 12,
+ "x": 0,
+ "y": 1
+ },
+ "id": 101,
+ "options": {
+ "cellHeight": "sm",
+ "footer": {
+ "countRows": false,
+ "fields": "",
+ "reducer": [
+ "sum"
+ ],
+ "show": false
+ },
+ "showHeader": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_info{job=~'$job',instance=~'$instance'}",
+ "format": "table",
+ "instant": true,
+ "refId": "A"
+ }
+ ],
+ "title": "📋 Instance Information",
+ "transformations": [
+ {
+ "id": "organize",
+ "options": {
+ "excludeByName": {
+ "Time": true,
+ "Value": true,
+ "__name__": true,
+ "instance": true,
+ "job": true
+ },
+ "indexByName": {},
+ "renameByName": {
+ "build_date": "Build Date",
+ "build_revision": "Git Revision",
+ "db_version": "DB Version",
+ "node_version": "Node.js",
+ "sync_version": "Sync Version",
+ "version": "Version"
+ }
+ }
+ }
+ ],
+ "type": "table"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Database file size in human-readable format",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "yellow",
+ "value": 500000000
+ },
+ {
+ "color": "red",
+ "value": 1000000000
+ }
+ ]
+ },
+ "unit": "decbytes"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 1
+ },
+ "id": 102,
+ "options": {
+ "colorMode": "background",
+ "graphMode": "area",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_database_size_bytes{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "💾 Database Size",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Total active notes in your Trilium instance",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ },
+ {
+ "color": "yellow",
+ "value": 1000
+ },
+ {
+ "color": "red",
+ "value": 5000
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 18,
+ "y": 1
+ },
+ "id": 103,
+ "options": {
+ "colorMode": "background",
+ "graphMode": "area",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "📝 Active Notes",
+ "type": "stat"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 7
+ },
+ "id": 200,
+ "panels": [],
+ "title": "📊 Key Metrics",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Total notes including deleted ones",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [],
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 0,
+ "y": 8
+ },
+ "id": 201,
+ "options": {
+ "legend": {
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": []
+ },
+ "pieType": "pie",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Active Notes",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_deleted{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Deleted Notes",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_protected{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Protected Notes",
+ "refId": "C"
+ }
+ ],
+ "title": "📝 Notes Distribution",
+ "type": "piechart"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Breakdown of attachments by MIME type",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [],
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 6,
+ "x": 6,
+ "y": 8
+ },
+ "id": 202,
+ "options": {
+ "legend": {
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true,
+ "values": []
+ },
+ "pieType": "donut",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attachments_by_type{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "{{mime_type}}",
+ "refId": "A"
+ }
+ ],
+ "title": "🖼️ Attachments by Type",
+ "type": "piechart"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Distribution of notes by their content type",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ }
+ },
+ "mappings": [],
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 8
+ },
+ "id": 203,
+ "options": {
+ "legend": {
+ "displayMode": "table",
+ "placement": "right",
+ "showLegend": true,
+ "values": [
+ "value",
+ "percent"
+ ]
+ },
+ "pieType": "donut",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_by_type{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "{{type}}",
+ "refId": "A"
+ }
+ ],
+ "title": "📄 Notes by Content Type",
+ "type": "piechart"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 16
+ },
+ "id": 300,
+ "panels": [],
+ "title": "📈 Trends & Time Series",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Growth of notes over time",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 20,
+ "gradientMode": "hue",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "smooth",
+ "lineWidth": 3,
+ "pointSize": 8,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Active Notes"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "blue",
+ "mode": "fixed"
+ }
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Total Notes"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "green",
+ "mode": "fixed"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 17
+ },
+ "id": 301,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last",
+ "max"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_active{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Active Notes",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_notes_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Total Notes",
+ "refId": "B"
+ }
+ ],
+ "title": "📈 Notes Growth Over Time",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Attachment storage trends",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 20,
+ "gradientMode": "hue",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "smooth",
+ "lineWidth": 3,
+ "pointSize": 8,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Active Attachments"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "purple",
+ "mode": "fixed"
+ }
+ }
+ ]
+ },
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Total Attachments"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "orange",
+ "mode": "fixed"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 17
+ },
+ "id": 302,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last",
+ "max"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attachments_active{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Active Attachments",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attachments_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Total Attachments",
+ "refId": "B"
+ }
+ ],
+ "title": "📎 Attachments Growth Over Time",
+ "type": "timeseries"
+ },
+ {
+ "collapsed": false,
+ "gridPos": {
+ "h": 1,
+ "w": 24,
+ "x": 0,
+ "y": 25
+ },
+ "id": 400,
+ "panels": [],
+ "title": "🔧 Advanced Metrics",
+ "type": "row"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of branches connecting notes",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 0,
+ "y": 26
+ },
+ "id": 401,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_branches_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🌳 Total Branches",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of note attributes",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 6,
+ "y": 26
+ },
+ "id": 402,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_attributes_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🏷️ Attributes",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of note revisions",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 12,
+ "y": 26
+ },
+ "id": 403,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_revisions_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🔄 Revisions",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Number of ETAPI tokens",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "thresholds"
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 4,
+ "w": 6,
+ "x": 18,
+ "y": 26
+ },
+ "id": 404,
+ "options": {
+ "colorMode": "value",
+ "graphMode": "none",
+ "justifyMode": "center",
+ "orientation": "auto",
+ "percentChangeColorMode": "standard",
+ "reduceOptions": {
+ "calcs": [
+ "lastNotNull"
+ ],
+ "fields": "",
+ "values": false
+ },
+ "showPercentChange": false,
+ "textMode": "auto",
+ "wideLayout": true
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_etapi_tokens_total{job=~'$job',instance=~'$instance'}",
+ "refId": "A"
+ }
+ ],
+ "title": "🔑 API Tokens",
+ "type": "stat"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Various storage and system metrics",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "line",
+ "fillOpacity": 10,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 2,
+ "pointSize": 5,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "auto",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "short"
+ },
+ "overrides": [
+ {
+ "matcher": {
+ "id": "byName",
+ "options": "Recent Notes"
+ },
+ "properties": [
+ {
+ "id": "color",
+ "value": {
+ "fixedColor": "yellow",
+ "mode": "fixed"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 0,
+ "y": 30
+ },
+ "id": 405,
+ "options": {
+ "legend": {
+ "calcs": [
+ "last"
+ ],
+ "displayMode": "table",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "multi",
+ "sort": "desc"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_blobs_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Blob Records",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_recent_notes_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Recent Notes",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_embeddings_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Embeddings",
+ "refId": "C"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_embedding_providers_total{job=~'$job',instance=~'$instance'}",
+ "legendFormat": "Embedding Providers",
+ "refId": "D"
+ }
+ ],
+ "title": "📊 Storage & System Metrics",
+ "type": "timeseries"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "description": "Timeline showing when content was created and last modified",
+ "fieldConfig": {
+ "defaults": {
+ "color": {
+ "mode": "palette-classic"
+ },
+ "custom": {
+ "axisBorderShow": false,
+ "axisCenteredZero": false,
+ "axisColorMode": "text",
+ "axisLabel": "",
+ "axisPlacement": "auto",
+ "barAlignment": 0,
+ "barWidthFactor": 0.6,
+ "drawStyle": "points",
+ "fillOpacity": 0,
+ "gradientMode": "none",
+ "hideFrom": {
+ "legend": false,
+ "tooltip": false,
+ "viz": false
+ },
+ "insertNulls": false,
+ "lineInterpolation": "linear",
+ "lineWidth": 1,
+ "pointSize": 8,
+ "scaleDistribution": {
+ "type": "linear"
+ },
+ "showPoints": "always",
+ "spanNulls": false,
+ "stacking": {
+ "group": "A",
+ "mode": "none"
+ },
+ "thresholdsStyle": {
+ "mode": "off"
+ }
+ },
+ "mappings": [],
+ "thresholds": {
+ "mode": "absolute",
+ "steps": [
+ {
+ "color": "green"
+ }
+ ]
+ },
+ "unit": "dateTimeAsIso"
+ },
+ "overrides": []
+ },
+ "gridPos": {
+ "h": 8,
+ "w": 12,
+ "x": 12,
+ "y": 30
+ },
+ "id": 406,
+ "options": {
+ "legend": {
+ "calcs": [],
+ "displayMode": "list",
+ "placement": "bottom",
+ "showLegend": true
+ },
+ "tooltip": {
+ "hideZeros": false,
+ "mode": "single",
+ "sort": "none"
+ }
+ },
+ "pluginVersion": "12.0.1",
+ "targets": [
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_oldest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000",
+ "legendFormat": "Oldest Note",
+ "refId": "A"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_newest_note_timestamp{job=~'$job',instance=~'$instance'} * 1000",
+ "legendFormat": "Newest Note",
+ "refId": "B"
+ },
+ {
+ "datasource": {
+ "uid": "${datasource}"
+ },
+ "expr": "trilium_last_modified_timestamp{job=~'$job',instance=~'$instance'} * 1000",
+ "legendFormat": "Last Modified",
+ "refId": "C"
+ }
+ ],
+ "title": "⏰ Content Timeline",
+ "type": "timeseries"
+ }
+ ],
+ "preload": false,
+ "refresh": "1m",
+ "schemaVersion": 41,
+ "tags": [
+ "trilium",
+ "notes",
+ "monitoring",
+ "enhanced"
+ ],
+ "templating": {
+ "list": [
+ {
+ "current": {
+ "text": "myprom",
+ "value": "PA04845DA3A4B088E"
+ },
+ "includeAll": false,
+ "label": "Datasource",
+ "name": "datasource",
+ "options": [],
+ "query": "prometheus",
+ "refresh": 1,
+ "regex": "//",
+ "type": "datasource"
+ },
+ {
+ "allValue": ".*",
+ "current": {
+ "text": "All",
+ "value": "$__all"
+ },
+ "datasource": {
+ "UID": "",
+ "type": ""
+ },
+ "includeAll": true,
+ "label": "Job",
+ "multi": true,
+ "name": "job",
+ "options": [],
+ "query": "query_result(up)",
+ "refresh": 1,
+ "regex": "/job=\"([^\"]+)\"/",
+ "sort": 1,
+ "type": "query"
+ },
+ {
+ "allValue": ".*",
+ "current": {
+ "text": [
+ "All"
+ ],
+ "value": [
+ "$__all"
+ ]
+ },
+ "datasource": {
+ "type": "prometheus",
+ "uid": "${datasource}"
+ },
+ "includeAll": true,
+ "label": "Instance",
+ "multi": true,
+ "name": "instance",
+ "options": [],
+ "query": "trilium_database_size_bytes",
+ "refresh": 1,
+ "regex": "/instance=\"([^\"]+)\"/",
+ "sort": 1,
+ "type": "query"
+ }
+ ]
+ },
+ "time": {
+ "from": "now-1h",
+ "to": "now"
+ },
+ "timepicker": {},
+ "timezone": "browser",
+ "title": "TriliumNext Dashboard",
+ "uid": "06993f9b-a477-4723-bf18-47743393b382",
+ "version": 5
+}
\ No newline at end of file
diff --git a/docs/User Guide/User Guide/Advanced Usage/Metrics_image.png b/docs/User Guide/User Guide/Advanced Usage/Metrics_image.png
new file mode 100644
index 000000000..ae68ddd02
Binary files /dev/null and b/docs/User Guide/User Guide/Advanced Usage/Metrics_image.png differ
diff --git a/docs/User Guide/User Guide/Note Types/Geo Map.md b/docs/User Guide/User Guide/Note Types/Geo Map.md
index 718cca506..78237cad3 100644
--- a/docs/User Guide/User Guide/Note Types/Geo Map.md
+++ b/docs/User Guide/User Guide/Note Types/Geo Map.md
@@ -5,7 +5,7 @@ This note type displays the children notes on a geographical map, based on an at
## Creating a new geo map
-
1 Right click on any note on the note tree and select Insert child note → Geo Map (beta) . 2 By default the map will be empty and will show the entire world.
+
1 Right click on any note on the note tree and select Insert child note → Geo Map (beta) . 2 By default the map will be empty and will show the entire world.
## Repositioning the map
@@ -60,7 +60,7 @@ The value of the attribute is made up of the latitude and longitude separated by
### Adding from Google Maps
-
1 Go to Google Maps on the web and look for a desired location, right click on it and a context menu will show up. Simply click on the first item displaying the coordinates and they will be copied to clipboard. Then paste the value inside the text box into the #geolocation
attribute of a child note of the map (don't forget to surround the value with a "
character). 2 In Trilium, create a child note under the map. 3 And then go to Owned Attributes and type #geolocation="
, then paste from the clipboard as-is and then add the ending "
character. Press Enter to confirm and the map should now be updated to contain the new note.
+
1 Go to Google Maps on the web and look for a desired location, right click on it and a context menu will show up. Simply click on the first item displaying the coordinates and they will be copied to clipboard. Then paste the value inside the text box into the #geolocation
attribute of a child note of the map (don't forget to surround the value with a "
character). 2 In Trilium, create a child note under the map. 3 And then go to Owned Attributes and type #geolocation="
, then paste from the clipboard as-is and then add the ending "
character. Press Enter to confirm and the map should now be updated to contain the new note.
### Adding from OpenStreetMap
@@ -74,6 +74,11 @@ Trilium has basic support for displaying GPS tracks on the geo map.
1 To add a track, simply drag & drop a .gpx file inside the geo map in the note tree. 2 In order for the file to be recognized as a GPS track, it needs to show up as application/gpx+xml
in the File type field. 3 When going back to the map, the track should now be visible. The start and end points of the track are indicated by the two blue markers.
+> [!NOTE]
+> The starting point of the track will be displayed as a marker, with the name of the note underneath. The start marker will also respect the icon and the `color` of the note. The end marker is displayed with a distinct icon.
+>
+> If the GPX contains waypoints, they will also be displayed. If they have a name, it is displayed when hovering over it with the mouse.
+
## Troubleshooting
diff --git a/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.md b/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.md
index efd114e07..49ce6e228 100644
--- a/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.md
+++ b/docs/User Guide/User Guide/Note Types/Text/Keyboard shortcuts.md
@@ -1,7 +1,7 @@
# Keyboard shortcuts
## Trilium-specific shortcuts
-
Action PC Mac Bring up inline formatting toolbar (arrow keys ← ,→ to navigate, Enter to apply) Alt +F10 ⌥ +F10 Bring up block formatting toolbar Alt +F10 ⌥ +F10 Create external link Ctrl +K ⌘ +K Create internal (note) link Ctrl +L ⌘ +L Inserts current date and time at caret position Alt +T ⌥ +T Increase paragraph indentation Tab ⇥ Decrease paragraph indentation Shift + Tab ⇧ + ⇥ Mark selected text as keyboard shortcut Ctrl + Alt + K ⌘ + ⌥ + K Insert Math Equations Ctrl + M ⌘ + M Move blocks (lists, paragraphs, etc.) up Ctrl +↑ ⌘ +↑ Alt +↑ ⌥ +↑ Move blocks (lists, paragraphs, etc.) down Ctrl +↑ ⌘ +↑ Alt +↓ ⌥ +↓
+
Action PC Mac Bring up inline formatting toolbar (arrow keys ← ,→ to navigate, Enter to apply) Alt +F10 ⌥ +F10 Bring up block formatting toolbar Alt +F10 ⌥ +F10 Create external link Ctrl +K ⌘ +K Create internal (note) link Ctrl +L ⌘ +L Inserts current date and time at caret position Alt +T ⌥ +T Increase paragraph indentation Tab ⇥ Decrease paragraph indentation Shift + Tab ⇧ + ⇥ Mark selected text as keyboard shortcut Ctrl + Alt + K ⌘ + ⌥ + K Insert Math Equations Ctrl + M ⌘ + M Move blocks (lists, paragraphs, etc.) up Ctrl +↑ ⌘ +↑ Alt +↑ ⌥ +↑ Move blocks (lists, paragraphs, etc.) down Ctrl +↑ ⌘ +↑ Alt +↓ ⌥ +↓
## Common shortcuts
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 000000000..0aabefa81
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,116 @@
+{
+ "nodes": {
+ "flake-utils": {
+ "inputs": {
+ "systems": "systems"
+ },
+ "locked": {
+ "lastModified": 1731533236,
+ "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "flake-utils_2": {
+ "inputs": {
+ "systems": "systems_2"
+ },
+ "locked": {
+ "lastModified": 1701680307,
+ "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
+ "nixpkgs": {
+ "locked": {
+ "lastModified": 1748437600,
+ "narHash": "sha256-hYKMs3ilp09anGO7xzfGs3JqEgUqFMnZ8GMAqI6/k04=",
+ "owner": "nixos",
+ "repo": "nixpkgs",
+ "rev": "7282cb574e0607e65224d33be8241eae7cfe0979",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nixos",
+ "ref": "nixos-25.05",
+ "repo": "nixpkgs",
+ "type": "github"
+ }
+ },
+ "pnpm2nix": {
+ "inputs": {
+ "flake-utils": "flake-utils_2",
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1748901165,
+ "narHash": "sha256-SctrxW5rVrROBLfh8p4kXfbF7NbJQDkse/Penu4PlEs=",
+ "owner": "FliegendeWurst",
+ "repo": "pnpm2nix-nzbr",
+ "rev": "cda68d63418896a58542f3310c1c757ae92b1f22",
+ "type": "github"
+ },
+ "original": {
+ "owner": "FliegendeWurst",
+ "repo": "pnpm2nix-nzbr",
+ "type": "github"
+ }
+ },
+ "root": {
+ "inputs": {
+ "flake-utils": "flake-utils",
+ "nixpkgs": "nixpkgs",
+ "pnpm2nix": "pnpm2nix"
+ }
+ },
+ "systems": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ },
+ "systems_2": {
+ "locked": {
+ "lastModified": 1681028828,
+ "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+ "owner": "nix-systems",
+ "repo": "default",
+ "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-systems",
+ "repo": "default",
+ "type": "github"
+ }
+ }
+ },
+ "root": "root",
+ "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 000000000..3b3736081
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,225 @@
+{
+ description = "TriliumNext Notes (experimental flake)";
+
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";
+ flake-utils.url = "github:numtide/flake-utils";
+ pnpm2nix = {
+ url = "github:FliegendeWurst/pnpm2nix-nzbr";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs =
+ {
+ self,
+ nixpkgs,
+ flake-utils,
+ pnpm2nix,
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ electron = pkgs.electron_35;
+ nodejs = pkgs.nodejs_22;
+ pnpm = pkgs.pnpm_10;
+ inherit (pkgs)
+ copyDesktopItems
+ darwin
+ lib
+ makeBinaryWrapper
+ makeDesktopItem
+ moreutils
+ removeReferencesTo
+ stdenv
+ wrapGAppsHook3
+ xcodebuild
+ ;
+
+ fullCleanSourceFilter =
+ name: type:
+ (lib.cleanSourceFilter name type)
+ || (
+ let
+ baseName = baseNameOf (toString name);
+ in
+ # No need to copy the flake.
+ # Don't copy local development instance of NX cache.
+ baseName == "flake.nix" || baseName == "flake.lock" || baseName == ".nx"
+ );
+ fullCleanSource =
+ src:
+ lib.cleanSourceWith {
+ filter = fullCleanSourceFilter;
+ src = src;
+ };
+ packageJson = builtins.fromJSON (builtins.readFile ./package.json);
+
+ makeApp =
+ {
+ app,
+ buildTask,
+ mainProgram,
+ installCommands,
+ preBuildCommands ? "",
+ }:
+ pnpm2nix.packages.${system}.mkPnpmPackage rec {
+ pname = "triliumnext-${app}";
+ version = packageJson.version + (lib.optionalString (self ? shortRev) "-${self.shortRev}");
+
+ src = fullCleanSource ./.;
+ packageJSON = ./package.json;
+ pnpmLockYaml = ./pnpm-lock.yaml;
+
+ workspace = fullCleanSource ./.;
+ pnpmWorkspaceYaml = ./pnpm-workspace.yaml;
+
+ inherit nodejs pnpm;
+
+ extraNodeModuleSources = [
+ rec {
+ name = "patches";
+ value = ./patches;
+ }
+ ];
+
+ # remove pnpm version override
+ preConfigure = ''
+ cat package.json | grep -v 'packageManager' | sponge package.json
+ '';
+
+ postConfigure =
+ ''
+ chmod +x node_modules/.pnpm/electron@*/node_modules/electron/install.js
+ patchShebangs --build node_modules
+ ''
+ + lib.optionalString stdenv.hostPlatform.isLinux ''
+ patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+ node_modules/.pnpm/sass-embedded-linux-x64@*/node_modules/sass-embedded-linux-x64/dart-sass/src/dart
+ '';
+
+ extraNativeBuildInputs =
+ [
+ makeBinaryWrapper
+ moreutils # sponge
+ nodejs.python
+ removeReferencesTo
+ ]
+ ++ lib.optionals (app == "desktop") [
+ copyDesktopItems
+ wrapGAppsHook3
+ ]
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
+ xcodebuild
+ darwin.cctools
+ ];
+ dontWrapGApps = true;
+
+ env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
+
+ preBuild = ''
+ ${preBuildCommands}
+ '';
+
+ scriptFull = "pnpm nx ${buildTask} --outputStyle stream --verbose";
+
+ installPhase = ''
+ runHook preInstall
+
+ ${installCommands}
+
+ runHook postInstall
+ '';
+
+ components = [
+ "packages/ckeditor5"
+ "packages/ckeditor5-admonition"
+ "packages/ckeditor5-footnotes"
+ "packages/ckeditor5-keyboard-marker"
+ "packages/ckeditor5-math"
+ "packages/ckeditor5-mermaid"
+ "packages/codemirror"
+ "packages/commons"
+ "packages/express-partial-content"
+ "packages/highlightjs"
+ "packages/turndown-plugin-gfm"
+
+ "apps/client"
+ "apps/db-compare"
+ "apps/desktop"
+ "apps/dump-db"
+ "apps/edit-docs"
+ "apps/server"
+ "apps/server-e2e"
+ ];
+
+ desktopItems = lib.optionals (app == "desktop") [
+ (makeDesktopItem {
+ name = "TriliumNext Notes";
+ exec = meta.mainProgram;
+ icon = "trilium";
+ comment = meta.description;
+ desktopName = "TriliumNext Notes";
+ categories = [ "Office" ];
+ startupWMClass = "Trilium Notes Next";
+ })
+ ];
+
+ meta = {
+ description = "TriliumNext: ${app}";
+ inherit mainProgram;
+ };
+ };
+
+ desktop = makeApp {
+ app = "desktop";
+ preBuildCommands = "export npm_config_nodedir=${electron.headers}";
+ buildTask = "run desktop:rebuild-deps";
+ mainProgram = "trilium";
+ installCommands = ''
+ remove-references-to -t ${electron.headers} apps/desktop/dist/node_modules/better-sqlite3/build/config.gypi
+ remove-references-to -t ${nodejs.python} apps/desktop/dist/node_modules/better-sqlite3/build/config.gypi
+
+ mkdir -p $out/{bin,share/icons/hicolor/512x512/apps,opt/trilium}
+ cp --archive apps/desktop/dist/* $out/opt/trilium
+ cp apps/client/src/assets/icon.png $out/share/icons/hicolor/512x512/apps/trilium.png
+ makeWrapper ${lib.getExe electron} $out/bin/trilium \
+ "''${gappsWrapperArgs[@]}" \
+ --set-default ELECTRON_IS_DEV 0 \
+ --add-flags $out/opt/trilium/main.cjs
+ '';
+ };
+
+ server = makeApp {
+ app = "server";
+ preBuildCommands = "pushd apps/server; pnpm rebuild; popd";
+ buildTask = "--project=server build";
+ mainProgram = "trilium-server";
+ installCommands = ''
+ remove-references-to -t ${nodejs.python} apps/server/dist/node_modules/better-sqlite3/build/config.gypi
+ remove-references-to -t ${pnpm} apps/server/dist/node_modules/better-sqlite3/build/config.gypi
+
+ pushd apps/server/dist
+ rm -rf node_modules/better-sqlite3/build/Release/obj \
+ node_modules/better-sqlite3/build/Release/obj.target \
+ node_modules/better-sqlite3/build/Release/sqlite3.a \
+ node_modules/better-sqlite3/build/{Makefile,better_sqlite3.target.mk,test_extension.target.mk,binding.Makefile} \
+ node_modules/better-sqlite3/deps/sqlite3
+ popd
+
+ mkdir -p $out/{bin,opt/trilium-server}
+ cp --archive apps/server/dist/* $out/opt/trilium-server
+ makeWrapper ${lib.getExe nodejs} $out/bin/trilium-server \
+ --add-flags $out/opt/trilium-server/main.cjs
+ '';
+ };
+ in
+ {
+ packages.desktop = desktop;
+ packages.server = server;
+
+ packages.default = desktop;
+ }
+ );
+}
diff --git a/package.json b/package.json
index ad90e5887..ceebd667f 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"eslint": "^9.8.0",
"eslint-config-prettier": "^10.0.0",
"eslint-plugin-playwright": "^2.0.0",
- "happy-dom": "~17.5.0",
+ "happy-dom": "~17.6.0",
"jiti": "2.4.2",
"jsdom": "~26.1.0",
"jsonc-eslint-parser": "^2.1.0",
@@ -82,7 +82,7 @@
"axios": "^1.6.0",
"express": "^4.21.2"
},
- "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977",
+ "packageManager": "pnpm@10.11.1+sha512.e519b9f7639869dc8d5c3c5dfef73b3f091094b0a006d7317353c72b124e80e1afd429732e28705ad6bfa1ee879c1fce46c128ccebd3192101f43dd67c667912",
"pnpm": {
"patchedDependencies": {
"@ckeditor/ckeditor5-mention": "patches/@ckeditor__ckeditor5-mention.patch",
diff --git a/packages/codemirror/package.json b/packages/codemirror/package.json
index c2e94d271..643d6318f 100644
--- a/packages/codemirror/package.json
+++ b/packages/codemirror/package.json
@@ -61,6 +61,6 @@
"@ssddanbrown/codemirror-lang-twig": "1.0.0",
"codemirror-lang-hcl": "0.1.0",
"codemirror-lang-mermaid": "0.5.0",
- "eslint-linter-browserify": "9.27.0"
+ "eslint-linter-browserify": "9.28.0"
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 4e82e0e70..4e568ae5a 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -47,25 +47,25 @@ importers:
version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5)(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/eslint':
specifier: 21.1.2
- version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
+ version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/eslint-plugin':
specifier: 21.1.2
- version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint-config-prettier@10.1.5(eslint@9.27.0(jiti@2.4.2)))(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)
+ version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-config-prettier@10.1.5(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)
'@nx/express':
specifier: 21.1.2
- version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.27.0(jiti@2.4.2))(express@4.21.2)(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
+ version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.28.0(jiti@2.4.2))(express@4.21.2)(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
'@nx/js':
specifier: 21.1.2
version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/node':
specifier: 21.1.2
- version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
+ version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
'@nx/playwright':
specifier: 21.1.2
- version: 21.1.2(@babel/traverse@7.27.0)(@playwright/test@1.52.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)
+ version: 21.1.2(@babel/traverse@7.27.0)(@playwright/test@1.52.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)
'@nx/vite':
specifier: 21.1.2
- version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)
+ version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.1)
'@nx/web':
specifier: 21.1.2
version: 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
@@ -83,10 +83,10 @@ importers:
version: 22.15.29
'@vitest/coverage-v8':
specifier: ^3.0.5
- version: 3.1.4(@vitest/browser@3.1.4)(vitest@3.1.4)
+ version: 3.2.1(vitest@3.2.1)
'@vitest/ui':
specifier: ^3.0.0
- version: 3.1.4(vitest@3.1.4)
+ version: 3.2.1(vitest@3.2.1)
chalk:
specifier: 5.4.1
version: 5.4.1
@@ -98,16 +98,16 @@ importers:
version: 0.25.5
eslint:
specifier: ^9.8.0
- version: 9.27.0(jiti@2.4.2)
+ version: 9.28.0(jiti@2.4.2)
eslint-config-prettier:
specifier: ^10.0.0
- version: 10.1.5(eslint@9.27.0(jiti@2.4.2))
+ version: 10.1.5(eslint@9.28.0(jiti@2.4.2))
eslint-plugin-playwright:
specifier: ^2.0.0
- version: 2.2.0(eslint@9.27.0(jiti@2.4.2))
+ version: 2.2.0(eslint@9.28.0(jiti@2.4.2))
happy-dom:
- specifier: ~17.5.0
- version: 17.5.6
+ specifier: ~17.6.0
+ version: 17.6.3
jiti:
specifier: 2.4.2
version: 2.4.2
@@ -134,7 +134,7 @@ importers:
version: 5.8.3
typescript-eslint:
specifier: ^8.19.0
- version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
upath:
specifier: 2.0.1
version: 2.0.1
@@ -146,13 +146,13 @@ importers:
version: 4.5.4(@types/node@22.15.29)(rollup@4.40.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
vitest:
specifier: ^3.0.0
- version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ version: 3.2.1(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/ui@3.2.1)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
apps/client:
dependencies:
'@eslint/js':
- specifier: 9.27.0
- version: 9.27.0
+ specifier: 9.28.0
+ version: 9.28.0
'@excalidraw/excalidraw':
specifier: 0.18.0
version: 0.18.0(@types/react-dom@19.1.5(@types/react@19.1.6))(@types/react@19.1.6)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)
@@ -314,8 +314,8 @@ importers:
specifier: 13.0.0
version: 13.0.0(webpack@5.99.9(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5))
happy-dom:
- specifier: 17.5.6
- version: 17.5.6
+ specifier: 17.6.3
+ version: 17.6.3
script-loader:
specifier: 0.7.2
version: 0.7.2
@@ -424,8 +424,8 @@ importers:
specifier: ^7.6.11
version: 7.6.13
'@types/mime-types':
- specifier: ^2.1.4
- version: 2.1.4
+ specifier: ^3.0.0
+ version: 3.0.0
'@types/yargs':
specifier: ^17.0.33
version: 17.0.33
@@ -528,8 +528,8 @@ importers:
specifier: 21.1.7
version: 21.1.7
'@types/mime-types':
- specifier: 2.1.4
- version: 2.1.4
+ specifier: 3.0.0
+ version: 3.0.0
'@types/multer':
specifier: 1.4.12
version: 1.4.12
@@ -699,8 +699,8 @@ importers:
specifier: 3.0.1
version: 3.0.1
multer:
- specifier: 2.0.0
- version: 2.0.0
+ specifier: 2.0.1
+ version: 2.0.1
normalize-strings:
specifier: 1.1.1
version: 1.1.1
@@ -708,8 +708,8 @@ importers:
specifier: 0.5.16
version: 0.5.16
openai:
- specifier: 4.104.0
- version: 4.104.0(encoding@0.1.13)(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.24.4)
+ specifier: 5.1.0
+ version: 5.1.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.24.4)
rand-token:
specifier: 1.0.1
version: 1.0.1
@@ -812,25 +812,25 @@ importers:
version: 3.0.1(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(bufferutil@4.0.9)(esbuild@0.25.5)(utf-8-validate@6.0.5)
'@typescript-eslint/eslint-plugin':
specifier: ~8.33.0
- version: 8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/parser':
specifier: ^8.0.0
- version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@vitest/browser':
specifier: ^3.0.5
- version: 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ version: 3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
'@vitest/coverage-istanbul':
specifier: ^3.0.5
- version: 3.1.4(vitest@3.1.4)
+ version: 3.2.0(vitest@3.2.0)
ckeditor5:
specifier: 45.1.0
version: 45.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
eslint:
specifier: ^9.0.0
- version: 9.27.0(jiti@2.4.2)
+ version: 9.28.0(jiti@2.4.2)
eslint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 10.0.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
http-server:
specifier: ^14.1.0
version: 14.1.1
@@ -839,10 +839,10 @@ importers:
version: 16.1.0
stylelint:
specifier: ^16.0.0
- version: 16.19.1(typescript@5.8.3)
+ version: 16.20.0(typescript@5.8.3)
stylelint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(stylelint@16.19.1(typescript@5.8.3))
+ version: 10.0.0(stylelint@16.20.0(typescript@5.8.3))
ts-node:
specifier: ^10.9.1
version: 10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3)
@@ -854,10 +854,10 @@ importers:
version: 2.0.0(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
vitest:
specifier: ^3.0.5
- version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ version: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
webdriverio:
specifier: ^9.0.7
- version: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ version: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
packages/ckeditor5-footnotes:
devDependencies:
@@ -872,25 +872,25 @@ importers:
version: 3.0.1(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(bufferutil@4.0.9)(esbuild@0.25.5)(utf-8-validate@6.0.5)
'@typescript-eslint/eslint-plugin':
specifier: ~8.33.0
- version: 8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/parser':
specifier: ^8.0.0
- version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@vitest/browser':
specifier: ^3.0.5
- version: 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ version: 3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
'@vitest/coverage-istanbul':
specifier: ^3.0.5
- version: 3.1.4(vitest@3.1.4)
+ version: 3.2.0(vitest@3.2.0)
ckeditor5:
specifier: 45.1.0
version: 45.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
eslint:
specifier: ^9.0.0
- version: 9.27.0(jiti@2.4.2)
+ version: 9.28.0(jiti@2.4.2)
eslint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 10.0.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
http-server:
specifier: ^14.1.0
version: 14.1.1
@@ -899,10 +899,10 @@ importers:
version: 16.1.0
stylelint:
specifier: ^16.0.0
- version: 16.19.1(typescript@5.8.3)
+ version: 16.20.0(typescript@5.8.3)
stylelint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(stylelint@16.19.1(typescript@5.8.3))
+ version: 10.0.0(stylelint@16.20.0(typescript@5.8.3))
ts-node:
specifier: ^10.9.1
version: 10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3)
@@ -914,10 +914,10 @@ importers:
version: 2.0.0(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
vitest:
specifier: ^3.0.5
- version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ version: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
webdriverio:
specifier: ^9.0.7
- version: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ version: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
packages/ckeditor5-keyboard-marker:
devDependencies:
@@ -932,25 +932,25 @@ importers:
version: 3.0.1(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(bufferutil@4.0.9)(esbuild@0.25.5)(utf-8-validate@6.0.5)
'@typescript-eslint/eslint-plugin':
specifier: ~8.33.0
- version: 8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/parser':
specifier: ^8.0.0
- version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@vitest/browser':
specifier: ^3.0.5
- version: 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ version: 3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
'@vitest/coverage-istanbul':
specifier: ^3.0.5
- version: 3.1.4(vitest@3.1.4)
+ version: 3.2.0(vitest@3.2.0)
ckeditor5:
specifier: 45.1.0
version: 45.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
eslint:
specifier: ^9.0.0
- version: 9.27.0(jiti@2.4.2)
+ version: 9.28.0(jiti@2.4.2)
eslint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 10.0.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
http-server:
specifier: ^14.1.0
version: 14.1.1
@@ -959,10 +959,10 @@ importers:
version: 16.1.0
stylelint:
specifier: ^16.0.0
- version: 16.19.1(typescript@5.8.3)
+ version: 16.20.0(typescript@5.8.3)
stylelint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(stylelint@16.19.1(typescript@5.8.3))
+ version: 10.0.0(stylelint@16.20.0(typescript@5.8.3))
ts-node:
specifier: ^10.9.1
version: 10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3)
@@ -974,10 +974,10 @@ importers:
version: 2.0.0(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
vitest:
specifier: ^3.0.5
- version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ version: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
webdriverio:
specifier: ^9.0.7
- version: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ version: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
packages/ckeditor5-math:
dependencies:
@@ -999,25 +999,25 @@ importers:
version: 3.0.1(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(bufferutil@4.0.9)(esbuild@0.25.5)(utf-8-validate@6.0.5)
'@typescript-eslint/eslint-plugin':
specifier: ~8.33.0
- version: 8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/parser':
specifier: ^8.0.0
- version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@vitest/browser':
specifier: ^3.0.5
- version: 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ version: 3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
'@vitest/coverage-istanbul':
specifier: ^3.0.5
- version: 3.1.4(vitest@3.1.4)
+ version: 3.2.0(vitest@3.2.0)
ckeditor5:
specifier: 45.1.0
version: 45.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
eslint:
specifier: ^9.0.0
- version: 9.27.0(jiti@2.4.2)
+ version: 9.28.0(jiti@2.4.2)
eslint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 10.0.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
http-server:
specifier: ^14.1.0
version: 14.1.1
@@ -1026,10 +1026,10 @@ importers:
version: 16.1.0
stylelint:
specifier: ^16.0.0
- version: 16.19.1(typescript@5.8.3)
+ version: 16.20.0(typescript@5.8.3)
stylelint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(stylelint@16.19.1(typescript@5.8.3))
+ version: 10.0.0(stylelint@16.20.0(typescript@5.8.3))
ts-node:
specifier: ^10.9.1
version: 10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3)
@@ -1041,10 +1041,10 @@ importers:
version: 2.0.0(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
vitest:
specifier: ^3.0.5
- version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ version: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
webdriverio:
specifier: ^9.0.7
- version: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ version: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
packages/ckeditor5-mermaid:
dependencies:
@@ -1066,25 +1066,25 @@ importers:
version: 3.0.1(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(bufferutil@4.0.9)(esbuild@0.25.5)(utf-8-validate@6.0.5)
'@typescript-eslint/eslint-plugin':
specifier: ~8.33.0
- version: 8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@typescript-eslint/parser':
specifier: ^8.0.0
- version: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
'@vitest/browser':
specifier: ^3.0.5
- version: 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ version: 3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
'@vitest/coverage-istanbul':
specifier: ^3.0.5
- version: 3.1.4(vitest@3.1.4)
+ version: 3.2.0(vitest@3.2.0)
ckeditor5:
specifier: 45.1.0
version: 45.1.0(patch_hash=8331a09d41443b39ea1c784daaccfeb0da4f9065ed556e7de92e9c77edd9eb41)
eslint:
specifier: ^9.0.0
- version: 9.27.0(jiti@2.4.2)
+ version: 9.28.0(jiti@2.4.2)
eslint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ version: 10.0.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
http-server:
specifier: ^14.1.0
version: 14.1.1
@@ -1093,10 +1093,10 @@ importers:
version: 16.1.0
stylelint:
specifier: ^16.0.0
- version: 16.19.1(typescript@5.8.3)
+ version: 16.20.0(typescript@5.8.3)
stylelint-config-ckeditor5:
specifier: '>=9.1.0'
- version: 10.0.0(stylelint@16.19.1(typescript@5.8.3))
+ version: 10.0.0(stylelint@16.20.0(typescript@5.8.3))
ts-node:
specifier: ^10.9.1
version: 10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3)
@@ -1108,10 +1108,10 @@ importers:
version: 2.0.0(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
vitest:
specifier: ^3.0.5
- version: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ version: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
webdriverio:
specifier: ^9.0.7
- version: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ version: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
packages/codemirror:
dependencies:
@@ -1242,8 +1242,8 @@ importers:
specifier: 0.5.0
version: 0.5.0
eslint-linter-browserify:
- specifier: 9.27.0
- version: 9.27.0
+ specifier: 9.28.0
+ version: 9.28.0
packages/commons: {}
@@ -1426,6 +1426,11 @@ packages:
engines: {node: '>=6.0.0'}
hasBin: true
+ '@babel/parser@7.27.5':
+ resolution: {integrity: sha512-OsQd175SxWkGlzbny8J3K8TnnDD0N3lrIUtB92xwyRpzaenGZhxDvxN/JgU00U3CDZNj9tPuDJ5H0WS4Nt3vKg==}
+ engines: {node: '>=6.0.0'}
+ hasBin: true
+
'@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9':
resolution: {integrity: sha512-ZkRyVkThtxQ/J6nv3JFYv1RYY+JT5BvU0y3k5bWrmuG4woXypRa4PXmm9RhOwodRkYFWqC0C0cqcJ4OqR7kW+g==}
engines: {node: '>=6.9.0'}
@@ -1922,6 +1927,10 @@ packages:
resolution: {integrity: sha512-+EzkxvLNfiUeKMgy/3luqfsCWFRXLb7U6wNQTk60tovuckwB15B191tJWvpp4HjiQWdJkCxO3Wbvc6jlk3Xb2Q==}
engines: {node: '>=6.9.0'}
+ '@babel/types@7.27.3':
+ resolution: {integrity: sha512-Y1GkI4ktrtvmawoSq+4FCVHNryea6uR+qUQy0AGxLSsjCX0nVmkYQMBLHDkXZuo5hGx7eYdnIaslsdBFm7zbUw==}
+ engines: {node: '>=6.9.0'}
+
'@bcoe/v8-coverage@0.2.3':
resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
@@ -2591,8 +2600,8 @@ packages:
resolution: {integrity: sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@eslint/config-helpers@0.2.1':
- resolution: {integrity: sha512-RI17tsD2frtDu/3dmI7QRrD4bedNKPM08ziRYaC5AhkGrzIAJelm9kJU1TznK+apx6V+cqRz8tfpEeG3oIyjxw==}
+ '@eslint/config-helpers@0.2.2':
+ resolution: {integrity: sha512-+GPzk8PlG0sPpzdU5ZvIRMPidzAnZDl/s9L+y13iodqvb8leL53bTannOrQ/Im7UkpsmFU5Ily5U60LWixnmLg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/core@0.14.0':
@@ -2603,8 +2612,8 @@ packages:
resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@eslint/js@9.27.0':
- resolution: {integrity: sha512-G5JD9Tu5HJEu4z2Uo4aHY2sLV64B7CDMXxFzqzjl3NKd6RVzSXNoE80jk7Y0lJkTTkjiIhBAqmlYwjuBY3tvpA==}
+ '@eslint/js@9.28.0':
+ resolution: {integrity: sha512-fnqSjGWd/CoIp4EXIxWVK/sHA6DOHN4+8Ix2cX5ycOY7LG0UY8nHCU5pIp2eaE1Mc7Qd8kHspYNzYXT2ojPLzg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@eslint/object-schema@2.1.6':
@@ -2892,8 +2901,8 @@ packages:
resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==}
engines: {node: '>=18.18'}
- '@humanwhocodes/retry@0.4.2':
- resolution: {integrity: sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==}
+ '@humanwhocodes/retry@0.4.3':
+ resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==}
engines: {node: '>=18.18'}
'@iconify/types@2.0.0':
@@ -3617,8 +3626,8 @@ packages:
'@promptbook/utils@0.69.5':
resolution: {integrity: sha512-xm5Ti/Hp3o4xHrsK9Yy3MS6KbDxYbq485hDsFvxqaNA7equHLPdo8H8faTitTeb14QCDfLW4iwCxdVYu5sn6YQ==}
- '@puppeteer/browsers@2.10.4':
- resolution: {integrity: sha512-9DxbZx+XGMNdjBynIs4BRSz+M3iRDeB7qRcAr6UORFLphCIM2x3DXgOucvADiifcqCE4XePFUKcnaAMyGbrDlQ==}
+ '@puppeteer/browsers@2.10.5':
+ resolution: {integrity: sha512-eifa0o+i8dERnngJwKrfp3dEq7ia5XFyoqB17S4gK8GhsQE4/P8nxOfQSE0zQHxzzLo/cmF+7+ywEQ7wK7Fb+w==}
engines: {node: '>=18'}
hasBin: true
@@ -4349,6 +4358,9 @@ packages:
'@types/cacheable-request@6.0.3':
resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==}
+ '@types/chai@5.2.2':
+ resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==}
+
'@types/cls-hooked@4.3.9':
resolution: {integrity: sha512-CMtHMz6Q/dkfcHarq9nioXH8BDPP+v5xvd+N90lBQ2bdmu06UvnLDqxTKoOJzz4SzIwb/x9i4UXGAAcnUDuIvg==}
@@ -4481,6 +4493,9 @@ packages:
'@types/debug@4.1.12':
resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==}
+ '@types/deep-eql@4.0.2':
+ resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==}
+
'@types/ejs@3.1.5':
resolution: {integrity: sha512-nv+GSx77ZtXiJzwKdsASqi+YQ5Z7vwHsTP0JY2SiQgjGckkBRKZnk8nIM+7oUZ1VCtuTz0+By4qVR7fqzp/Dfg==}
@@ -4595,8 +4610,8 @@ packages:
'@types/methods@1.1.4':
resolution: {integrity: sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==}
- '@types/mime-types@2.1.4':
- resolution: {integrity: sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==}
+ '@types/mime-types@3.0.0':
+ resolution: {integrity: sha512-9gFWMsVgEtbsD6yY/2z8pAtnZhdRKl4Q9xmKQJy5gv0fMpzJeeWtQyd7WpdhaIbRSwPCfnjXOsNMcoQvu5giGg==}
'@types/mime@1.3.5':
resolution: {integrity: sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==}
@@ -4610,18 +4625,12 @@ packages:
'@types/multer@1.4.12':
resolution: {integrity: sha512-pQ2hoqvXiJt2FP9WQVLPRO+AmiIm/ZYkavPlIQnx282u4ZrVdztx0pkh3jjpQt0Kz+YI0YhSG264y08UJKoUQg==}
- '@types/node-fetch@2.6.12':
- resolution: {integrity: sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==}
-
'@types/node-forge@1.3.11':
resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==}
'@types/node@16.9.1':
resolution: {integrity: sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==}
- '@types/node@18.16.9':
- resolution: {integrity: sha512-IeB32oIV4oGArLrd7znD2rkHQ6EDCM+2Sr76dJnrHwv9OHBTTM6nuDLK9bmikXzPa0ZlWMWtRGo/Uw4mrzQedA==}
-
'@types/node@20.17.32':
resolution: {integrity: sha512-zeMXFn8zQ+UkjK4ws0RiOC9EWByyW1CcVmLe+2rQocXRsGEDxUCwPEIVgpsGcLHS/P8JkT0oa3839BRABS0oPw==}
@@ -4744,35 +4753,37 @@ packages:
'@types/yauzl@2.10.3':
resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==}
- '@typescript-eslint/eslint-plugin@8.33.0':
- resolution: {integrity: sha512-CACyQuqSHt7ma3Ns601xykeBK/rDeZa3w6IS6UtMQbixO5DWy+8TilKkviGDH6jtWCo8FGRKEK5cLLkPvEammQ==}
+ '@typescript-eslint/eslint-plugin@8.33.1':
+ resolution: {integrity: sha512-TDCXj+YxLgtvxvFlAvpoRv9MAncDLBV2oT9Bd7YBGC/b/sEURoOYuIwLI99rjWOfY3QtDzO+mk0n4AmdFExW8A==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
- '@typescript-eslint/parser': ^8.33.0
+ '@typescript-eslint/parser': ^8.33.1
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0'
- '@typescript-eslint/parser@8.33.0':
- resolution: {integrity: sha512-JaehZvf6m0yqYp34+RVnihBAChkqeH+tqqhS0GuX1qgPpwLvmTPheKEs6OeCK6hVJgXZHJ2vbjnC9j119auStQ==}
+ '@typescript-eslint/parser@8.33.1':
+ resolution: {integrity: sha512-qwxv6dq682yVvgKKp2qWwLgRbscDAYktPptK4JPojCwwi3R9cwrvIxS4lvBpzmcqzR4bdn54Z0IG1uHFskW4dA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0'
- '@typescript-eslint/project-service@8.33.0':
- resolution: {integrity: sha512-d1hz0u9l6N+u/gcrk6s6gYdl7/+pp8yHheRTqP6X5hVDKALEaTn8WfGiit7G511yueBEL3OpOEpD+3/MBdoN+A==}
+ '@typescript-eslint/project-service@8.33.1':
+ resolution: {integrity: sha512-DZR0efeNklDIHHGRpMpR5gJITQpu6tLr9lDJnKdONTC7vvzOlLAG/wcfxcdxEWrbiZApcoBCzXqU/Z458Za5Iw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
+ peerDependencies:
+ typescript: '>=4.8.4 <5.9.0'
'@typescript-eslint/scope-manager@8.32.1':
resolution: {integrity: sha512-7IsIaIDeZn7kffk7qXC3o6Z4UblZJKV3UBpkvRNpr5NSyLji7tvTcvmnMNYuYLyh26mN8W723xpo3i4MlD33vA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript-eslint/scope-manager@8.33.0':
- resolution: {integrity: sha512-LMi/oqrzpqxyO72ltP+dBSP6V0xiUb4saY7WLtxSfiNEBI8m321LLVFU9/QDJxjDQG9/tjSqKz/E3380TEqSTw==}
+ '@typescript-eslint/scope-manager@8.33.1':
+ resolution: {integrity: sha512-dM4UBtgmzHR9bS0Rv09JST0RcHYearoEoo3pG5B6GoTR9XcyeqX87FEhPo+5kTvVfKCvfHaHrcgeJQc6mrDKrA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript-eslint/tsconfig-utils@8.33.0':
- resolution: {integrity: sha512-sTkETlbqhEoiFmGr1gsdq5HyVbSOF0145SYDJ/EQmXHtKViCaGvnyLqWFFHtEXoS0J1yU8Wyou2UGmgW88fEug==}
+ '@typescript-eslint/tsconfig-utils@8.33.1':
+ resolution: {integrity: sha512-STAQsGYbHCF0/e+ShUQ4EatXQ7ceh3fBCXkNU7/MZVKulrlq1usH7t2FhxvCpuCi5O5oi1vmVaAjrGeL71OK1g==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '>=4.8.4 <5.9.0'
@@ -4784,8 +4795,8 @@ packages:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0'
- '@typescript-eslint/type-utils@8.33.0':
- resolution: {integrity: sha512-lScnHNCBqL1QayuSrWeqAL5GmqNdVUQAAMTaCwdYEdWfIrSrOGzyLGRCHXcCixa5NK6i5l0AfSO2oBSjCjf4XQ==}
+ '@typescript-eslint/type-utils@8.33.1':
+ resolution: {integrity: sha512-1cG37d9xOkhlykom55WVwG2QRNC7YXlxMaMzqw2uPeJixBFfKWZgaP/hjAObqMN/u3fr5BrTwTnc31/L9jQ2ww==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
@@ -4795,8 +4806,8 @@ packages:
resolution: {integrity: sha512-YmybwXUJcgGqgAp6bEsgpPXEg6dcCyPyCSr0CAAueacR/CCBi25G3V8gGQ2kRzQRBNol7VQknxMs9HvVa9Rvfg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript-eslint/types@8.33.0':
- resolution: {integrity: sha512-DKuXOKpM5IDT1FA2g9x9x1Ug81YuKrzf4mYX8FAVSNu5Wo/LELHWQyM1pQaDkI42bX15PWl0vNPt1uGiIFUOpg==}
+ '@typescript-eslint/types@8.33.1':
+ resolution: {integrity: sha512-xid1WfizGhy/TKMTwhtVOgalHwPtV8T32MS9MaH50Cwvz6x6YqRIPdD2WvW0XaqOzTV9p5xdLY0h/ZusU5Lokg==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
'@typescript-eslint/typescript-estree@8.32.1':
@@ -4805,8 +4816,8 @@ packages:
peerDependencies:
typescript: '>=4.8.4 <5.9.0'
- '@typescript-eslint/typescript-estree@8.33.0':
- resolution: {integrity: sha512-vegY4FQoB6jL97Tu/lWRsAiUUp8qJTqzAmENH2k59SJhw0Th1oszb9Idq/FyyONLuNqT1OADJPXfyUNOR8SzAQ==}
+ '@typescript-eslint/typescript-estree@8.33.1':
+ resolution: {integrity: sha512-+s9LYcT8LWjdYWu7IWs7FvUxpQ/DGkdjZeE/GGulHvv8rvYwQvVaUZ6DE+j5x/prADUgSbbCWZ2nPI3usuVeOA==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
typescript: '>=4.8.4 <5.9.0'
@@ -4818,8 +4829,8 @@ packages:
eslint: ^8.57.0 || ^9.0.0
typescript: '>=4.8.4 <5.9.0'
- '@typescript-eslint/utils@8.33.0':
- resolution: {integrity: sha512-lPFuQaLA9aSNa7D5u2EpRiqdAUhzShwGg/nhpBlc4GR6kcTABttCuyjFs8BcEZ8VWrjCBof/bePhP3Q3fS+Yrw==}
+ '@typescript-eslint/utils@8.33.1':
+ resolution: {integrity: sha512-52HaBiEQUaRYqAXpfzWSR2U3gxk92Kw006+xZpElaPMg3C4PgM+A5LqwoQI1f9E5aZ/qlxAZxzm42WX+vn92SQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
@@ -4829,16 +4840,16 @@ packages:
resolution: {integrity: sha512-ar0tjQfObzhSaW3C3QNmTc5ofj0hDoNQ5XWrCy6zDyabdr0TWhCkClp+rywGNj/odAFBVzzJrK4tEq5M4Hmu4w==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript-eslint/visitor-keys@8.33.0':
- resolution: {integrity: sha512-7RW7CMYoskiz5OOGAWjJFxgb7c5UNjTG292gYhWeOAcFmYCtVCSqjqSBj5zMhxbXo2JOW95YYrUWJfU0zrpaGQ==}
+ '@typescript-eslint/visitor-keys@8.33.1':
+ resolution: {integrity: sha512-3i8NrFcZeeDHJ+7ZUuDkGT+UHq+XoFGsymNK2jZCOHcfEzRQ0BdpRtdpSx/Iyf3MHLWIcLS0COuOPibKQboIiQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@vitest/browser@3.1.4':
- resolution: {integrity: sha512-2L4vR/tuUZBxKU72Qe+unIp1P8lZ0T5nlqPegkXxyZFR5gWqItV8VPPR261GOzl49Zw2AhzMABzMMHJagQ0a2g==}
+ '@vitest/browser@3.2.0':
+ resolution: {integrity: sha512-sVpX5m53lX9/0ehAqkcTSQeJK1SVlTlvBrwE8rPQ2KJQgb/Iiorx+3y+VQdzIJ+CDqfG89bQEA5l1Z02VogDsA==}
peerDependencies:
playwright: '*'
safaridriver: '*'
- vitest: 3.1.4
+ vitest: 3.2.0
webdriverio: ^7.0.0 || ^8.0.0 || ^9.0.0
peerDependenciesMeta:
playwright:
@@ -4848,53 +4859,87 @@ packages:
webdriverio:
optional: true
- '@vitest/coverage-istanbul@3.1.4':
- resolution: {integrity: sha512-WcGed2Bad8T96tSPr7zLsLS8SBiGuTnoEUAf/wLeA2rOTTFo9N2Mrxr6//v4qleXsYh+o2nd+gZ63KcNB8fgjg==}
+ '@vitest/coverage-istanbul@3.2.0':
+ resolution: {integrity: sha512-eSPLTxVPFMdDE0vuiuCxckob4RJEMM/AO8Z86X3WCZ1V6b9SuMeCaxR6Ebbl/fy2QO+IXWOwtGrvcWY/nSG2dw==}
peerDependencies:
- vitest: 3.1.4
+ vitest: 3.2.0
- '@vitest/coverage-v8@3.1.4':
- resolution: {integrity: sha512-G4p6OtioySL+hPV7Y6JHlhpsODbJzt1ndwHAFkyk6vVjpK03PFsKnauZIzcd0PrK4zAbc5lc+jeZ+eNGiMA+iw==}
+ '@vitest/coverage-v8@3.2.1':
+ resolution: {integrity: sha512-6dy0uF/0BE3jpUW9bFzg0V2S4F7XVaZHL/7qma1XANvHPQGoJuc3wtx911zSoAgUnpfvcLVK1vancNJ95d+uxQ==}
peerDependencies:
- '@vitest/browser': 3.1.4
- vitest: 3.1.4
+ '@vitest/browser': 3.2.1
+ vitest: 3.2.1
peerDependenciesMeta:
'@vitest/browser':
optional: true
- '@vitest/expect@3.1.4':
- resolution: {integrity: sha512-xkD/ljeliyaClDYqHPNCiJ0plY5YIcM0OlRiZizLhlPmpXWpxnGMyTZXOHFhFeG7w9P5PBeL4IdtJ/HeQwTbQA==}
+ '@vitest/expect@3.2.0':
+ resolution: {integrity: sha512-0v4YVbhDKX3SKoy0PHWXpKhj44w+3zZkIoVES9Ex2pq+u6+Bijijbi2ua5kE+h3qT6LBWFTNZSCOEU37H8Y5sA==}
- '@vitest/mocker@3.1.4':
- resolution: {integrity: sha512-8IJ3CvwtSw/EFXqWFL8aCMu+YyYXG2WUSrQbViOZkWTKTVicVwZ/YiEZDSqD00kX+v/+W+OnxhNWoeVKorHygA==}
+ '@vitest/expect@3.2.1':
+ resolution: {integrity: sha512-FqS/BnDOzV6+IpxrTg5GQRyLOCtcJqkwMwcS8qGCI2IyRVDwPAtutztaf1CjtPHlZlWtl1yUPCd7HM0cNiDOYw==}
+
+ '@vitest/mocker@3.2.0':
+ resolution: {integrity: sha512-HFcW0lAMx3eN9vQqis63H0Pscv0QcVMo1Kv8BNysZbxcmHu3ZUYv59DS6BGYiGQ8F5lUkmsfMMlPm4DJFJdf/A==}
peerDependencies:
msw: ^2.4.9
- vite: ^5.0.0 || ^6.0.0
+ vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0
peerDependenciesMeta:
msw:
optional: true
vite:
optional: true
- '@vitest/pretty-format@3.1.4':
- resolution: {integrity: sha512-cqv9H9GvAEoTaoq+cYqUTCGscUjKqlJZC7PRwY5FMySVj5J+xOm1KQcCiYHJOEzOKRUhLH4R2pTwvFlWCEScsg==}
-
- '@vitest/runner@3.1.4':
- resolution: {integrity: sha512-djTeF1/vt985I/wpKVFBMWUlk/I7mb5hmD5oP8K9ACRmVXgKTae3TUOtXAEBfslNKPzUQvnKhNd34nnRSYgLNQ==}
-
- '@vitest/snapshot@3.1.4':
- resolution: {integrity: sha512-JPHf68DvuO7vilmvwdPr9TS0SuuIzHvxeaCkxYcCD4jTk67XwL45ZhEHFKIuCm8CYstgI6LZ4XbwD6ANrwMpFg==}
-
- '@vitest/spy@3.1.4':
- resolution: {integrity: sha512-Xg1bXhu+vtPXIodYN369M86K8shGLouNjoVI78g8iAq2rFoHFdajNvJJ5A/9bPMFcfQqdaCpOgWKEoMQg/s0Yg==}
-
- '@vitest/ui@3.1.4':
- resolution: {integrity: sha512-CFc2Bpb3sz4Sdt53kdNGq+qZKLftBwX4qZLC03CBUc0N1LJrOoL0ZeK0oq/708mtnpwccL0BZCY9d1WuiBSr7Q==}
+ '@vitest/mocker@3.2.1':
+ resolution: {integrity: sha512-OXxMJnx1lkB+Vl65Re5BrsZEHc90s5NMjD23ZQ9NlU7f7nZiETGoX4NeKZSmsKjseuMq2uOYXdLOeoM0pJU+qw==}
peerDependencies:
- vitest: 3.1.4
+ msw: ^2.4.9
+ vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0
+ peerDependenciesMeta:
+ msw:
+ optional: true
+ vite:
+ optional: true
- '@vitest/utils@3.1.4':
- resolution: {integrity: sha512-yriMuO1cfFhmiGc8ataN51+9ooHRuURdfAZfwFd3usWynjzpLslZdYnRegTv32qdgtJTsj15FoeZe2g15fY1gg==}
+ '@vitest/pretty-format@3.2.0':
+ resolution: {integrity: sha512-gUUhaUmPBHFkrqnOokmfMGRBMHhgpICud9nrz/xpNV3/4OXCn35oG+Pl8rYYsKaTNd/FAIrqRHnwpDpmYxCYZw==}
+
+ '@vitest/pretty-format@3.2.1':
+ resolution: {integrity: sha512-xBh1X2GPlOGBupp6E1RcUQWIxw0w/hRLd3XyBS6H+dMdKTAqHDNsIR2AnJwPA3yYe9DFy3VUKTe3VRTrAiQ01g==}
+
+ '@vitest/runner@3.2.0':
+ resolution: {integrity: sha512-bXdmnHxuB7fXJdh+8vvnlwi/m1zvu+I06i1dICVcDQFhyV4iKw2RExC/acavtDn93m/dRuawUObKsrNE1gJacA==}
+
+ '@vitest/runner@3.2.1':
+ resolution: {integrity: sha512-kygXhNTu/wkMYbwYpS3z/9tBe0O8qpdBuC3dD/AW9sWa0LE/DAZEjnHtWA9sIad7lpD4nFW1yQ+zN7mEKNH3yA==}
+
+ '@vitest/snapshot@3.2.0':
+ resolution: {integrity: sha512-z7P/EneBRMe7hdvWhcHoXjhA6at0Q4ipcoZo6SqgxLyQQ8KSMMCmvw1cSt7FHib3ozt0wnRHc37ivuUMbxzG/A==}
+
+ '@vitest/snapshot@3.2.1':
+ resolution: {integrity: sha512-5xko/ZpW2Yc65NVK9Gpfg2y4BFvcF+At7yRT5AHUpTg9JvZ4xZoyuRY4ASlmNcBZjMslV08VRLDrBOmUe2YX3g==}
+
+ '@vitest/spy@3.2.0':
+ resolution: {integrity: sha512-s3+TkCNUIEOX99S0JwNDfsHRaZDDZZR/n8F0mop0PmsEbQGKZikCGpTGZ6JRiHuONKew3Fb5//EPwCP+pUX9cw==}
+
+ '@vitest/spy@3.2.1':
+ resolution: {integrity: sha512-Nbfib34Z2rfcJGSetMxjDCznn4pCYPZOtQYox2kzebIJcgH75yheIKd5QYSFmR8DIZf2M8fwOm66qSDIfRFFfQ==}
+
+ '@vitest/ui@3.2.0':
+ resolution: {integrity: sha512-cYFZZSl1usgzsHoGF66GHfYXlEwc06ggapS1TaSLMKCzhTPWBPI9b/t1RvKIsLSjdKUakpSPf33jQMvRjMvvlQ==}
+ peerDependencies:
+ vitest: 3.2.0
+
+ '@vitest/ui@3.2.1':
+ resolution: {integrity: sha512-xT93aOcPn2wn8vvw4T6rZAK9WjGEHdYrEjN3OJ1zcDpl2UInxvcD9fYI10nmPAERNEK6jUVcSCIPAIfNuaRX6Q==}
+ peerDependencies:
+ vitest: 3.2.1
+
+ '@vitest/utils@3.2.0':
+ resolution: {integrity: sha512-gXXOe7Fj6toCsZKVQouTRLJftJwmvbhH5lKOBR6rlP950zUq9AitTUjnFoXS/CqjBC2aoejAztLPzzuva++XBw==}
+
+ '@vitest/utils@3.2.1':
+ resolution: {integrity: sha512-KkHlGhePEKZSub5ViknBcN5KEF+u7dSUr9NW8QsVICusUojrgrOnnY3DEWWO877ax2Pyopuk2qHmt+gkNKnBVw==}
'@volar/language-core@2.4.13':
resolution: {integrity: sha512-MnQJ7eKchJx5Oz+YdbqyFUk8BN6jasdJv31n/7r6/WwlOOv7qzvot6B66887l2ST3bUW4Mewml54euzpJWA6bg==}
@@ -4925,27 +4970,27 @@ packages:
'@vue/shared@3.5.14':
resolution: {integrity: sha512-oXTwNxVfc9EtP1zzXAlSlgARLXNC84frFYkS0HHz0h3E4WZSP9sywqjqzGCP9Y34M8ipNmd380pVgmMuwELDyQ==}
- '@wdio/config@9.14.0':
- resolution: {integrity: sha512-mW6VAXfUgd2j+8YJfFWvg8Ba/7g1Brr6/+MFBpp5rTQsw/2bN3PBJsQbWpNl99OCgoS8vgc5Ykps5ZUEeffSVQ==}
+ '@wdio/config@9.15.0':
+ resolution: {integrity: sha512-IQzSZx2Y0KdAVWHSdcBLkuUjCmYtOnc1oDY7Psi814wDR7dEPVOuKgMo8ZZ0P1yhioMzqvy5tBemYSzj7CrFTA==}
engines: {node: '>=18.20.0'}
- '@wdio/logger@9.4.4':
- resolution: {integrity: sha512-BXx8RXFUW2M4dcO6t5Le95Hi2ZkTQBRsvBQqLekT2rZ6Xmw8ZKZBPf0FptnoftFGg6dYmwnDidYv/0+4PiHjpQ==}
+ '@wdio/logger@9.15.0':
+ resolution: {integrity: sha512-3IkaissyOsUQwg8IinkVm1svsvRMGJpFyaSiEhQ0oQXD7mnWrNVFSU9kmeFvbKAtoc4j60FRjU6XqtH94xRceg==}
engines: {node: '>=18.20.0'}
- '@wdio/protocols@9.14.0':
- resolution: {integrity: sha512-inJR+G8iiFrk8/JPMfxpy6wA7rvMIZFV0T8vDN1Io7sGGj+EXX7ujpDxoCns53qxV4RytnSlgHRcCaASPFcecQ==}
+ '@wdio/protocols@9.15.0':
+ resolution: {integrity: sha512-5O7bwiG7t8nmSVOx888YryO/9AQgQ7p/Ecd9rS13UyDQL169HmVKXP0vvJKGH3X+oeE92U1wVrwrIl4Xx3BQ6Q==}
'@wdio/repl@9.4.4':
resolution: {integrity: sha512-kchPRhoG/pCn4KhHGiL/ocNhdpR8OkD2e6sANlSUZ4TGBVi86YSIEjc2yXUwLacHknC/EnQk/SFnqd4MsNjGGg==}
engines: {node: '>=18.20.0'}
- '@wdio/types@9.14.0':
- resolution: {integrity: sha512-Zqc4sxaQLIXdI1EHItIuVIOn7LvPmDvl9JEANwiJ35ck82Xlj+X55Gd9NtELSwChzKgODD0OBzlLgXyxTr69KA==}
+ '@wdio/types@9.15.0':
+ resolution: {integrity: sha512-hR0Dm9TsrjtgOLWOjUMYTOB1hWIlnDzFgZt7XGOzI9Ig8Qa+TDfZSFaZukGxqLIZS/eGhxpnunSHaTAXwJIxYA==}
engines: {node: '>=18.20.0'}
- '@wdio/utils@9.14.0':
- resolution: {integrity: sha512-oJapwraSflOe0CmeF3TBocdt983hq9mCutLCfie4QmE+TKRlCsZz4iidG1NRAZPGdKB32nfHtyQlW0Dfxwn6RA==}
+ '@wdio/utils@9.15.0':
+ resolution: {integrity: sha512-XuT1PE1nh4wwJfQW6IN4UT6+iv0+Yf4zhgMh5et04OX6tfrIXkWdx2SDimghDtRukp9i85DvIGWjdPEoQFQdaA==}
engines: {node: '>=18.20.0'}
'@webassemblyjs/ast@1.14.1':
@@ -5013,8 +5058,8 @@ packages:
resolution: {integrity: sha512-/HcYgtUSiJiot/XWGLOlGxPYUG65+/31V8oqk17vZLW1xlCoR4PampyePljOxY2n8/3jz9+tIFzICsyGujJZoA==}
engines: {node: '>=18.12.0'}
- '@zip.js/zip.js@2.7.61':
- resolution: {integrity: sha512-+tZvY10nkW0pJoU88XFWLBd2O9PJPvEnDhSY/jQHfIroN5W5qGfPgFHKC4lkx0+9Vw/0IAkNHf1XBVInBkM9Vw==}
+ '@zip.js/zip.js@2.7.62':
+ resolution: {integrity: sha512-OaLvZ8j4gCkLn048ypkZu29KX30r8/OfFF2w4Jo5WXFr+J04J+lzJ5TKZBVgFXhlvSkqNFQdfnY1Q8TMTCyBVA==}
engines: {bun: '>=0.7.0', deno: '>=1.0.0', node: '>=16.5.0'}
'@zkochan/js-yaml@0.0.7':
@@ -5281,6 +5326,9 @@ packages:
resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==}
engines: {node: '>=4'}
+ ast-v8-to-istanbul@0.3.3:
+ resolution: {integrity: sha512-MuXMrSLVVoA6sYN/6Hke18vMzrT4TZNbZIj/hvh0fnYFpO+/kFXcLIaiPwXXWaQUPg4yJD8fj+lfJ7/1EBconw==}
+
astral-regex@2.0.0:
resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==}
engines: {node: '>=8'}
@@ -5596,8 +5644,8 @@ packages:
resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==}
engines: {node: '>=8'}
- cacheable@1.8.10:
- resolution: {integrity: sha512-0ZnbicB/N2R6uziva8l6O6BieBklArWyiGx4GkwAhLKhSHyQtRfM9T1nx7HHuHDKkYB/efJQhz3QJ6x/YqoZzA==}
+ cacheable@1.9.0:
+ resolution: {integrity: sha512-8D5htMCxPDUULux9gFzv30f04Xo3wCnik0oOxKoRTPIBoqA7HtOcJ87uBhQTs3jCfZZTrUBGsYIZOgE0ZRgMAg==}
call-bind-apply-helpers@1.0.2:
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
@@ -5937,6 +5985,10 @@ packages:
resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==}
engines: {'0': node >= 0.8}
+ concat-stream@2.0.0:
+ resolution: {integrity: sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==}
+ engines: {'0': node >= 6.0}
+
confbox@0.1.8:
resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==}
@@ -6993,8 +7045,8 @@ packages:
peerDependencies:
eslint: '>=7.0.0'
- eslint-linter-browserify@9.27.0:
- resolution: {integrity: sha512-b/OPp+tMY+jSRTD94WIy+ZK3Uje5oSMMlk/IrKClSH+nwN81MoVx5nt9TpgwuDk7UtZutW7ycpuX7X4kFSmIEQ==}
+ eslint-linter-browserify@9.28.0:
+ resolution: {integrity: sha512-kwl+x7pjceCh+odhn7M6wOyjPKjXtmN/gPcxB7R7OItlW9aFKS1iETNnPbfcGWvO+hULt1BLSyWvNFWUah7EvQ==}
eslint-plugin-ckeditor5-rules@10.0.0:
resolution: {integrity: sha512-0gYPxrvzQmljIUHnxCUKrH0NsLsJNoR316wihe4QSeSSqe4zIv0MLI9ROyXt8HiuAQgSSnGnzVCcdg+T0PxpuQ==}
@@ -7026,8 +7078,8 @@ packages:
resolution: {integrity: sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- eslint@9.27.0:
- resolution: {integrity: sha512-ixRawFQuMB9DZ7fjU3iGGganFDp3+45bPOdaRurcFHSXO1e/sYwUX/FtQZpLZJR6SjMoJH8hR2pPEAfDyCoU2Q==}
+ eslint@9.28.0:
+ resolution: {integrity: sha512-ocgh41VhRlf9+fVpe7QKzwLj9c92fDiqOj8Y3Sd4/ZmVA4Btx4PlUYPq4pp9JDyupkf1upbEXecxL2mwNV7jPQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
hasBin: true
peerDependencies:
@@ -7220,6 +7272,14 @@ packages:
picomatch:
optional: true
+ fdir@6.4.5:
+ resolution: {integrity: sha512-4BG7puHpVsIYxZUbiUE3RqGloLaSSwzYie5jvasC4LWuBWzZawynvYouhjbQKw2JuIGYdm0DzIxl8iVidKlUEw==}
+ peerDependencies:
+ picomatch: ^3 || ^4
+ peerDependenciesMeta:
+ picomatch:
+ optional: true
+
fetch-blob@3.2.0:
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
engines: {node: ^12.20 || >= 14.13}
@@ -7231,8 +7291,8 @@ packages:
resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==}
engines: {node: '>=8'}
- file-entry-cache@10.0.8:
- resolution: {integrity: sha512-FGXHpfmI4XyzbLd3HQ8cbUcsFGohJpZtmQRHr8z8FxxtCe2PcpgIlVLwIgunqjvRmXypBETvwhV4ptJizA+Y1Q==}
+ file-entry-cache@10.1.0:
+ resolution: {integrity: sha512-Et/ex6smi3wOOB+n5mek+Grf7P2AxZR5ueqRUvAAn4qkyatXi3cUC1cuQXVkX0VlzBVsN4BkWJFmY/fYiRTdww==}
file-entry-cache@8.0.0:
resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==}
@@ -7300,8 +7360,8 @@ packages:
resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==}
engines: {node: '>=16'}
- flat-cache@6.1.8:
- resolution: {integrity: sha512-R6MaD3nrJAtO7C3QOuS79ficm2pEAy++TgEUD8ii1LVlbcgZ9DtASLkt9B+RZSFCzm7QHDMlXPsqqB6W2Pfr1Q==}
+ flat-cache@6.1.9:
+ resolution: {integrity: sha512-DUqiKkTlAfhtl7g78IuwqYM+YqvT+as0mY+EVk6mfimy19U79pJCzDZQsnqk3Ou/T6hFXWLGbwbADzD/c8Tydg==}
flat@5.0.2:
resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==}
@@ -7342,9 +7402,6 @@ packages:
resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}
engines: {node: '>=14'}
- form-data-encoder@1.7.2:
- resolution: {integrity: sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A==}
-
form-data@3.0.3:
resolution: {integrity: sha512-q5YBMeWy6E2Un0nMGWMgI65MAKtaylxfNJGJxpGh45YDciZB4epbWpaAfImil6CPAPTYB4sh0URQNDRIZG5F2w==}
engines: {node: '>= 6'}
@@ -7353,10 +7410,6 @@ packages:
resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==}
engines: {node: '>= 6'}
- formdata-node@4.4.1:
- resolution: {integrity: sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==}
- engines: {node: '>= 12.20'}
-
formdata-polyfill@4.0.10:
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
engines: {node: '>=12.20.0'}
@@ -7670,9 +7723,9 @@ packages:
handle-thing@2.0.1:
resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==}
- happy-dom@17.5.6:
- resolution: {integrity: sha512-B4U6jKuiizwCJ2WP0YreQmRdeBrHKOXhpz7YUbbwdSAKfWEhdG4UfWZOZTZ5Oejs/9yJtk7xmbfp8YdVL9LVFA==}
- engines: {node: '>=18.0.0'}
+ happy-dom@17.6.3:
+ resolution: {integrity: sha512-UVIHeVhxmxedbWPCfgS55Jg2rDfwf2BCKeylcPSqazLz5w3Kri7Q4xdBJubsr/+VUzFLh0VjIvh13RaDA2/Xug==}
+ engines: {node: '>=20.0.0'}
harmony-reflect@1.6.2:
resolution: {integrity: sha512-HIp/n38R9kQjDEziXyDTuW3vvoxxyxjxFzXLrBr18uB47GnSt+G9D29fqrpM5ZkspMcPICud3XsBJQ4Y2URg8g==}
@@ -7742,8 +7795,8 @@ packages:
hoist-non-react-statics@2.5.5:
resolution: {integrity: sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==}
- hookified@1.8.2:
- resolution: {integrity: sha512-5nZbBNP44sFCDjSoB//0N7m508APCgbQ4mGGo1KJGBYyCKNHfry1Pvd0JVHZIxjdnqn8nFRBAN/eFB6Rk/4w5w==}
+ hookified@1.9.0:
+ resolution: {integrity: sha512-2yEEGqphImtKIe1NXWEhu6yD3hlFR4Mxk4Mtp3XEyScpSt4pQ4ymmXA1zzxZpj99QkFK+nN0nzjeb2+RUi/6CQ==}
hosted-git-info@2.8.9:
resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==}
@@ -8506,6 +8559,9 @@ packages:
js-tokens@4.0.0:
resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}
+ js-tokens@9.0.1:
+ resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==}
+
js-yaml@3.13.1:
resolution: {integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==}
hasBin: true
@@ -9244,8 +9300,8 @@ packages:
muggle-string@0.4.1:
resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==}
- multer@2.0.0:
- resolution: {integrity: sha512-bS8rPZurbAuHGAnApbM9d4h1wSoYqrOqkE+6a64KLMK9yWU7gJXBDDVklKQ3TPi9DRb85cRs6yXaC0+cjxRtRg==}
+ multer@2.0.1:
+ resolution: {integrity: sha512-Ug8bXeTIUlxurg8xLTEskKShvcKDZALo1THEX5E41pYCD2sCVub5/kIRIGqWNoqV6szyLyQKV6mD4QUrWE5GCQ==}
engines: {node: '>= 10.16.0'}
multicast-dns@7.2.5:
@@ -9526,8 +9582,8 @@ packages:
resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==}
engines: {node: '>=12'}
- openai@4.104.0:
- resolution: {integrity: sha512-p99EFNsA/yX6UhVO93f5kJsDRLAg+CTA2RBqdHK4RtK8u5IJw32Hyb2dTGKbnnFmnuoBv5r7Z2CURI9sGZpSuA==}
+ openai@5.1.0:
+ resolution: {integrity: sha512-YQBgPJykHrDOlngB/8QpOsFNg36yofBatpeDWg1zejl9R59/ELuN7AMPSU95ZIdChbKc/o5vg1UnBJ1OEB0IJA==}
hasBin: true
peerDependencies:
ws: ^8.18.0
@@ -11673,8 +11729,8 @@ packages:
peerDependencies:
stylelint: '>=13.5.0'
- stylelint@16.19.1:
- resolution: {integrity: sha512-C1SlPZNMKl+d/C867ZdCRthrS+6KuZ3AoGW113RZCOL0M8xOGpgx7G70wq7lFvqvm4dcfdGFVLB/mNaLFChRKw==}
+ stylelint@16.20.0:
+ resolution: {integrity: sha512-B5Myu9WRxrgKuLs3YyUXLP2H0mrbejwNxPmyADlACWwFsrL8Bmor/nTSh4OMae5sHjOz6gkSeccQH34gM4/nAw==}
engines: {node: '>=18.12.0'}
hasBin: true
@@ -11792,8 +11848,8 @@ packages:
tar-fs@2.1.2:
resolution: {integrity: sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==}
- tar-fs@3.0.8:
- resolution: {integrity: sha512-ZoROL70jptorGAlgAYiLoBLItEKw/fUxg9BSYK/dF/GAGYFJOJJJMvjPAKDJraCXFwadD456FCuvLWgfhMsPwg==}
+ tar-fs@3.0.9:
+ resolution: {integrity: sha512-XF4w9Xp+ZQgifKakjZYmFdkLoSWd34VGKcsTCwlNWM7QG3ZbaxnTsaBwnjFZqHRf/rROxaR8rXnbtwdvaDI+lA==}
tar-stream@2.2.0:
resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==}
@@ -11895,16 +11951,20 @@ packages:
resolution: {integrity: sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==}
engines: {node: '>=12.0.0'}
- tinypool@1.0.2:
- resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==}
+ tinyglobby@0.2.14:
+ resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==}
+ engines: {node: '>=12.0.0'}
+
+ tinypool@1.1.0:
+ resolution: {integrity: sha512-7CotroY9a8DKsKprEy/a14aCCm8jYVmR7aFy4fpkZM8sdpNJbKkixuNjgM50yCmip2ezc8z4N7k3oe2+rfRJCQ==}
engines: {node: ^18.0.0 || >=20.0.0}
tinyrainbow@2.0.0:
resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==}
engines: {node: '>=14.0.0'}
- tinyspy@3.0.2:
- resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==}
+ tinyspy@4.0.3:
+ resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==}
engines: {node: '>=14.0.0'}
tldts-core@6.1.86:
@@ -12104,8 +12164,8 @@ packages:
typedarray@0.0.6:
resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==}
- typescript-eslint@8.33.0:
- resolution: {integrity: sha512-5YmNhF24ylCsvdNW2oJwMzTbaeO4bg90KeGtMjUw0AGtHksgEPLRTUil+coHwCfiu4QjVJFnjp94DmU6zV7DhQ==}
+ typescript-eslint@8.33.1:
+ resolution: {integrity: sha512-AgRnV4sKkWOiZ0Kjbnf5ytTJXMUZQ0qhSVdQtDNYLPLnjsATEYhaO94GlRQwi4t4gO8FfjM6NnikHeKjUm8D7A==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
peerDependencies:
eslint: ^8.57.0 || ^9.0.0
@@ -12359,8 +12419,13 @@ packages:
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'}
- vite-node@3.1.4:
- resolution: {integrity: sha512-6enNwYnpyDo4hEgytbmc6mYWHXDHYEn0D1/rw4Q+tnHUGtKTJsn8T1YkX6Q18wI5LCrS8CTYlBaiCqxOy2kvUA==}
+ vite-node@3.2.0:
+ resolution: {integrity: sha512-8Fc5Ko5Y4URIJkmMF/iFP1C0/OJyY+VGVe9Nw6WAdZyw4bTO+eVg9mwxWkQp/y8NnAoQY3o9KAvE1ZdA2v+Vmg==}
+ engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
+ hasBin: true
+
+ vite-node@3.2.1:
+ resolution: {integrity: sha512-V4EyKQPxquurNJPtQJRZo8hKOoKNBRIhxcDbQFPFig0JdoWcUhwRgK8yoCXXrfYVPKS6XwirGHPszLnR8FbjCA==}
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
hasBin: true
@@ -12425,16 +12490,44 @@ packages:
yaml:
optional: true
- vitest@3.1.4:
- resolution: {integrity: sha512-Ta56rT7uWxCSJXlBtKgIlApJnT6e6IGmTYxYcmxjJ4ujuZDI59GUQgVDObXXJujOmPDBYXHK1qmaGtneu6TNIQ==}
+ vitest@3.2.0:
+ resolution: {integrity: sha512-P7Nvwuli8WBNmeMHHek7PnGW4oAZl9za1fddfRVidZar8wDZRi7hpznLKQePQ8JPLwSBEYDK11g+++j7uFJV8Q==}
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
hasBin: true
peerDependencies:
'@edge-runtime/vm': '*'
'@types/debug': ^4.1.12
'@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
- '@vitest/browser': 3.1.4
- '@vitest/ui': 3.1.4
+ '@vitest/browser': 3.2.0
+ '@vitest/ui': 3.2.0
+ happy-dom: '*'
+ jsdom: '*'
+ peerDependenciesMeta:
+ '@edge-runtime/vm':
+ optional: true
+ '@types/debug':
+ optional: true
+ '@types/node':
+ optional: true
+ '@vitest/browser':
+ optional: true
+ '@vitest/ui':
+ optional: true
+ happy-dom:
+ optional: true
+ jsdom:
+ optional: true
+
+ vitest@3.2.1:
+ resolution: {integrity: sha512-VZ40MBnlE1/V5uTgdqY3DmjUgZtIzsYq758JGlyQrv5syIsaYcabkfPkEuWML49Ph0D/SoqpVFd0dyVTr551oA==}
+ engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
+ hasBin: true
+ peerDependencies:
+ '@edge-runtime/vm': '*'
+ '@types/debug': ^4.1.12
+ '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0
+ '@vitest/browser': 3.2.1
+ '@vitest/ui': 3.2.1
happy-dom: '*'
jsdom: '*'
peerDependenciesMeta:
@@ -12516,19 +12609,15 @@ packages:
resolution: {integrity: sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==}
engines: {node: '>= 8'}
- web-streams-polyfill@4.0.0-beta.3:
- resolution: {integrity: sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==}
- engines: {node: '>= 14'}
-
web-worker@1.5.0:
resolution: {integrity: sha512-RiMReJrTAiA+mBjGONMnjVDP2u3p9R1vkcGz6gDIrOMT3oGuYwX2WRMYI9ipkphSuE5XKEhydbhNEJh4NY9mlw==}
- webdriver@9.14.0:
- resolution: {integrity: sha512-0mVjxafQ5GNdK4l/FVmmmXGUfLHCSBE4Ml2LG23rxgmw53CThAos6h01UgIEINonxIzgKEmwfqJioo3/frbpbQ==}
+ webdriver@9.15.0:
+ resolution: {integrity: sha512-JCW5xvhZtL6kjbckdePgVYMOlvWbh22F1VFkIf9pw3prwXI2EHED5Eq/nfDnNfHiqr0AfFKWmIDPziSafrVv4Q==}
engines: {node: '>=18.20.0'}
- webdriverio@9.14.0:
- resolution: {integrity: sha512-GP0p6J+yjcCXF9uXW7HjB6IEh33OKmZcLTSg/W2rnVYSWgsUEYPujKSXe5I8q5a99QID7OOKNKVMfs5ANoZ2BA==}
+ webdriverio@9.15.0:
+ resolution: {integrity: sha512-910g6ktwXdAKGyhgCPGw9BzIKOEBBYMFN1bLwC3bW/3mFlxGHO/n70c7Sg9hrsu9VWTzv6m+1Clf27B9uz4a/Q==}
engines: {node: '>=18.20.0'}
peerDependencies:
puppeteer-core: '>=22.x || <=24.x'
@@ -12988,7 +13077,7 @@ snapshots:
'@babel/helper-annotate-as-pure@7.25.9':
dependencies:
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@babel/helper-compilation-targets@7.27.0':
dependencies:
@@ -13032,14 +13121,14 @@ snapshots:
'@babel/helper-member-expression-to-functions@7.25.9':
dependencies:
'@babel/traverse': 7.27.0
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
transitivePeerDependencies:
- supports-color
'@babel/helper-module-imports@7.25.9':
dependencies:
'@babel/traverse': 7.27.0
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
transitivePeerDependencies:
- supports-color
@@ -13054,7 +13143,7 @@ snapshots:
'@babel/helper-optimise-call-expression@7.25.9':
dependencies:
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@babel/helper-plugin-utils@7.26.5': {}
@@ -13079,7 +13168,7 @@ snapshots:
'@babel/helper-skip-transparent-expression-wrappers@7.25.9':
dependencies:
'@babel/traverse': 7.27.0
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
transitivePeerDependencies:
- supports-color
@@ -13093,7 +13182,7 @@ snapshots:
dependencies:
'@babel/template': 7.27.0
'@babel/traverse': 7.27.0
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
transitivePeerDependencies:
- supports-color
@@ -13104,12 +13193,16 @@ snapshots:
'@babel/parser@7.27.0':
dependencies:
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@babel/parser@7.27.2':
dependencies:
'@babel/types': 7.27.1
+ '@babel/parser@7.27.5':
+ dependencies:
+ '@babel/types': 7.27.3
+
'@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.9(@babel/core@7.26.10)':
dependencies:
'@babel/core': 7.26.10
@@ -13680,7 +13773,7 @@ snapshots:
dependencies:
'@babel/core': 7.26.10
'@babel/helper-plugin-utils': 7.26.5
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
esutils: 2.0.3
'@babel/preset-typescript@7.27.0(@babel/core@7.26.10)':
@@ -13719,6 +13812,11 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.27.1
+ '@babel/types@7.27.3':
+ dependencies:
+ '@babel/helper-string-parser': 7.27.1
+ '@babel/helper-validator-identifier': 7.27.1
+
'@bcoe/v8-coverage@0.2.3': {}
'@bcoe/v8-coverage@1.0.2': {}
@@ -14291,8 +14389,8 @@ snapshots:
process: 0.11.10
raw-loader: 4.0.2(webpack@5.99.9(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5))
style-loader: 2.0.0(webpack@5.99.9(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5))
- stylelint: 16.19.1(typescript@5.0.4)
- stylelint-config-ckeditor5: 2.0.1(stylelint@16.19.1(typescript@5.8.3))
+ stylelint: 16.20.0(typescript@5.0.4)
+ stylelint-config-ckeditor5: 2.0.1(stylelint@16.20.0(typescript@5.8.3))
terser-webpack-plugin: 5.3.14(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5)(webpack@5.99.9(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5))
ts-loader: 9.5.2(typescript@5.0.4)(webpack@5.99.9(@swc/core@1.11.29(@swc/helpers@0.5.17))(esbuild@0.25.5))
ts-node: 10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.0.4)
@@ -15123,9 +15221,9 @@ snapshots:
'@esbuild/win32-x64@0.25.5':
optional: true
- '@eslint-community/eslint-utils@4.7.0(eslint@9.27.0(jiti@2.4.2))':
+ '@eslint-community/eslint-utils@4.7.0(eslint@9.28.0(jiti@2.4.2))':
dependencies:
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
eslint-visitor-keys: 3.4.3
'@eslint-community/regexpp@4.12.1': {}
@@ -15138,7 +15236,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@eslint/config-helpers@0.2.1': {}
+ '@eslint/config-helpers@0.2.2': {}
'@eslint/core@0.14.0':
dependencies:
@@ -15158,7 +15256,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@eslint/js@9.27.0': {}
+ '@eslint/js@9.28.0': {}
'@eslint/object-schema@2.1.6': {}
@@ -15452,7 +15550,7 @@ snapshots:
'@humanwhocodes/retry@0.3.1': {}
- '@humanwhocodes/retry@0.4.2': {}
+ '@humanwhocodes/retry@0.4.3': {}
'@iconify/types@2.0.0': {}
@@ -16134,13 +16232,13 @@ snapshots:
- supports-color
- verdaccio
- '@nx/eslint-plugin@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint-config-prettier@10.1.5(eslint@9.27.0(jiti@2.4.2)))(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)':
+ '@nx/eslint-plugin@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint-config-prettier@10.1.5(eslint@9.28.0(jiti@2.4.2)))(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)':
dependencies:
'@nx/devkit': 21.1.2(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/js': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
- '@typescript-eslint/parser': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/type-utils': 8.32.1(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/utils': 8.32.1(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/parser': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/type-utils': 8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/utils': 8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
chalk: 4.1.2
confusing-browser-globals: 1.0.11
globals: 15.15.0
@@ -16148,7 +16246,7 @@ snapshots:
semver: 7.7.2
tslib: 2.8.1
optionalDependencies:
- eslint-config-prettier: 10.1.5(eslint@9.27.0(jiti@2.4.2))
+ eslint-config-prettier: 10.1.5(eslint@9.28.0(jiti@2.4.2))
transitivePeerDependencies:
- '@babel/traverse'
- '@swc-node/register'
@@ -16160,11 +16258,11 @@ snapshots:
- typescript
- verdaccio
- '@nx/eslint@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))':
+ '@nx/eslint@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))':
dependencies:
'@nx/devkit': 21.1.2(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/js': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
semver: 7.7.2
tslib: 2.8.1
typescript: 5.7.3
@@ -16179,11 +16277,11 @@ snapshots:
- supports-color
- verdaccio
- '@nx/express@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.27.0(jiti@2.4.2))(express@4.21.2)(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)':
+ '@nx/express@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.28.0(jiti@2.4.2))(express@4.21.2)(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)':
dependencies:
'@nx/devkit': 21.1.2(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/js': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
- '@nx/node': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
+ '@nx/node': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
tslib: 2.8.1
optionalDependencies:
express: 4.21.2
@@ -16273,10 +16371,10 @@ snapshots:
- nx
- supports-color
- '@nx/node@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)':
+ '@nx/node@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(@zkochan/js-yaml@0.0.7)(babel-plugin-macros@3.1.0)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)':
dependencies:
'@nx/devkit': 21.1.2(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
- '@nx/eslint': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
+ '@nx/eslint': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/jest': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(babel-plugin-macros@3.1.0)(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(ts-node@10.9.2(@swc/core@1.11.29(@swc/helpers@0.5.17))(@types/node@22.15.29)(typescript@5.8.3))(typescript@5.8.3)
'@nx/js': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
kill-port: 1.6.1
@@ -16328,10 +16426,10 @@ snapshots:
'@nx/nx-win32-x64-msvc@21.1.2':
optional: true
- '@nx/playwright@21.1.2(@babel/traverse@7.27.0)(@playwright/test@1.52.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)':
+ '@nx/playwright@21.1.2(@babel/traverse@7.27.0)(@playwright/test@1.52.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)':
dependencies:
'@nx/devkit': 21.1.2(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
- '@nx/eslint': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.27.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
+ '@nx/eslint': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(@zkochan/js-yaml@0.0.7)(eslint@9.28.0(jiti@2.4.2))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/js': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@phenomnomnominal/tsquery': 5.0.1(typescript@5.8.3)
minimatch: 9.0.3
@@ -16350,7 +16448,7 @@ snapshots:
- typescript
- verdaccio
- '@nx/vite@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)':
+ '@nx/vite@21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.1)':
dependencies:
'@nx/devkit': 21.1.2(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
'@nx/js': 21.1.2(@babel/traverse@7.27.0)(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17))(nx@21.1.2(@swc-node/register@1.10.10(@swc/core@1.11.29(@swc/helpers@0.5.17))(@swc/types@0.1.21)(typescript@5.8.3))(@swc/core@1.11.29(@swc/helpers@0.5.17)))
@@ -16362,7 +16460,7 @@ snapshots:
semver: 7.7.2
tsconfig-paths: 4.2.0
vite: 6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
- vitest: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ vitest: 3.2.1(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/ui@3.2.1)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
transitivePeerDependencies:
- '@babel/traverse'
- '@swc-node/register'
@@ -16545,14 +16643,14 @@ snapshots:
dependencies:
spacetrim: 0.11.59
- '@puppeteer/browsers@2.10.4':
+ '@puppeteer/browsers@2.10.5':
dependencies:
debug: 4.4.1(supports-color@6.0.0)
extract-zip: 2.0.1
progress: 2.0.3
proxy-agent: 6.5.0
semver: 7.7.2
- tar-fs: 3.0.8
+ tar-fs: 3.0.9
yargs: 17.7.2
transitivePeerDependencies:
- bare-buffer
@@ -17051,10 +17149,10 @@ snapshots:
'@lezer/highlight': 1.2.1
'@lezer/lr': 1.4.2
- '@stylistic/eslint-plugin@4.4.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@stylistic/eslint-plugin@4.4.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
- '@typescript-eslint/utils': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- eslint: 9.27.0(jiti@2.4.2)
+ '@typescript-eslint/utils': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ eslint: 9.28.0(jiti@2.4.2)
eslint-visitor-keys: 4.2.0
espree: 10.3.0
estraverse: 5.3.0
@@ -17214,24 +17312,24 @@ snapshots:
'@types/babel__core@7.20.5':
dependencies:
- '@babel/parser': 7.27.2
- '@babel/types': 7.27.1
+ '@babel/parser': 7.27.5
+ '@babel/types': 7.27.3
'@types/babel__generator': 7.27.0
'@types/babel__template': 7.4.4
'@types/babel__traverse': 7.20.7
'@types/babel__generator@7.27.0':
dependencies:
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@types/babel__template@7.4.4':
dependencies:
- '@babel/parser': 7.27.2
- '@babel/types': 7.27.1
+ '@babel/parser': 7.27.5
+ '@babel/types': 7.27.3
'@types/babel__traverse@7.20.7':
dependencies:
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@types/better-sqlite3@7.6.13':
dependencies:
@@ -17257,6 +17355,10 @@ snapshots:
'@types/node': 22.15.29
'@types/responselike': 1.0.3
+ '@types/chai@5.2.2':
+ dependencies:
+ '@types/deep-eql': 4.0.2
+
'@types/cls-hooked@4.3.9':
dependencies:
'@types/node': 22.15.21
@@ -17419,6 +17521,8 @@ snapshots:
dependencies:
'@types/ms': 2.1.0
+ '@types/deep-eql@4.0.2': {}
+
'@types/ejs@3.1.5': {}
'@types/electron-squirrel-startup@1.0.2': {}
@@ -17556,7 +17660,7 @@ snapshots:
'@types/methods@1.1.4': {}
- '@types/mime-types@2.1.4': {}
+ '@types/mime-types@3.0.0': {}
'@types/mime@1.3.5': {}
@@ -17568,19 +17672,12 @@ snapshots:
dependencies:
'@types/express': 5.0.2
- '@types/node-fetch@2.6.12':
- dependencies:
- '@types/node': 22.15.29
- form-data: 4.0.2
-
'@types/node-forge@1.3.11':
dependencies:
'@types/node': 22.15.29
'@types/node@16.9.1': {}
- '@types/node@18.16.9': {}
-
'@types/node@20.17.32':
dependencies:
undici-types: 6.19.8
@@ -17719,15 +17816,15 @@ snapshots:
'@types/node': 22.15.29
optional: true
- '@typescript-eslint/eslint-plugin@8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@typescript-eslint/eslint-plugin@8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
'@eslint-community/regexpp': 4.12.1
- '@typescript-eslint/parser': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/scope-manager': 8.33.0
- '@typescript-eslint/type-utils': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/utils': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/visitor-keys': 8.33.0
- eslint: 9.27.0(jiti@2.4.2)
+ '@typescript-eslint/parser': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/scope-manager': 8.33.1
+ '@typescript-eslint/type-utils': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/utils': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/visitor-keys': 8.33.1
+ eslint: 9.28.0(jiti@2.4.2)
graphemer: 1.4.0
ignore: 7.0.4
natural-compare: 1.4.0
@@ -17736,58 +17833,58 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
- '@typescript-eslint/scope-manager': 8.33.0
- '@typescript-eslint/types': 8.33.0
- '@typescript-eslint/typescript-estree': 8.33.0(typescript@5.8.3)
- '@typescript-eslint/visitor-keys': 8.33.0
+ '@typescript-eslint/scope-manager': 8.33.1
+ '@typescript-eslint/types': 8.33.1
+ '@typescript-eslint/typescript-estree': 8.33.1(typescript@5.8.3)
+ '@typescript-eslint/visitor-keys': 8.33.1
debug: 4.4.1(supports-color@6.0.0)
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/project-service@8.33.0(typescript@5.8.3)':
+ '@typescript-eslint/project-service@8.33.1(typescript@5.8.3)':
dependencies:
- '@typescript-eslint/tsconfig-utils': 8.33.0(typescript@5.8.3)
- '@typescript-eslint/types': 8.33.0
+ '@typescript-eslint/tsconfig-utils': 8.33.1(typescript@5.8.3)
+ '@typescript-eslint/types': 8.33.1
debug: 4.4.1(supports-color@6.0.0)
+ typescript: 5.8.3
transitivePeerDependencies:
- supports-color
- - typescript
'@typescript-eslint/scope-manager@8.32.1':
dependencies:
'@typescript-eslint/types': 8.32.1
'@typescript-eslint/visitor-keys': 8.32.1
- '@typescript-eslint/scope-manager@8.33.0':
+ '@typescript-eslint/scope-manager@8.33.1':
dependencies:
- '@typescript-eslint/types': 8.33.0
- '@typescript-eslint/visitor-keys': 8.33.0
+ '@typescript-eslint/types': 8.33.1
+ '@typescript-eslint/visitor-keys': 8.33.1
- '@typescript-eslint/tsconfig-utils@8.33.0(typescript@5.8.3)':
+ '@typescript-eslint/tsconfig-utils@8.33.1(typescript@5.8.3)':
dependencies:
typescript: 5.8.3
- '@typescript-eslint/type-utils@8.32.1(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@typescript-eslint/type-utils@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
'@typescript-eslint/typescript-estree': 8.32.1(typescript@5.8.3)
- '@typescript-eslint/utils': 8.32.1(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/utils': 8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
debug: 4.4.1(supports-color@6.0.0)
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
ts-api-utils: 2.1.0(typescript@5.8.3)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/type-utils@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@typescript-eslint/type-utils@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
- '@typescript-eslint/typescript-estree': 8.33.0(typescript@5.8.3)
- '@typescript-eslint/utils': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/typescript-estree': 8.33.1(typescript@5.8.3)
+ '@typescript-eslint/utils': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
debug: 4.4.1(supports-color@6.0.0)
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
ts-api-utils: 2.1.0(typescript@5.8.3)
typescript: 5.8.3
transitivePeerDependencies:
@@ -17795,7 +17892,7 @@ snapshots:
'@typescript-eslint/types@8.32.1': {}
- '@typescript-eslint/types@8.33.0': {}
+ '@typescript-eslint/types@8.33.1': {}
'@typescript-eslint/typescript-estree@8.32.1(typescript@5.8.3)':
dependencies:
@@ -17811,12 +17908,12 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/typescript-estree@8.33.0(typescript@5.8.3)':
+ '@typescript-eslint/typescript-estree@8.33.1(typescript@5.8.3)':
dependencies:
- '@typescript-eslint/project-service': 8.33.0(typescript@5.8.3)
- '@typescript-eslint/tsconfig-utils': 8.33.0(typescript@5.8.3)
- '@typescript-eslint/types': 8.33.0
- '@typescript-eslint/visitor-keys': 8.33.0
+ '@typescript-eslint/project-service': 8.33.1(typescript@5.8.3)
+ '@typescript-eslint/tsconfig-utils': 8.33.1(typescript@5.8.3)
+ '@typescript-eslint/types': 8.33.1
+ '@typescript-eslint/visitor-keys': 8.33.1
debug: 4.4.1(supports-color@6.0.0)
fast-glob: 3.3.3
is-glob: 4.0.3
@@ -17827,24 +17924,24 @@ snapshots:
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/utils@8.32.1(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@typescript-eslint/utils@8.32.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
- '@eslint-community/eslint-utils': 4.7.0(eslint@9.27.0(jiti@2.4.2))
+ '@eslint-community/eslint-utils': 4.7.0(eslint@9.28.0(jiti@2.4.2))
'@typescript-eslint/scope-manager': 8.32.1
'@typescript-eslint/types': 8.32.1
'@typescript-eslint/typescript-estree': 8.32.1(typescript@5.8.3)
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
- '@typescript-eslint/utils@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)':
+ '@typescript-eslint/utils@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)':
dependencies:
- '@eslint-community/eslint-utils': 4.7.0(eslint@9.27.0(jiti@2.4.2))
- '@typescript-eslint/scope-manager': 8.33.0
- '@typescript-eslint/types': 8.33.0
- '@typescript-eslint/typescript-estree': 8.33.0(typescript@5.8.3)
- eslint: 9.27.0(jiti@2.4.2)
+ '@eslint-community/eslint-utils': 4.7.0(eslint@9.28.0(jiti@2.4.2))
+ '@typescript-eslint/scope-manager': 8.33.1
+ '@typescript-eslint/types': 8.33.1
+ '@typescript-eslint/typescript-estree': 8.33.1(typescript@5.8.3)
+ eslint: 9.28.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
@@ -17854,32 +17951,32 @@ snapshots:
'@typescript-eslint/types': 8.32.1
eslint-visitor-keys: 4.2.0
- '@typescript-eslint/visitor-keys@8.33.0':
+ '@typescript-eslint/visitor-keys@8.33.1':
dependencies:
- '@typescript-eslint/types': 8.33.0
+ '@typescript-eslint/types': 8.33.1
eslint-visitor-keys: 4.2.0
- '@vitest/browser@3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))':
+ '@vitest/browser@3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))':
dependencies:
'@testing-library/dom': 10.4.0
'@testing-library/user-event': 14.6.1(@testing-library/dom@10.4.0)
- '@vitest/mocker': 3.1.4(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
- '@vitest/utils': 3.1.4
+ '@vitest/mocker': 3.2.0(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
+ '@vitest/utils': 3.2.0
magic-string: 0.30.17
sirv: 3.0.1
tinyrainbow: 2.0.0
- vitest: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ vitest: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5)
optionalDependencies:
playwright: 1.52.0
- webdriverio: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ webdriverio: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
transitivePeerDependencies:
- bufferutil
- msw
- utf-8-validate
- vite
- '@vitest/coverage-istanbul@3.1.4(vitest@3.1.4)':
+ '@vitest/coverage-istanbul@3.2.0(vitest@3.2.0)':
dependencies:
'@istanbuljs/schema': 0.1.3
debug: 4.4.1(supports-color@6.0.0)
@@ -17891,14 +17988,15 @@ snapshots:
magicast: 0.3.5
test-exclude: 7.0.1
tinyrainbow: 2.0.0
- vitest: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ vitest: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
transitivePeerDependencies:
- supports-color
- '@vitest/coverage-v8@3.1.4(@vitest/browser@3.1.4)(vitest@3.1.4)':
+ '@vitest/coverage-v8@3.2.1(vitest@3.2.1)':
dependencies:
'@ampproject/remapping': 2.3.0
'@bcoe/v8-coverage': 1.0.2
+ ast-v8-to-istanbul: 0.3.3
debug: 4.4.1(supports-color@6.0.0)
istanbul-lib-coverage: 3.2.2
istanbul-lib-report: 3.0.1
@@ -17909,61 +18007,114 @@ snapshots:
std-env: 3.9.0
test-exclude: 7.0.1
tinyrainbow: 2.0.0
- vitest: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
- optionalDependencies:
- '@vitest/browser': 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ vitest: 3.2.1(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/ui@3.2.1)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
transitivePeerDependencies:
- supports-color
- '@vitest/expect@3.1.4':
+ '@vitest/expect@3.2.0':
dependencies:
- '@vitest/spy': 3.1.4
- '@vitest/utils': 3.1.4
+ '@types/chai': 5.2.2
+ '@vitest/spy': 3.2.0
+ '@vitest/utils': 3.2.0
chai: 5.2.0
tinyrainbow: 2.0.0
- '@vitest/mocker@3.1.4(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))':
+ '@vitest/expect@3.2.1':
dependencies:
- '@vitest/spy': 3.1.4
+ '@types/chai': 5.2.2
+ '@vitest/spy': 3.2.1
+ '@vitest/utils': 3.2.1
+ chai: 5.2.0
+ tinyrainbow: 2.0.0
+
+ '@vitest/mocker@3.2.0(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))':
+ dependencies:
+ '@vitest/spy': 3.2.0
estree-walker: 3.0.3
magic-string: 0.30.17
optionalDependencies:
msw: 2.7.5(@types/node@22.15.29)(typescript@5.8.3)
vite: 6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
- '@vitest/pretty-format@3.1.4':
+ '@vitest/mocker@3.2.1(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))':
+ dependencies:
+ '@vitest/spy': 3.2.1
+ estree-walker: 3.0.3
+ magic-string: 0.30.17
+ optionalDependencies:
+ msw: 2.7.5(@types/node@22.15.29)(typescript@5.8.3)
+ vite: 6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+
+ '@vitest/pretty-format@3.2.0':
dependencies:
tinyrainbow: 2.0.0
- '@vitest/runner@3.1.4':
+ '@vitest/pretty-format@3.2.1':
dependencies:
- '@vitest/utils': 3.1.4
+ tinyrainbow: 2.0.0
+
+ '@vitest/runner@3.2.0':
+ dependencies:
+ '@vitest/utils': 3.2.0
pathe: 2.0.3
- '@vitest/snapshot@3.1.4':
+ '@vitest/runner@3.2.1':
dependencies:
- '@vitest/pretty-format': 3.1.4
+ '@vitest/utils': 3.2.1
+ pathe: 2.0.3
+
+ '@vitest/snapshot@3.2.0':
+ dependencies:
+ '@vitest/pretty-format': 3.2.0
magic-string: 0.30.17
pathe: 2.0.3
- '@vitest/spy@3.1.4':
+ '@vitest/snapshot@3.2.1':
dependencies:
- tinyspy: 3.0.2
+ '@vitest/pretty-format': 3.2.1
+ magic-string: 0.30.17
+ pathe: 2.0.3
- '@vitest/ui@3.1.4(vitest@3.1.4)':
+ '@vitest/spy@3.2.0':
dependencies:
- '@vitest/utils': 3.1.4
+ tinyspy: 4.0.3
+
+ '@vitest/spy@3.2.1':
+ dependencies:
+ tinyspy: 4.0.3
+
+ '@vitest/ui@3.2.0(vitest@3.2.0)':
+ dependencies:
+ '@vitest/utils': 3.2.0
fflate: 0.8.2
flatted: 3.3.3
pathe: 2.0.3
sirv: 3.0.1
- tinyglobby: 0.2.13
+ tinyglobby: 0.2.14
tinyrainbow: 2.0.0
- vitest: 3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ vitest: 3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ optional: true
- '@vitest/utils@3.1.4':
+ '@vitest/ui@3.2.1(vitest@3.2.1)':
dependencies:
- '@vitest/pretty-format': 3.1.4
+ '@vitest/utils': 3.2.1
+ fflate: 0.8.2
+ flatted: 3.3.3
+ pathe: 2.0.3
+ sirv: 3.0.1
+ tinyglobby: 0.2.14
+ tinyrainbow: 2.0.0
+ vitest: 3.2.1(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/ui@3.2.1)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+
+ '@vitest/utils@3.2.0':
+ dependencies:
+ '@vitest/pretty-format': 3.2.0
+ loupe: 3.1.3
+ tinyrainbow: 2.0.0
+
+ '@vitest/utils@3.2.1':
+ dependencies:
+ '@vitest/pretty-format': 3.2.1
loupe: 3.1.3
tinyrainbow: 2.0.0
@@ -17981,7 +18132,7 @@ snapshots:
'@vue/compiler-core@3.5.14':
dependencies:
- '@babel/parser': 7.27.2
+ '@babel/parser': 7.27.5
'@vue/shared': 3.5.14
entities: 4.5.0
estree-walker: 2.0.2
@@ -18012,11 +18163,11 @@ snapshots:
'@vue/shared@3.5.14': {}
- '@wdio/config@9.14.0':
+ '@wdio/config@9.15.0':
dependencies:
- '@wdio/logger': 9.4.4
- '@wdio/types': 9.14.0
- '@wdio/utils': 9.14.0
+ '@wdio/logger': 9.15.0
+ '@wdio/types': 9.15.0
+ '@wdio/utils': 9.15.0
deepmerge-ts: 7.1.5
glob: 10.4.5
import-meta-resolve: 4.1.0
@@ -18024,28 +18175,28 @@ snapshots:
- bare-buffer
- supports-color
- '@wdio/logger@9.4.4':
+ '@wdio/logger@9.15.0':
dependencies:
chalk: 5.4.1
loglevel: 1.9.2
loglevel-plugin-prefix: 0.8.4
strip-ansi: 7.1.0
- '@wdio/protocols@9.14.0': {}
+ '@wdio/protocols@9.15.0': {}
'@wdio/repl@9.4.4':
dependencies:
'@types/node': 20.17.32
- '@wdio/types@9.14.0':
+ '@wdio/types@9.15.0':
dependencies:
'@types/node': 20.17.32
- '@wdio/utils@9.14.0':
+ '@wdio/utils@9.15.0':
dependencies:
- '@puppeteer/browsers': 2.10.4
- '@wdio/logger': 9.4.4
- '@wdio/types': 9.14.0
+ '@puppeteer/browsers': 2.10.5
+ '@wdio/logger': 9.15.0
+ '@wdio/types': 9.15.0
decamelize: 6.0.0
deepmerge-ts: 7.1.5
edgedriver: 6.1.1
@@ -18151,7 +18302,7 @@ snapshots:
js-yaml: 3.14.1
tslib: 2.8.1
- '@zip.js/zip.js@2.7.61': {}
+ '@zip.js/zip.js@2.7.62': {}
'@zkochan/js-yaml@0.0.7':
dependencies:
@@ -18414,6 +18565,12 @@ snapshots:
dependencies:
tslib: 2.8.1
+ ast-v8-to-istanbul@0.3.3:
+ dependencies:
+ '@jridgewell/trace-mapping': 0.3.25
+ estree-walker: 3.0.3
+ js-tokens: 9.0.1
+
astral-regex@2.0.0: {}
async-function@1.0.0: {}
@@ -18492,7 +18649,7 @@ snapshots:
babel-plugin-jest-hoist@29.6.3:
dependencies:
'@babel/template': 7.27.0
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@types/babel__core': 7.20.5
'@types/babel__traverse': 7.20.7
@@ -18826,9 +18983,9 @@ snapshots:
normalize-url: 6.1.0
responselike: 2.0.1
- cacheable@1.8.10:
+ cacheable@1.9.0:
dependencies:
- hookified: 1.8.2
+ hookified: 1.9.0
keyv: 5.3.3
call-bind-apply-helpers@1.0.2:
@@ -19256,6 +19413,13 @@ snapshots:
readable-stream: 2.3.8
typedarray: 0.0.6
+ concat-stream@2.0.0:
+ dependencies:
+ buffer-from: 1.1.2
+ inherits: 2.0.4
+ readable-stream: 3.6.2
+ typedarray: 0.0.6
+
confbox@0.1.8: {}
confbox@0.2.2: {}
@@ -20155,8 +20319,8 @@ snapshots:
edgedriver@6.1.1:
dependencies:
- '@wdio/logger': 9.4.4
- '@zip.js/zip.js': 2.7.61
+ '@wdio/logger': 9.15.0
+ '@zip.js/zip.js': 2.7.62
decamelize: 6.0.0
edge-paths: 3.0.5
fast-xml-parser: 4.5.3
@@ -20511,24 +20675,24 @@ snapshots:
optionalDependencies:
source-map: 0.6.1
- eslint-config-ckeditor5@10.0.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3):
+ eslint-config-ckeditor5@10.0.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3):
dependencies:
- '@eslint/js': 9.27.0
- '@stylistic/eslint-plugin': 4.4.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- eslint: 9.27.0(jiti@2.4.2)
+ '@eslint/js': 9.28.0
+ '@stylistic/eslint-plugin': 4.4.0(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ eslint: 9.28.0(jiti@2.4.2)
eslint-plugin-ckeditor5-rules: 10.0.0
- eslint-plugin-mocha: 11.1.0(eslint@9.27.0(jiti@2.4.2))
+ eslint-plugin-mocha: 11.1.0(eslint@9.28.0(jiti@2.4.2))
globals: 16.2.0
typescript: 5.8.3
- typescript-eslint: 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
+ typescript-eslint: 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
transitivePeerDependencies:
- supports-color
- eslint-config-prettier@10.1.5(eslint@9.27.0(jiti@2.4.2)):
+ eslint-config-prettier@10.1.5(eslint@9.28.0(jiti@2.4.2)):
dependencies:
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
- eslint-linter-browserify@9.27.0: {}
+ eslint-linter-browserify@9.28.0: {}
eslint-plugin-ckeditor5-rules@10.0.0:
dependencies:
@@ -20539,15 +20703,15 @@ snapshots:
upath: 2.0.1
validate-npm-package-name: 5.0.1
- eslint-plugin-mocha@11.1.0(eslint@9.27.0(jiti@2.4.2)):
+ eslint-plugin-mocha@11.1.0(eslint@9.28.0(jiti@2.4.2)):
dependencies:
- '@eslint-community/eslint-utils': 4.7.0(eslint@9.27.0(jiti@2.4.2))
- eslint: 9.27.0(jiti@2.4.2)
+ '@eslint-community/eslint-utils': 4.7.0(eslint@9.28.0(jiti@2.4.2))
+ eslint: 9.28.0(jiti@2.4.2)
globals: 15.15.0
- eslint-plugin-playwright@2.2.0(eslint@9.27.0(jiti@2.4.2)):
+ eslint-plugin-playwright@2.2.0(eslint@9.28.0(jiti@2.4.2)):
dependencies:
- eslint: 9.27.0(jiti@2.4.2)
+ eslint: 9.28.0(jiti@2.4.2)
globals: 13.24.0
eslint-scope@5.1.1:
@@ -20564,19 +20728,19 @@ snapshots:
eslint-visitor-keys@4.2.0: {}
- eslint@9.27.0(jiti@2.4.2):
+ eslint@9.28.0(jiti@2.4.2):
dependencies:
- '@eslint-community/eslint-utils': 4.7.0(eslint@9.27.0(jiti@2.4.2))
+ '@eslint-community/eslint-utils': 4.7.0(eslint@9.28.0(jiti@2.4.2))
'@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.20.0
- '@eslint/config-helpers': 0.2.1
+ '@eslint/config-helpers': 0.2.2
'@eslint/core': 0.14.0
'@eslint/eslintrc': 3.3.1
- '@eslint/js': 9.27.0
+ '@eslint/js': 9.28.0
'@eslint/plugin-kit': 0.3.1
'@humanfs/node': 0.16.6
'@humanwhocodes/module-importer': 1.0.1
- '@humanwhocodes/retry': 0.4.2
+ '@humanwhocodes/retry': 0.4.3
'@types/estree': 1.0.7
'@types/json-schema': 7.0.15
ajv: 6.12.6
@@ -20831,6 +20995,10 @@ snapshots:
optionalDependencies:
picomatch: 4.0.2
+ fdir@6.4.5(picomatch@4.0.2):
+ optionalDependencies:
+ picomatch: 4.0.2
+
fetch-blob@3.2.0:
dependencies:
node-domexception: 1.0.0
@@ -20842,9 +21010,9 @@ snapshots:
dependencies:
escape-string-regexp: 1.0.5
- file-entry-cache@10.0.8:
+ file-entry-cache@10.1.0:
dependencies:
- flat-cache: 6.1.8
+ flat-cache: 6.1.9
file-entry-cache@8.0.0:
dependencies:
@@ -20928,11 +21096,11 @@ snapshots:
flatted: 3.3.3
keyv: 4.5.4
- flat-cache@6.1.8:
+ flat-cache@6.1.9:
dependencies:
- cacheable: 1.8.10
+ cacheable: 1.9.0
flatted: 3.3.3
- hookified: 1.8.2
+ hookified: 1.9.0
flat@5.0.2: {}
@@ -20987,8 +21155,6 @@ snapshots:
cross-spawn: 7.0.6
signal-exit: 4.1.0
- form-data-encoder@1.7.2: {}
-
form-data@3.0.3:
dependencies:
asynckit: 0.4.0
@@ -21003,11 +21169,6 @@ snapshots:
es-set-tostringtag: 2.1.0
mime-types: 2.1.35
- formdata-node@4.4.1:
- dependencies:
- node-domexception: 1.0.0
- web-streams-polyfill: 4.0.0-beta.3
-
formdata-polyfill@4.0.10:
dependencies:
fetch-blob: 3.2.0
@@ -21133,13 +21294,13 @@ snapshots:
geckodriver@5.0.0:
dependencies:
- '@wdio/logger': 9.4.4
- '@zip.js/zip.js': 2.7.61
+ '@wdio/logger': 9.15.0
+ '@zip.js/zip.js': 2.7.62
decamelize: 6.0.0
http-proxy-agent: 7.0.2
https-proxy-agent: 7.0.6
node-fetch: 3.3.2
- tar-fs: 3.0.8
+ tar-fs: 3.0.9
which: 5.0.0
transitivePeerDependencies:
- bare-buffer
@@ -21261,7 +21422,7 @@ snapshots:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
- minimatch: 3.1.2
+ minimatch: 3.0.4
once: 1.4.0
path-is-absolute: 1.0.1
@@ -21387,7 +21548,7 @@ snapshots:
handle-thing@2.0.1: {}
- happy-dom@17.5.6:
+ happy-dom@17.6.3:
dependencies:
webidl-conversions: 7.0.0
whatwg-mimetype: 3.0.0
@@ -21453,7 +21614,7 @@ snapshots:
hoist-non-react-statics@2.5.5: {}
- hookified@1.8.2: {}
+ hookified@1.9.0: {}
hosted-git-info@2.8.9: {}
@@ -22003,7 +22164,7 @@ snapshots:
istanbul-lib-instrument@5.2.1:
dependencies:
'@babel/core': 7.26.10
- '@babel/parser': 7.27.2
+ '@babel/parser': 7.27.5
'@istanbuljs/schema': 0.1.3
istanbul-lib-coverage: 3.2.2
semver: 6.3.1
@@ -22272,7 +22433,7 @@ snapshots:
'@babel/generator': 7.27.0
'@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.10)
'@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.10)
- '@babel/types': 7.27.1
+ '@babel/types': 7.27.3
'@jest/expect-utils': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
@@ -22409,6 +22570,8 @@ snapshots:
js-tokens@4.0.0: {}
+ js-tokens@9.0.1: {}
+
js-yaml@3.13.1:
dependencies:
argparse: 1.0.10
@@ -22806,8 +22969,8 @@ snapshots:
magicast@0.3.5:
dependencies:
- '@babel/parser': 7.27.2
- '@babel/types': 7.27.1
+ '@babel/parser': 7.27.5
+ '@babel/types': 7.27.3
source-map-js: 1.2.1
make-dir@2.1.0:
@@ -23395,11 +23558,11 @@ snapshots:
muggle-string@0.4.1: {}
- multer@2.0.0:
+ multer@2.0.1:
dependencies:
append-field: 1.0.0
busboy: 1.6.0
- concat-stream: 1.6.2
+ concat-stream: 2.0.0
mkdirp: 0.5.6
object-assign: 4.1.1
type-is: 1.6.18
@@ -23728,20 +23891,10 @@ snapshots:
is-docker: 2.2.1
is-wsl: 2.2.0
- openai@4.104.0(encoding@0.1.13)(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.24.4):
- dependencies:
- '@types/node': 18.16.9
- '@types/node-fetch': 2.6.12
- abort-controller: 3.0.0
- agentkeepalive: 4.6.0
- form-data-encoder: 1.7.2
- formdata-node: 4.4.1
- node-fetch: 2.7.0(encoding@0.1.13)
+ openai@5.1.0(ws@8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5))(zod@3.24.4):
optionalDependencies:
ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5)
zod: 3.24.4
- transitivePeerDependencies:
- - encoding
openapi-types@12.1.3: {}
@@ -24391,7 +24544,7 @@ snapshots:
postcss-js: 4.0.1(postcss@8.5.3)
postcss-simple-vars: 7.0.1(postcss@8.5.3)
sugarss: 4.0.1(postcss@8.5.3)
- tinyglobby: 0.2.13
+ tinyglobby: 0.2.14
postcss-mixins@9.0.4(postcss@8.5.3):
dependencies:
@@ -25953,26 +26106,26 @@ snapshots:
postcss: 8.5.3
postcss-selector-parser: 6.1.2
- stylelint-config-ckeditor5@10.0.0(stylelint@16.19.1(typescript@5.8.3)):
+ stylelint-config-ckeditor5@10.0.0(stylelint@16.20.0(typescript@5.8.3)):
dependencies:
- stylelint: 16.19.1(typescript@5.8.3)
- stylelint-config-recommended: 3.0.0(stylelint@16.19.1(typescript@5.8.3))
- stylelint-plugin-ckeditor5-rules: 10.0.0(stylelint@16.19.1(typescript@5.8.3))
+ stylelint: 16.20.0(typescript@5.8.3)
+ stylelint-config-recommended: 3.0.0(stylelint@16.20.0(typescript@5.8.3))
+ stylelint-plugin-ckeditor5-rules: 10.0.0(stylelint@16.20.0(typescript@5.8.3))
- stylelint-config-ckeditor5@2.0.1(stylelint@16.19.1(typescript@5.8.3)):
+ stylelint-config-ckeditor5@2.0.1(stylelint@16.20.0(typescript@5.8.3)):
dependencies:
- stylelint: 16.19.1(typescript@5.8.3)
- stylelint-config-recommended: 3.0.0(stylelint@16.19.1(typescript@5.8.3))
+ stylelint: 16.20.0(typescript@5.8.3)
+ stylelint-config-recommended: 3.0.0(stylelint@16.20.0(typescript@5.8.3))
- stylelint-config-recommended@3.0.0(stylelint@16.19.1(typescript@5.8.3)):
+ stylelint-config-recommended@3.0.0(stylelint@16.20.0(typescript@5.8.3)):
dependencies:
- stylelint: 16.19.1(typescript@5.8.3)
+ stylelint: 16.20.0(typescript@5.8.3)
- stylelint-plugin-ckeditor5-rules@10.0.0(stylelint@16.19.1(typescript@5.8.3)):
+ stylelint-plugin-ckeditor5-rules@10.0.0(stylelint@16.20.0(typescript@5.8.3)):
dependencies:
- stylelint: 16.19.1(typescript@5.8.3)
+ stylelint: 16.20.0(typescript@5.8.3)
- stylelint@16.19.1(typescript@5.0.4):
+ stylelint@16.20.0(typescript@5.0.4):
dependencies:
'@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3)
'@csstools/css-tokenizer': 3.0.3
@@ -25987,7 +26140,7 @@ snapshots:
debug: 4.4.1(supports-color@6.0.0)
fast-glob: 3.3.3
fastest-levenshtein: 1.0.16
- file-entry-cache: 10.0.8
+ file-entry-cache: 10.1.0
global-modules: 2.0.0
globby: 11.1.0
globjoin: 0.1.4
@@ -26016,7 +26169,7 @@ snapshots:
- supports-color
- typescript
- stylelint@16.19.1(typescript@5.8.3):
+ stylelint@16.20.0(typescript@5.8.3):
dependencies:
'@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3)
'@csstools/css-tokenizer': 3.0.3
@@ -26031,7 +26184,7 @@ snapshots:
debug: 4.4.1(supports-color@6.0.0)
fast-glob: 3.3.3
fastest-levenshtein: 1.0.16
- file-entry-cache: 10.0.8
+ file-entry-cache: 10.1.0
global-modules: 2.0.0
globby: 11.1.0
globjoin: 0.1.4
@@ -26225,7 +26378,7 @@ snapshots:
pump: 3.0.2
tar-stream: 2.2.0
- tar-fs@3.0.8:
+ tar-fs@3.0.9:
dependencies:
pump: 3.0.2
tar-stream: 3.1.7
@@ -26365,11 +26518,16 @@ snapshots:
fdir: 6.4.4(picomatch@4.0.2)
picomatch: 4.0.2
- tinypool@1.0.2: {}
+ tinyglobby@0.2.14:
+ dependencies:
+ fdir: 6.4.5(picomatch@4.0.2)
+ picomatch: 4.0.2
+
+ tinypool@1.1.0: {}
tinyrainbow@2.0.0: {}
- tinyspy@3.0.2: {}
+ tinyspy@4.0.3: {}
tldts-core@6.1.86: {}
@@ -26608,12 +26766,12 @@ snapshots:
typedarray@0.0.6: {}
- typescript-eslint@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3):
+ typescript-eslint@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3):
dependencies:
- '@typescript-eslint/eslint-plugin': 8.33.0(@typescript-eslint/parser@8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/parser': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- '@typescript-eslint/utils': 8.33.0(eslint@9.27.0(jiti@2.4.2))(typescript@5.8.3)
- eslint: 9.27.0(jiti@2.4.2)
+ '@typescript-eslint/eslint-plugin': 8.33.1(@typescript-eslint/parser@8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/parser': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ '@typescript-eslint/utils': 8.33.1(eslint@9.28.0(jiti@2.4.2))(typescript@5.8.3)
+ eslint: 9.28.0(jiti@2.4.2)
typescript: 5.8.3
transitivePeerDependencies:
- supports-color
@@ -26819,7 +26977,28 @@ snapshots:
vary@1.1.2: {}
- vite-node@3.1.4(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0):
+ vite-node@3.2.0(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0):
+ dependencies:
+ cac: 6.7.14
+ debug: 4.4.1(supports-color@6.0.0)
+ es-module-lexer: 1.7.0
+ pathe: 2.0.3
+ vite: 6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ transitivePeerDependencies:
+ - '@types/node'
+ - jiti
+ - less
+ - lightningcss
+ - sass
+ - sass-embedded
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ - tsx
+ - yaml
+
+ vite-node@3.2.1(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0):
dependencies:
cac: 6.7.14
debug: 4.4.1(supports-color@6.0.0)
@@ -26895,35 +27074,82 @@ snapshots:
tsx: 4.19.4
yaml: 2.8.0
- vitest@3.1.4(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.1.4)(@vitest/ui@3.1.4)(happy-dom@17.5.6)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0):
+ vitest@3.2.0(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/browser@3.2.0)(@vitest/ui@3.2.0)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0):
dependencies:
- '@vitest/expect': 3.1.4
- '@vitest/mocker': 3.1.4(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
- '@vitest/pretty-format': 3.1.4
- '@vitest/runner': 3.1.4
- '@vitest/snapshot': 3.1.4
- '@vitest/spy': 3.1.4
- '@vitest/utils': 3.1.4
+ '@types/chai': 5.2.2
+ '@vitest/expect': 3.2.0
+ '@vitest/mocker': 3.2.0(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
+ '@vitest/pretty-format': 3.2.0
+ '@vitest/runner': 3.2.0
+ '@vitest/snapshot': 3.2.0
+ '@vitest/spy': 3.2.0
+ '@vitest/utils': 3.2.0
chai: 5.2.0
debug: 4.4.1(supports-color@6.0.0)
expect-type: 1.2.1
magic-string: 0.30.17
pathe: 2.0.3
+ picomatch: 4.0.2
std-env: 3.9.0
tinybench: 2.9.0
tinyexec: 0.3.2
- tinyglobby: 0.2.13
- tinypool: 1.0.2
+ tinyglobby: 0.2.14
+ tinypool: 1.1.0
tinyrainbow: 2.0.0
vite: 6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
- vite-node: 3.1.4(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ vite-node: 3.2.0(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
why-is-node-running: 2.3.0
optionalDependencies:
'@types/debug': 4.1.12
'@types/node': 22.15.29
- '@vitest/browser': 3.1.4(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.1.4)(webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
- '@vitest/ui': 3.1.4(vitest@3.1.4)
- happy-dom: 17.5.6
+ '@vitest/browser': 3.2.0(bufferutil@4.0.9)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(playwright@1.52.0)(utf-8-validate@6.0.5)(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))(vitest@3.2.0)(webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))
+ '@vitest/ui': 3.2.0(vitest@3.2.0)
+ happy-dom: 17.6.3
+ jsdom: 26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ transitivePeerDependencies:
+ - jiti
+ - less
+ - lightningcss
+ - msw
+ - sass
+ - sass-embedded
+ - stylus
+ - sugarss
+ - supports-color
+ - terser
+ - tsx
+ - yaml
+
+ vitest@3.2.1(@types/debug@4.1.12)(@types/node@22.15.29)(@vitest/ui@3.2.1)(happy-dom@17.6.3)(jiti@2.4.2)(jsdom@26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5))(less@4.1.3)(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0):
+ dependencies:
+ '@types/chai': 5.2.2
+ '@vitest/expect': 3.2.1
+ '@vitest/mocker': 3.2.1(msw@2.7.5(@types/node@22.15.29)(typescript@5.8.3))(vite@6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0))
+ '@vitest/pretty-format': 3.2.1
+ '@vitest/runner': 3.2.1
+ '@vitest/snapshot': 3.2.1
+ '@vitest/spy': 3.2.1
+ '@vitest/utils': 3.2.1
+ chai: 5.2.0
+ debug: 4.4.1(supports-color@6.0.0)
+ expect-type: 1.2.1
+ magic-string: 0.30.17
+ pathe: 2.0.3
+ picomatch: 4.0.2
+ std-env: 3.9.0
+ tinybench: 2.9.0
+ tinyexec: 0.3.2
+ tinyglobby: 0.2.14
+ tinypool: 1.1.0
+ tinyrainbow: 2.0.0
+ vite: 6.3.5(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ vite-node: 3.2.1(@types/node@22.15.29)(jiti@2.4.2)(less@4.1.3)(sass-embedded@1.87.0)(sass@1.87.0)(stylus@0.64.0)(sugarss@4.0.1(postcss@8.5.3))(terser@5.39.0)(tsx@4.19.4)(yaml@2.8.0)
+ why-is-node-running: 2.3.0
+ optionalDependencies:
+ '@types/debug': 4.1.12
+ '@types/node': 22.15.29
+ '@vitest/ui': 3.2.1(vitest@3.2.1)
+ happy-dom: 17.6.3
jsdom: 26.1.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
transitivePeerDependencies:
- jiti
@@ -27003,19 +27229,17 @@ snapshots:
web-streams-polyfill@3.3.3: {}
- web-streams-polyfill@4.0.0-beta.3: {}
-
web-worker@1.5.0: {}
- webdriver@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5):
+ webdriver@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5):
dependencies:
'@types/node': 20.17.32
'@types/ws': 8.18.1
- '@wdio/config': 9.14.0
- '@wdio/logger': 9.4.4
- '@wdio/protocols': 9.14.0
- '@wdio/types': 9.14.0
- '@wdio/utils': 9.14.0
+ '@wdio/config': 9.15.0
+ '@wdio/logger': 9.15.0
+ '@wdio/protocols': 9.15.0
+ '@wdio/types': 9.15.0
+ '@wdio/utils': 9.15.0
deepmerge-ts: 7.1.5
undici: 6.21.3
ws: 8.18.2(bufferutil@4.0.9)(utf-8-validate@6.0.5)
@@ -27025,16 +27249,16 @@ snapshots:
- supports-color
- utf-8-validate
- webdriverio@9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5):
+ webdriverio@9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5):
dependencies:
'@types/node': 20.17.32
'@types/sinonjs__fake-timers': 8.1.5
- '@wdio/config': 9.14.0
- '@wdio/logger': 9.4.4
- '@wdio/protocols': 9.14.0
+ '@wdio/config': 9.15.0
+ '@wdio/logger': 9.15.0
+ '@wdio/protocols': 9.15.0
'@wdio/repl': 9.4.4
- '@wdio/types': 9.14.0
- '@wdio/utils': 9.14.0
+ '@wdio/types': 9.15.0
+ '@wdio/utils': 9.15.0
archiver: 7.0.1
aria-query: 5.3.2
cheerio: 1.0.0
@@ -27051,7 +27275,7 @@ snapshots:
rgb2hex: 0.2.5
serialize-error: 11.0.3
urlpattern-polyfill: 10.0.0
- webdriver: 9.14.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
+ webdriver: 9.15.0(bufferutil@4.0.9)(utf-8-validate@6.0.5)
transitivePeerDependencies:
- bare-buffer
- bufferutil