import "../../../../shared/src/valita.js";
import { object, string, literal, tuple, union } from "@badrap/valita";
const statusSchema = object({
  tag: literal("status"),
  /**
   * The location from which litestream should perform the restore.
   */
  backupURL: string(),
  /**
   * The `replicaVersion` of the backup. If a subscriber's restored or
   * existing replica is of a different version, it should delete it and
   * retry the restore from litestream (i.e. equivalent to a
   * `WrongReplicaVersion` response from a `/changes` subscription).
   */
  replicaVersion: string(),
  /**
   * The earliest watermark from which catchup is possible. If the
   * subscriber's replica is older that this watermark, it should delete it
   * and (retry the) restore from litestream (i.e. equivalent to a
   * `WatermarkTooOld` response from a `/changes` subscription).
   */
  minWatermark: string()
});
const statusMessageSchema = tuple([literal("status"), statusSchema]);
const snapshotMessageSchema = union(statusMessageSchema);
export {
  snapshotMessageSchema
};
//# sourceMappingURL=snapshot.js.map
