import { LoadMessage , QueryMessage , SaveMessage } from '../http/messages' ; import { Query } from '../query/query' ; import { FactEnvelope , FactReference } from '../storage' ; export function serializeSave ( envelopes ) { return { facts : envelopes . map ( e => e . fact ) } ; } export function serializeQuery ( start , query ) { return { start : start , query : query . toDescriptiveString ( ) } ; } export function serializeLoad ( references ) { return { references : references } ; }