/** rsync (`rsync.read`, `rsync.run`). The Rsync Manager and the File Manager are clients of one engine in Core. */
import { call } from "../transport";
import type { Payload } from "../types";

const command = (name: string, action: string) => (payload: Payload = {}) => call<Payload>(`module_rsync_${name}`, `plugin:rsync:${action}`, payload);

export const rsync = Object.freeze({
  sshProfiles: command("ssh_profiles", "sshProfiles"),
  localProbe: command("local_probe", "localProbe"),
  remoteProbe: command("remote_probe", "remoteProbe"),
  inspect: command("inspect", "inspect"),
  jobs: command("jobs", "jobs"),
  job: command("job", "job"),
  describe: command("describe", "describe"),
  versions: command("versions", "versions"),
  profiles: command("profiles", "profiles"),
  history: command("history", "history"),
  scheduleList: command("schedule_list", "scheduleList"),
  discover: command("discover", "discover"),
  scheduleLog: command("schedule_log", "scheduleLog"),
  takeHandoff: command("take_handoff", "takeHandoff"),
  preview: command("preview", "preview"),
  run: command("run", "run"),
  cancel: command("cancel", "cancel"),
  install: command("install", "install"),
  connect: command("connect", "connect"),
  trustHost: command("trust_host", "trustHost"),
  disconnect: command("disconnect", "disconnect"),
  saveProfile: command("save_profile", "saveProfile"),
  deleteProfile: command("delete_profile", "deleteProfile"),
  clearHistory: command("clear_history", "clearHistory"),
  pruneVersions: command("prune_versions", "pruneVersions"),
  scheduleInstall: command("schedule_install", "scheduleInstall"),
  scheduleStart: command("schedule_start", "scheduleStart"),
  scheduleRemove: command("schedule_remove", "scheduleRemove"),
  openManager: command("open_manager", "openManager")
});
