"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../ext-esm/tslib/tslib.es6.js'),t=require("../../clients/jsonApi/index.js");require("../../constants/goals.js"),require("../../constants/segment.js"),require("../../constants/alerts.js"),require("../../constants/apps.js"),require("../../constants/drillstring.js"),require("../../constants/completion.js"),require("../../constants/appPackages.js"),require("../../constants/notifications.js"),require("../../constants/feed.js"),require("../../constants/bha.js");var r=require("../../constants/corvaCompanyId.js");require("lodash"),require("../GradientManager/configuration/constants.js");var i=require("./constants.js");exports.getWCURuleMapping=function(s){return e.__awaiter(this,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){return n={match:JSON.stringify({company_id:r.CORVA_COMPANY_ID,"data.app_id":s}),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,t.getDataAppStorageAggregate(i.METADATA.recordProvider,i.METADATA.recordCollections.wcuRuleMapping,n)]}))}))},exports.getWellnessAlerts=function(r,s){return e.__awaiter(this,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){return n={sort:JSON.stringify({timestamp:-1}),match:JSON.stringify({asset_id:{$in:r},"data.rule_id":{$in:s}}),limit:100},[2,t.getDataAppStorageAggregate(i.METADATA.recordProvider,i.METADATA.recordCollections.wellnessAlerts,n)]}))}))},exports.getWellnessRuleSettings=function(s){return e.__awaiter(this,void 0,void 0,(function(){var n;return e.__generator(this,(function(e){return n={sort:JSON.stringify({ts_desc:1}),match:JSON.stringify({company_id:r.CORVA_COMPANY_ID,"data.rule_id":{$in:s}}),limit:1e3},[2,t.getDataAppStorageAggregate(i.METADATA.recordProvider,i.METADATA.recordCollections.wellnessRuleSettings,n)]}))}))};
