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

    Function serializeSitesFile

    • The text written to sites.json: the schema reference first, then the data. The global cloaking is written only while it holds a pattern, so a file that never uses it reads the same as before it existed.

      Parameters

      • file: {
            $schema?: string;
            cloaking?: { patterns: string[] };
            lastSelectedSiteId?: string;
            schemaVersion: 1;
            sites: {
                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;
            }[];
        }

      Returns string