@tikoci/centrs
    Preparing search index...

    Interface FileBackend

    A backend-agnostic view of a device's file store. The verb runners drive this seam so the orchestration (existence guard, verify, envelope) lives in one place regardless of transport. rest/native map these to /file commands; sftp maps them to SFTP-subsystem operations.

    interface FileBackend {
        close(): Promise<void>;
        copyFile(source: FileRow, dest: string): Promise<void>;
        findFile(name: string): Promise<FileRow | undefined>;
        listFiles(listPath?: string): Promise<Record<string, unknown>[]>;
        makeDir(name: string): Promise<void>;
        readFile(row: FileRow): Promise<Buffer<ArrayBufferLike>>;
        removeFile(row: FileRow): Promise<void>;
        writeFile(
            name: string,
            bytes: Buffer,
            existing: FileRow | undefined,
        ): Promise<void>;
    }
    Index
    • Resolve a file by normalized name; undefined when absent.

      Parameters

      • name: string

      Returns Promise<FileRow | undefined>

    • List files (optionally scoped to a directory prefix), /file-row shaped.

      Parameters

      • OptionallistPath: string

      Returns Promise<Record<string, unknown>[]>

    • Parameters

      • name: string

      Returns Promise<void>

    • Read a file's bytes.

      Parameters

      Returns Promise<Buffer<ArrayBufferLike>>

    • Write bytes to name, reusing existing when present (overwrite).

      Parameters

      • name: string
      • bytes: Buffer
      • existing: FileRow | undefined

      Returns Promise<void>