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

    Function parseSitesFile

    • Parses the text of sites.json, migrating older versions. source names the file in errors.

      Parameters

      • text: string
      • source: string

      Returns {
          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: ...; sha256: ...; validTo: ... };
                          };
                          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;
              }[];
          };
          migrated: boolean;
      }