use std::collections::BTreeMap;
use crate::text::frontmatter::FrontmatterValue;
mod chunks;
mod delete;
mod metadata;
mod note;
pub use chunks::upsert_chunks;
pub use delete::perform_note_deletion;
pub use metadata::{upsert_aliases, upsert_frontmatter_fields, upsert_links, upsert_tags};
pub use note::upsert_note;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct NoteUpsertResult {
pub note_id: i64,
pub is_new: bool,
}
#[derive(Debug)]
pub struct UpsertNoteParams<'a> {
pub vault_path: &'a str,
pub title: &'a str,
pub content: &'a str,
pub source_hash: String,
pub frontmatter: &'a BTreeMap<String, FrontmatterValue>,
pub aliases: &'a [String],
pub tags: &'a [String],
pub mtime_ms: i64,
pub size_bytes: i64,
pub scope: &'a str,
}
#[derive(Debug, Clone)]
pub struct ChunkUpsertRow {
pub index: u32,
pub text: String,
pub embedding_text: String,
pub heading_path: Option<String>,
pub char_start: u32,
pub char_end: u32,
pub line_start: u32,
pub line_end: u32,
pub chunk_hash: String,
pub token_estimate: u32,
}
#[cfg(test)]
#[allow(clippy::unwrap_used, clippy::expect_used)]
mod tests;