cmd-sync-servers - v1.0.0
    Preparing search index...

    Class SyncSession

    One site and one of its servers, ready to plan and run synchronizations. Connections open on first use and close with close.

    Index
    server: {
        auth?: {
            keyPath?: string;
            method: "password" | "key" | "agent";
            savePassword: boolean;
        };
        host?: string;
        id: string;
        name: string;
        options: {
            allowInsecure?: boolean;
            allowRootDeletes?: boolean;
            hostKey?: { algorithm: string; pinnedAt: string; sha256: string };
            ipFamily?: 4 | 6;
            legacyAlgorithms?: boolean;
            passive: boolean;
            remoteDirMode?: string;
            remoteFileMode?: string;
            timeoutSeconds: number;
            tls?: {
                caFile?: string;
                minVersion: "TLSv1.2" | "TLSv1.3";
                servername?: string;
                trustedCertificate?: {
                    pinnedAt: string;
                    sha256: string;
                    validTo: string;
                };
            };
            uploadOnSave: boolean;
        };
        port?: number;
        protocol: "sftp"
        | "ftps"
        | "ftps-implicit"
        | "ftp"
        | "local";
        remoteRoot: string;
        username?: string;
        webUrl?: string;
    }

    The server in use.

    site: {
        cloaking: {
            enabled: boolean;
            paths: string[];
            patterns: string[];
            useGlobalPatterns?: boolean;
        };
        id: string;
        local: { cache: boolean; caseSensitive?: boolean; webUrl?: string };
        localRoot: string;
        name: string;
        remoteServerId?: string;
        servers: {
            auth?: {
                keyPath?: string;
                method: "password" | "key" | "agent";
                savePassword: boolean;
            };
            host?: string;
            id: string;
            name: string;
            options: {
                allowInsecure?: boolean;
                allowRootDeletes?: boolean;
                hostKey?: { algorithm: string; pinnedAt: string; sha256: string };
                ipFamily?: 4 | 6;
                legacyAlgorithms?: boolean;
                passive: boolean;
                remoteDirMode?: string;
                remoteFileMode?: string;
                timeoutSeconds: number;
                tls?: {
                    caFile?: string;
                    minVersion: "TLSv1.2" | "TLSv1.3";
                    servername?: string;
                    trustedCertificate?: {
                        pinnedAt: string;
                        sha256: string;
                        validTo: string;
                    };
                };
                uploadOnSave: boolean;
            };
            port?: number;
            protocol: "sftp"
            | "ftps"
            | "ftps-implicit"
            | "ftp"
            | "local";
            remoteRoot: string;
            username?: string;
            webUrl?: string;
        }[];
        sync: {
            compare: "metadata"
            | "checksum";
            concurrency: number;
            guard: { enabled: boolean; patterns: string[] };
            maintainInfo: boolean;
            massDelete: { maxCount: number; maxPercent: number };
            mtimeToleranceSeconds: number;
            recovery: { enabled: boolean; keepDays: number; maxMegabytes: number };
            symlinks: "skip" | "follow-inside-root" | "follow";
        };
        testingServerId?: string;
    }

    The site, as it was when the session opened.

    • Saves the sync records and closes every connection. Safe to call more than once.

      Returns Promise<void>

    • Fetches the remote copy of a file to a private temp folder for a diff. Call dispose when done.

      Parameters

      • target: string
      • Optionalsignal: AbortSignal

      Returns Promise<Comparison>

    • Records files as in sync without transferring them; folders mark every file in them that both sides have.

      Parameters

      • paths: readonly string[]
      • Optionalsignal: AbortSignal

      Returns Promise<number>

    • Forgets every sync record of this site and server; the next sync is a first sync.

      Returns Promise<void>

    • Connects, signs in and checks the remote root.

      Parameters

      • Optionalsignal: AbortSignal

      Returns Promise<Capabilities & { rootEntries: number }>