• Sync a single file

    Process:

    1. Check if file hash changed (if unchanged, skip)
    2. Fetch remote assets for this file
    3. Get local nodes from jdoc.json
    4. Reconcile (in-memory diff)
    5. Process creates, updates, deletes
    6. Update file metadata

    Parameters

    • filePath: string

      Path to file to sync

    • db: Surreal

      SurrealDB instance

    • jdoc: JDocNode

      Parsed jdoc.json root

    Returns Promise<{
        created: number;
        deleted: number;
        unchanged: number;
        updated: number;
    }>

    Stats for this file sync