import "../../../../shared/src/valita.js";
import "../change-source/protocol/current/data.js";
import { changeStreamDataSchema } from "../change-source/protocol/current/downstream.js";
import { object, literal, tuple, string, number, union } from "@badrap/valita";
const PROTOCOL_VERSION = 6;
const statusSchema = object({
  tag: literal("status")
});
const statusMessageSchema = tuple([literal("status"), statusSchema]);
const subscriptionErrorSchema = object({
  type: number(),
  // ErrorType
  message: string().optional()
});
const errorSchema = tuple([literal("error"), subscriptionErrorSchema]);
const downstreamSchema = union(
  statusMessageSchema,
  changeStreamDataSchema,
  errorSchema
);
export {
  PROTOCOL_VERSION,
  downstreamSchema,
  statusMessageSchema,
  statusSchema
};
//# sourceMappingURL=change-streamer.js.map
