From 41706fbcd7fa80fe75a9bca4311b9b63b72b0556 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 24 Sep 2024 20:05:52 -0400 Subject: [PATCH] Moving things around and preping things for IDAA. Archive, Posts, Recovery Meetings --- src/lib/db_archives.ts | 115 +++++++++++++++++++++++++++++++++++++++++ src/lib/db_notes.ts | 16 +++--- 2 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 src/lib/db_archives.ts diff --git a/src/lib/db_archives.ts b/src/lib/db_archives.ts new file mode 100644 index 00000000..8b9cf547 --- /dev/null +++ b/src/lib/db_archives.ts @@ -0,0 +1,115 @@ +import Dexie, { type Table } from 'dexie'; + +import type { key_val } from './ae_stores'; + +// li = list +// kv = key value list + +export interface Archive { + id: string; + // id_random: string; + archive_id: string; + // archive_id_random: string; + + code?: null|string; + + account_id: string; + // account_id_random: string; + + // archive_type: string; + + // type: string; + name: string; + // summary?: null|string; + description?: null|string; + + content_html?: null|string; + content_json?: null|string; + content_url?: null|string; + content_url_text?: null|string; + + original_datetime?: Date; + original_timezone?: null|string; + original_location?: null|string; + + original_url?: null|string; + original_url_text?: null|string; + + // meta_data?: null|string; + // access_key?: null|string; /// Rename this to "passcode" if used later + + sort_by?: null|string; + sort_by_desc?: null|string; + + start_datetime?: Date; + end_datetime?: Date; + timezone?: null|string; + location_address_json?: null|string; + + cfg_json?: null|key_val; + + enable: null|boolean; + hide?: null|boolean; + priority?: null|boolean + sort?: null|number; + group?: null|string; + notes?: null|string; + created_on: Date; + updated_on?: null|Date; + + // Additional fields for convenience (database views) + archive_content_count: number; + // file_count?: null|number; + // file_count_all?: null|number; + // archive_file_id_li_json?: null|string; +} + +export interface Archive_Content { + id: string; + // id_random: string; + archive_content_id: string; + // archive_content_id_random: string; + + archive_id: string; + // archive_id_random: string; + + archive_content_type: string; + + name: string; + description?: null|string; + + content_html?: null|string; + content_json?: null|string; + + url?: null|string; + url_text?: null|string; + + hosted_file_id?: string; + + file_path?: null|string; + + filename?: null|string; + file_extension?: null|string; + + original_datetime?: Date; + original_timezone?: null|string; + original_location?: null|string; + original_url?: null|string; + original_url_text?: null|string; + + // meta_data?: null|string; + // access_key?: null|string; /// Rename this to "passcode" if used later + + enable_for_public?: boolean; + + cfg_json?: null|key_val; + + enable: null|boolean; + hide?: null|boolean; + priority?: null|boolean + sort?: null|number; + group?: null|string; + notes?: null|string; + created_on: Date; + updated_on?: null|Date; +} \ No newline at end of file diff --git a/src/lib/db_notes.ts b/src/lib/db_notes.ts index 18d838fd..a40f22b5 100644 --- a/src/lib/db_notes.ts +++ b/src/lib/db_notes.ts @@ -60,13 +60,13 @@ export interface Note { passcode_write_expire?: null|Date enable: null|boolean; - hide: null|boolean; - priority: null|boolean - sort: null|number; - group: null|string; - notes: null|string; + hide?: null|boolean; + priority?: null|boolean + sort?: null|number; + group?: null|string; + notes?: null|string; created_on: Date; - updated_on: null|Date; + updated_on?: null|Date; // Additional fields for convenience (database views) file_count?: null|number; // Only files directly under a note @@ -92,7 +92,9 @@ export interface Note { note_presentation_li?: null|list; // A key value list of the files note_file_kv?: null|key_val; - note_file_li?: null|list; + note_file_li?: null|[]; + + // note_collection_id?: null|string; // For a collection of notes? // Future standard fields!!! obj_id?: null|string;