Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(etapi): resolve suggestions for norms from gemini
perfectra1n0650be664d99
diff --git a/apps/server/etapi.openapi.yaml b/apps/server/etapi.openapi.yamlindex af05bdbe57..2e6f941eb2 100644--- a/apps/server/etapi.openapi.yaml+++ b/apps/server/etapi.openapi.yaml@@ -446,15 +446,16 @@ paths:schema:$ref: "#/components/schemas/EntityId"get:- description: Returns revision content identified by its ID+ description: Returns revision content identified by its ID. The Content-Type header will match the revision's MIME type.operationId: getRevisionContentresponses:"200":- description: revision content response+ description: Revision content. The Content-Type header will be set to the revision's actual MIME type (e.g., text/html, text/plain, image/png).content:- text/html:+ application/octet-stream:schema:type: string+ format: binarydefault:description: unexpected errorcontent:@@ -1379,16 +1380,16 @@ components:title:type: stringdescription: Title at the time of the change (may be "[protected]" for protected notes)- current_title:+ currentTitle:type: stringdescription: Current title of the note (may be "[protected]" for protected notes)- current_isDeleted:+ currentIsDeleted:type: booleandescription: Whether the note is currently deleted- current_deleteId:+ currentDeleteId:type: stringdescription: Delete ID if the note is deleted- current_isProtected:+ currentIsProtected:type: booleandescription: Whether the note is protectedutcDate:diff --git a/apps/server/spec/etapi/note-history.spec.ts b/apps/server/spec/etapi/note-history.spec.tsindex 7696c00516..c78e8d359c 100644--- a/apps/server/spec/etapi/note-history.spec.ts+++ b/apps/server/spec/etapi/note-history.spec.ts@@ -42,8 +42,8 @@ describe("etapi/note-history", () => {expect(entry).toHaveProperty("title");expect(entry).toHaveProperty("utcDate");expect(entry).toHaveProperty("date");- expect(entry).toHaveProperty("current_isDeleted");- expect(entry).toHaveProperty("current_isProtected");+ expect(entry).toHaveProperty("currentIsDeleted");+ expect(entry).toHaveProperty("currentIsProtected");});it("filters history by ancestor note", async () => {@@ -83,7 +83,7 @@ describe("etapi/note-history", () => {.expect(200);const deletedEntry = response.body.find(- (entry: any) => entry.noteId === noteToDeleteId && entry.current_isDeleted === true+ (entry: any) => entry.noteId === noteToDeleteId && entry.currentIsDeleted === true);// Deleted entries should have canBeUndeleted propertydiff --git a/apps/server/src/etapi/revisions.ts b/apps/server/src/etapi/revisions.tsindex 6451b18a15..e76877ddc5 100644--- a/apps/server/src/etapi/revisions.ts+++ b/apps/server/src/etapi/revisions.ts@@ -21,10 +21,10 @@ function register(router: Router) {recentChanges = sql.getRows<RecentChangeRow>(`SELECTnotes.noteId,- notes.isDeleted AS current_isDeleted,- notes.deleteId AS current_deleteId,- notes.title AS current_title,- notes.isProtected AS current_isProtected,+ notes.isDeleted AS currentIsDeleted,+ notes.deleteId AS currentDeleteId,+ notes.title AS currentTitle,+ notes.isProtected AS currentIsProtected,revisions.title,revisions.utcDateCreated AS utcDate,revisions.dateCreated AS date@@ -33,10 +33,10 @@ function register(router: Router) {UNION ALLSELECTnotes.noteId,- notes.isDeleted AS current_isDeleted,- notes.deleteId AS current_deleteId,- notes.title AS current_title,- notes.isProtected AS current_isProtected,+ notes.isDeleted AS currentIsDeleted,+ notes.deleteId AS currentDeleteId,+ notes.title AS currentTitle,+ notes.isProtected AS currentIsProtected,notes.title,notes.utcDateCreated AS utcDate,notes.dateCreated AS date@@ -44,10 +44,10 @@ function register(router: Router) {UNION ALLSELECTnotes.noteId,- notes.isDeleted AS current_isDeleted,- notes.deleteId AS current_deleteId,- notes.title AS current_title,- notes.isProtected AS current_isProtected,+ notes.isDeleted AS currentIsDeleted,+ notes.deleteId AS currentDeleteId,+ notes.title AS currentTitle,+ notes.isProtected AS currentIsProtected,notes.title,notes.utcDateModified AS utcDate,notes.dateModified AS date@@ -68,10 +68,10 @@ function register(router: Router) {)SELECTnotes.noteId,- notes.isDeleted AS current_isDeleted,- notes.deleteId AS current_deleteId,- notes.title AS current_title,- notes.isProtected AS current_isProtected,+ notes.isDeleted AS currentIsDeleted,+ notes.deleteId AS currentDeleteId,+ notes.title AS currentTitle,+ notes.isProtected AS currentIsProtected,revisions.title,revisions.utcDateCreated AS utcDate,revisions.dateCreated AS date@@ -81,10 +81,10 @@ function register(router: Router) {UNION ALLSELECTnotes.noteId,- notes.isDeleted AS current_isDeleted,- notes.deleteId AS current_deleteId,- notes.title AS current_title,- notes.isProtected AS current_isProtected,+ notes.isDeleted AS currentIsDeleted,+ notes.deleteId AS currentDeleteId,+ notes.title AS currentTitle,+ notes.isProtected AS currentIsProtected,notes.title,notes.utcDateCreated AS utcDate,notes.dateCreated AS date@@ -93,10 +93,10 @@ function register(router: Router) {UNION ALLSELECTnotes.noteId,- notes.isDeleted AS current_isDeleted,- notes.deleteId AS current_deleteId,- notes.title AS current_title,- notes.isProtected AS current_isProtected,+ notes.isDeleted AS currentIsDeleted,+ notes.deleteId AS currentDeleteId,+ notes.title AS currentTitle,+ notes.isProtected AS currentIsProtected,notes.title,notes.utcDateModified AS utcDate,notes.dateModified AS date@@ -107,17 +107,17 @@ function register(router: Router) {}for (const change of recentChanges) {- if (change.current_isProtected) {+ if (change.currentIsProtected) {if (protectedSessionService.isProtectedSessionAvailable()) {change.title = protectedSessionService.decryptString(change.title) || "[protected]";- change.current_title = protectedSessionService.decryptString(change.current_title) || "[protected]";+ change.currentTitle = protectedSessionService.decryptString(change.currentTitle) || "[protected]";} else {- change.title = change.current_title = "[protected]";+ change.title = change.currentTitle = "[protected]";}}- if (change.current_isDeleted) {- const deleteId = change.current_deleteId;+ if (change.currentIsDeleted) {+ const deleteId = change.currentDeleteId;const undeletedParentBranchIds = noteService.getUndeletedParentBranchIds(change.noteId, deleteId);diff --git a/packages/commons/src/lib/server_api.ts b/packages/commons/src/lib/server_api.tsindex a15192fd28..7c197a7614 100644--- a/packages/commons/src/lib/server_api.ts+++ b/packages/commons/src/lib/server_api.ts@@ -56,10 +56,10 @@ export interface RevisionPojo {export interface RecentChangeRow {noteId: string;- current_isDeleted: boolean;- current_deleteId: string;- current_title: string;- current_isProtected: boolean;+ currentIsDeleted: boolean;+ currentDeleteId: string;+ currentTitle: string;+ currentIsProtected: boolean;title: string;utcDate: string;date: string;