"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=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 n=require("../../constants/corvaCompanyId.js");require("lodash"),require("../GradientManager/configuration/constants.js");var s=require("./constants.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(e),u=a(t);function o(){return(o=i.default(u.default.mark((function e(t){var a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={match:JSON.stringify({company_id:n.CORVA_COMPANY_ID,"data.app_id":t}),limit:100,sort:JSON.stringify({timestamp:1}),project:JSON.stringify({app_id:"$data.app_id",rule_id:"$data.wcu_rules.rule_id",_id:0})},e.abrupt("return",r.getDataAppStorageAggregate(s.METADATA.recordProvider,s.METADATA.recordCollections.wcuRuleMapping,a));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function c(){return(c=i.default(u.default.mark((function e(t){var a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={sort:JSON.stringify({ts_desc:1}),match:JSON.stringify({company_id:n.CORVA_COMPANY_ID,"data.rule_id":{$in:t}}),limit:1e3},e.abrupt("return",r.getDataAppStorageAggregate(s.METADATA.recordProvider,s.METADATA.recordCollections.wellnessRuleSettings,a));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(){return(p=i.default(u.default.mark((function e(t,n){var a;return u.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={sort:JSON.stringify({timestamp:-1}),match:JSON.stringify({asset_id:{$in:t},"data.rule_id":{$in:n}}),limit:100},e.abrupt("return",r.getDataAppStorageAggregate(s.METADATA.recordProvider,s.METADATA.recordCollections.wellnessAlerts,a));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.getWCURuleMapping=function(e){return o.apply(this,arguments)},exports.getWellnessAlerts=function(e,t){return p.apply(this,arguments)},exports.getWellnessRuleSettings=function(e){return c.apply(this,arguments)};
//# sourceMappingURL=api.js.map
