import "../../shared/src/valita.js";
import { nullableVersionSchema, versionSchema } from "./version.js";
import { object, string, record, number, tuple, literal } from "@badrap/valita";
const pullRequestBodySchema = object({
  clientGroupID: string(),
  cookie: nullableVersionSchema,
  requestID: string()
});
const pullResponseBodySchema = object({
  cookie: versionSchema,
  // Matches pullRequestBodySchema requestID that initiated this response
  requestID: string(),
  lastMutationIDChanges: record(number())
  // Pull is currently only used for mutation recovery which does not use
  // the patch so we save work by not computing the patch.
});
const pullRequestMessageSchema = tuple([
  literal("pull"),
  pullRequestBodySchema
]);
const pullResponseMessageSchema = tuple([
  literal("pull"),
  pullResponseBodySchema
]);
export {
  pullRequestBodySchema,
  pullRequestMessageSchema,
  pullResponseBodySchema,
  pullResponseMessageSchema
};
//# sourceMappingURL=pull.js.map
