diff --git a/apps/server/etapi.openapi.yaml b/apps/server/etapi.openapi.yaml index 2e6f941eb..af05bdbe5 100644 --- a/apps/server/etapi.openapi.yaml +++ b/apps/server/etapi.openapi.yaml @@ -446,16 +446,15 @@ paths: schema: $ref: "#/components/schemas/EntityId" get: - description: Returns revision content identified by its ID. The Content-Type header will match the revision's MIME type. + description: Returns revision content identified by its ID operationId: getRevisionContent responses: "200": - 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). + description: revision content response content: - application/octet-stream: + text/html: schema: type: string - format: binary default: description: unexpected error content: @@ -1380,16 +1379,16 @@ components: title: type: string description: Title at the time of the change (may be "[protected]" for protected notes) - currentTitle: + current_title: type: string description: Current title of the note (may be "[protected]" for protected notes) - currentIsDeleted: + current_isDeleted: type: boolean description: Whether the note is currently deleted - currentDeleteId: + current_deleteId: type: string description: Delete ID if the note is deleted - currentIsProtected: + current_isProtected: type: boolean description: Whether the note is protected utcDate: diff --git a/apps/server/spec/etapi/note-history.spec.ts b/apps/server/spec/etapi/note-history.spec.ts index c78e8d359..7696c0051 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("currentIsDeleted"); - expect(entry).toHaveProperty("currentIsProtected"); + expect(entry).toHaveProperty("current_isDeleted"); + expect(entry).toHaveProperty("current_isProtected"); }); 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.currentIsDeleted === true + (entry: any) => entry.noteId === noteToDeleteId && entry.current_isDeleted === true ); // Deleted entries should have canBeUndeleted property diff --git a/apps/server/src/etapi/revisions.ts b/apps/server/src/etapi/revisions.ts index e76877ddc..6451b18a1 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(` SELECT notes.noteId, - notes.isDeleted AS currentIsDeleted, - notes.deleteId AS currentDeleteId, - notes.title AS currentTitle, - notes.isProtected AS currentIsProtected, + notes.isDeleted AS current_isDeleted, + notes.deleteId AS current_deleteId, + notes.title AS current_title, + notes.isProtected AS current_isProtected, revisions.title, revisions.utcDateCreated AS utcDate, revisions.dateCreated AS date @@ -33,10 +33,10 @@ function register(router: Router) { UNION ALL SELECT notes.noteId, - notes.isDeleted AS currentIsDeleted, - notes.deleteId AS currentDeleteId, - notes.title AS currentTitle, - notes.isProtected AS currentIsProtected, + notes.isDeleted AS current_isDeleted, + notes.deleteId AS current_deleteId, + notes.title AS current_title, + notes.isProtected AS current_isProtected, notes.title, notes.utcDateCreated AS utcDate, notes.dateCreated AS date @@ -44,10 +44,10 @@ function register(router: Router) { UNION ALL SELECT notes.noteId, - notes.isDeleted AS currentIsDeleted, - notes.deleteId AS currentDeleteId, - notes.title AS currentTitle, - notes.isProtected AS currentIsProtected, + notes.isDeleted AS current_isDeleted, + notes.deleteId AS current_deleteId, + notes.title AS current_title, + notes.isProtected AS current_isProtected, notes.title, notes.utcDateModified AS utcDate, notes.dateModified AS date @@ -68,10 +68,10 @@ function register(router: Router) { ) SELECT notes.noteId, - notes.isDeleted AS currentIsDeleted, - notes.deleteId AS currentDeleteId, - notes.title AS currentTitle, - notes.isProtected AS currentIsProtected, + notes.isDeleted AS current_isDeleted, + notes.deleteId AS current_deleteId, + notes.title AS current_title, + notes.isProtected AS current_isProtected, revisions.title, revisions.utcDateCreated AS utcDate, revisions.dateCreated AS date @@ -81,10 +81,10 @@ function register(router: Router) { UNION ALL SELECT notes.noteId, - notes.isDeleted AS currentIsDeleted, - notes.deleteId AS currentDeleteId, - notes.title AS currentTitle, - notes.isProtected AS currentIsProtected, + notes.isDeleted AS current_isDeleted, + notes.deleteId AS current_deleteId, + notes.title AS current_title, + notes.isProtected AS current_isProtected, notes.title, notes.utcDateCreated AS utcDate, notes.dateCreated AS date @@ -93,10 +93,10 @@ function register(router: Router) { UNION ALL SELECT notes.noteId, - notes.isDeleted AS currentIsDeleted, - notes.deleteId AS currentDeleteId, - notes.title AS currentTitle, - notes.isProtected AS currentIsProtected, + notes.isDeleted AS current_isDeleted, + notes.deleteId AS current_deleteId, + notes.title AS current_title, + notes.isProtected AS current_isProtected, 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.currentIsProtected) { + if (change.current_isProtected) { if (protectedSessionService.isProtectedSessionAvailable()) { change.title = protectedSessionService.decryptString(change.title) || "[protected]"; - change.currentTitle = protectedSessionService.decryptString(change.currentTitle) || "[protected]"; + change.current_title = protectedSessionService.decryptString(change.current_title) || "[protected]"; } else { - change.title = change.currentTitle = "[protected]"; + change.title = change.current_title = "[protected]"; } } - if (change.currentIsDeleted) { - const deleteId = change.currentDeleteId; + if (change.current_isDeleted) { + const deleteId = change.current_deleteId; const undeletedParentBranchIds = noteService.getUndeletedParentBranchIds(change.noteId, deleteId); diff --git a/packages/commons/src/lib/server_api.ts b/packages/commons/src/lib/server_api.ts index 7c197a761..a15192fd2 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; - currentIsDeleted: boolean; - currentDeleteId: string; - currentTitle: string; - currentIsProtected: boolean; + current_isDeleted: boolean; + current_deleteId: string; + current_title: string; + current_isProtected: boolean; title: string; utcDate: string; date: string;