import r from"@babel/runtime/helpers/slicedToArray";import t from"@babel/runtime/helpers/asyncToGenerator";import e from"@babel/runtime/regenerator";import{CHUNK_SIZE as n}from"../shared/constants.js";import{fetchDataByChunks as a}from"../shared/fetchers/fetchDataByChunks.js";import{getDataAppStorageAggregate as i}from"../../../../clients/jsonApi/index.js";var s=function(r,t){var e={company_id:r,asset_id:{$in:t}};return{match:JSON.stringify(e),sort:JSON.stringify({timestamp:-1}),group:JSON.stringify({_id:"$asset_id",doc:{$first:"$$ROOT"}}),project:JSON.stringify({_id:0,"data.key":{$literal:"mud_type"},"data.value":"$doc.data.mud_type",asset_id:"$doc.asset_id"})}},o=function(){var s=t(e.mark((function s(o,u){return e.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",a({path:"corva/data.mud",queryParams:o,chunkSize:n,signal:u,fetcher:function(){var n=t(e.mark((function t(n,a){var s,o,u,c;return e.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=n.split("/"),o=r(s,2),u=o[0],c=o[1],t.abrupt("return",i(u,c,a));case 2:case"end":return t.stop()}}),t)})));return function(r,t){return n.apply(this,arguments)}}()}));case 1:case"end":return s.stop()}}),s)})));return function(r,t){return s.apply(this,arguments)}}();export{s as buildMudQueryParams,o as fetchMudAggregate};
//# sourceMappingURL=fetchMudAggregate.js.map
