use crate::list_envelope::{ListEnvelope, Unit};
pub const SEARCH_COMMAND: &str = "search";
pub const SEARCH_LIST_ID: &str = "payload.results";
pub const SEARCH_UNIT: Unit = Unit::Results;
pub const SEARCH_NARROW: &[&str] = &["offset", "topK", "path", "includeTests"];
pub const SEARCH_WIRE_KEY: &str = "results_list_envelope";
pub fn attach_projected_search_envelope(
map: &mut serde_json::Map<String, serde_json::Value>,
envelope: &ListEnvelope,
) {
let value = serde_json::to_value(envelope)
.expect("the concrete ListEnvelope representation is serializable");
map.insert(SEARCH_WIRE_KEY.to_string(), value);
}