import{__awaiter as t,__generator as i}from'./../../ext-esm/tslib/tslib.es6.js';import{getDataAppStorageAggregate as s}from"../../clients/jsonApi/index.js";import"../../constants/goals.js";import"../../constants/segment.js";import"../../constants/alerts.js";import"../../constants/apps.js";import"../../constants/drillstring.js";import"../../constants/completion.js";import"../../constants/appPackages.js";import"../../constants/notifications.js";import"../../constants/feed.js";import"../../constants/bha.js";import{CORVA_COMPANY_ID as n}from"../../constants/corvaCompanyId.js";import"lodash";import"../GradientManager/configuration/constants.js";import{METADATA as r}from"./constants.js";function o(o){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){return t={match:JSON.stringify({company_id:n,"data.app_id":o}),limit:100,sort:JSON.stringify({timestamp:1}),project:JSON.stringify({app_id:"$data.app_id",rule_id:"$data.wcu_rules.rule_id",_id:0})},[2,s(r.recordProvider,r.recordCollections.wcuRuleMapping,t)]}))}))}function e(o){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){return t={sort:JSON.stringify({ts_desc:1}),match:JSON.stringify({company_id:n,"data.rule_id":{$in:o}}),limit:1e3},[2,s(r.recordProvider,r.recordCollections.wellnessRuleSettings,t)]}))}))}function a(n,o){return t(this,void 0,void 0,(function(){var t;return i(this,(function(i){return t={sort:JSON.stringify({timestamp:-1}),match:JSON.stringify({asset_id:{$in:n},"data.rule_id":{$in:o}}),limit:100},[2,s(r.recordProvider,r.recordCollections.wellnessAlerts,t)]}))}))}export{o as getWCURuleMapping,a as getWellnessAlerts,e as getWellnessRuleSettings};
