Update database schema and synchronization logic

- Add `useEffect` in `ScribeLeftBar` for handling book state changes.
- Extend `BooksSyncContext` with new properties and stricter typings.
- Refine `Repositories` to include `lastUpdate` handling for synchronization processes.
- Add comprehensive `fetchComplete*` repository methods for retrieving entity-specific sync data.
- Enhance offline logic for chapters, characters, locations, and world synchronization.
- Improve error handling across IPC handlers and repositories.
This commit is contained in:
natreex
2025-12-15 20:55:24 -05:00
parent bb331b5c22
commit 64c7cb6243
23 changed files with 1609 additions and 79 deletions

View File

@@ -12,6 +12,7 @@ export interface EritBooksTable {
desired_word_count:number|null;
words_count:number|null;
cover_image:string|null;
last_update:number;
}
export interface BookActSummariesTable {
@@ -20,6 +21,7 @@ export interface BookActSummariesTable {
user_id: string;
act_index: number;
summary: string | null;
last_update: number;
}
export interface BookAIGuideLineTable {
@@ -41,9 +43,10 @@ export interface BookChaptersTable {
book_id: string;
author_id: string;
title: string;
hashed_title: string | null;
hashed_title: string;
words_count: number | null;
chapter_order: number | null;
chapter_order: number;
last_update: number;
}
export interface BookChapterContentTable {
@@ -54,18 +57,20 @@ export interface BookChapterContentTable {
content: string | null;
words_count: number;
time_on_it: number;
last_update: number;
}
export interface BookChapterInfosTable {
chapter_info_id: string;
chapter_id: string;
act_id: number | null;
act_id: number;
incident_id: string | null;
plot_point_id: string | null;
book_id: string;
author_id: string;
summary: string | null;
goal: string | null;
last_update: number;
}
export interface BookCharactersTable {
@@ -80,6 +85,7 @@ export interface BookCharactersTable {
role: string | null;
biography: string | null;
history: string | null;
last_update: number;
}
export interface BookCharactersAttributesTable {
@@ -88,6 +94,7 @@ export interface BookCharactersAttributesTable {
user_id: string;
attribute_name: string;
attribute_value: string;
last_update: number;
}
export interface BookGuideLineTable {
@@ -112,6 +119,7 @@ export interface BookIncidentsTable {
title: string;
hashed_title: string;
summary: string | null;
last_update: number;
}
export interface BookIssuesTable {
@@ -120,6 +128,7 @@ export interface BookIssuesTable {
book_id: string;
name: string;
hashed_issue_name: string;
last_update: number;
}
export interface BookLocationTable {
@@ -128,6 +137,7 @@ export interface BookLocationTable {
user_id: string;
loc_name: string;
loc_original_name: string;
last_update: number;
}
export interface BookPlotPointsTable {
@@ -138,6 +148,7 @@ export interface BookPlotPointsTable {
linked_incident_id: string | null;
author_id: string;
book_id: string;
last_update: number;
}
export interface BookWorldTable {
@@ -151,6 +162,7 @@ export interface BookWorldTable {
economy: string | null;
religion: string | null;
languages: string | null;
last_update: number;
}
export interface BookWorldElementsTable {
@@ -161,6 +173,7 @@ export interface BookWorldElementsTable {
name: string;
original_name: string;
description: string | null;
last_update: number;
}
export interface LocationElementTable {
@@ -170,6 +183,7 @@ export interface LocationElementTable {
element_name: string;
original_name: string;
element_description: string | null;
last_update: number;
}
export interface LocationSubElementTable {
@@ -179,4 +193,5 @@ export interface LocationSubElementTable {
sub_elem_name: string;
original_name: string;
sub_elem_description: string | null;
last_update: number;
}