Documentation
    Preparing search index...

    Responsible for creating and updating contact notes in the vault. Handles writing new notes and updating existing ones based on contact metadata.

    Index

    Constructors

    • Creates an instance of ContactNoteWriter.

      Parameters

      • vault: Vault

        The Obsidian Vault instance to operate on.

      • metadataCache: MetadataCache

        The Obsidian MetadataCache instance to operate on.

      • fileManager: FileManager

        The Obsidian FileManager instance to operate on.

      Returns ContactNoteWriter

    Properties

    fileManager: FileManager

    The FileManager instance used for file operations.

    This protected property is used to manage file operations in the Obsidian vault.

    formatter: Formatter = ...

    The Formatter instance used for formatting contact data into frontmatter.

    This protected property is used to format contact data into a suitable format for Obsidian frontmatter.

    metadataCache: MetadataCache

    The MetadataCache instance used for managing file metadata.

    This protected property is used to manage file metadata in the Obsidian vault.

    vaultService: VaultService

    The VaultService instance used for vault operations.

    This protected property is used to encapsulate file and folder operations to facilitate testing and decouple from direct API usage.

    Methods

    • Checks if a Google contact has the specified sync label.

      Parameters

      • contact: GoogleContact

        The Google contact to check.

      • syncLabel: string

        The label to check for.

      • labelMap: Record<string, string>

        A mapping of label names to their corresponding group IDs.

      Returns boolean

      True if the contact has the label, false otherwise.

    • Scans the provided files for frontmatter properties matching the specified prefix.

      Parameters

      • files: TFile[]

        The list of TFile objects to scan.

      • propertyPrefix: string

        The prefix to use for identifying frontmatter properties.

      Returns Promise<Record<string, TFile>>

      A mapping of property values to TFile objects.

    • Writes notes for the provided contacts based on the specified configuration.

      Parameters

      • config: ContactNoteConfig

        The configuration for writing contact notes.

      • labelMap: Record<string, string>

        A mapping of label names to their corresponding group IDs.

      • contacts: GoogleContact[]

        The list of Google contacts to write notes for.

      Returns Promise<void>