Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index a794e59..7fb03c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4e8=['params','length','includeAll','find','create','body','bulkCreate','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','index','map','rawAttributes','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','include','findAll','catch'];(function(_0xed4562,_0xaff5d3){var _0x5bb560=function(_0x368e00){while(--_0x368e00){_0xed4562['push'](_0xed4562['shift']());}};_0x5bb560(++_0xaff5d3);}(_0xa4e8,0x143));var _0x8a4e=function(_0x277ed5,_0x3adb24){_0x277ed5=_0x277ed5-0x0;var _0x22d92a=_0xa4e8[_0x277ed5];return _0x22d92a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8a4e('0x0'));var rimraf=require(_0x8a4e('0x1'));var zipdir=require(_0x8a4e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8a4e('0x3'));var moment=require(_0x8a4e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8a4e('0x5'));var util=require(_0x8a4e('0x6'));var path=require(_0x8a4e('0x7'));var sox=require('sox');var csv=require(_0x8a4e('0x8'));var ejs=require(_0x8a4e('0x9'));var fs=require('fs');var _=require(_0x8a4e('0xa'));var squel=require(_0x8a4e('0xb'));var crypto=require(_0x8a4e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8a4e('0xd'));var qs=require(_0x8a4e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8a4e('0xf'));var logger=require(_0x8a4e('0x10'))(_0x8a4e('0x11'));var utils=require(_0x8a4e('0x12'));var config=require(_0x8a4e('0x13'));var licenseUtil=require(_0x8a4e('0x14'));var db=require(_0x8a4e('0x15'))['db'];function respondWithStatusCode(_0x11a364,_0x4f2288){_0x4f2288=_0x4f2288||0xcc;return function(_0x4f6c86){if(_0x4f6c86){return _0x11a364[_0x8a4e('0x16')](_0x4f2288);}return _0x11a364[_0x8a4e('0x17')](_0x4f2288)[_0x8a4e('0x18')]();};}function respondWithResult(_0x13ba63,_0x30c0a7){_0x30c0a7=_0x30c0a7||0xc8;return function(_0xfad7ed){if(_0xfad7ed){return _0x13ba63[_0x8a4e('0x17')](_0x30c0a7)[_0x8a4e('0x19')](_0xfad7ed);}};}function respondWithFilteredResult(_0x51fce3,_0x22f452){return function(_0x5acf4a){if(_0x5acf4a){var _0x134b9d=_0x5acf4a[_0x8a4e('0x1a')],_0xd50ebe=_0x22f452['offset'],_0x3fa46d=_0x22f452[_0x8a4e('0x1b')]+_0x22f452[_0x8a4e('0x1c')],_0x336261;if(_0x3fa46d>=_0x134b9d){_0x3fa46d=_0x134b9d;_0x336261=0xc8;}else{_0x336261=0xce;}_0x51fce3[_0x8a4e('0x17')](_0x336261);return _0x51fce3[_0x8a4e('0x1d')](_0x8a4e('0x1e'),_0xd50ebe+'-'+_0x3fa46d+'/'+_0x134b9d)['json'](_0x5acf4a);}return null;};}function patchUpdates(_0x5e81df){return function(_0x4719f4){try{jsonpatch[_0x8a4e('0x1f')](_0x4719f4,_0x5e81df,!![]);}catch(_0x1836fd){return BPromise['reject'](_0x1836fd);}return _0x4719f4['save']();};}function saveUpdates(_0x502a33,_0xcd7e69){return function(_0x116143){if(_0x116143){return _0x116143[_0x8a4e('0x20')](_0x502a33)[_0x8a4e('0x21')](function(_0x3e4958){return _0x3e4958;});}return null;};}function removeEntity(_0x33f5e6,_0x20b87d){return function(_0x47c680){if(_0x47c680){return _0x47c680['destroy']()[_0x8a4e('0x21')](function(){_0x33f5e6[_0x8a4e('0x17')](0xcc)[_0x8a4e('0x18')]();});}};}function handleEntityNotFound(_0x3ea134,_0x32ccdf){return function(_0x34f0c7){if(!_0x34f0c7){_0x3ea134['sendStatus'](0x194);}return _0x34f0c7;};}function handleError(_0x655f66,_0x458764){_0x458764=_0x458764||0x1f4;return function(_0x236968){logger[_0x8a4e('0x22')](_0x236968['stack']);if(_0x236968[_0x8a4e('0x23')]){delete _0x236968[_0x8a4e('0x23')];}_0x655f66[_0x8a4e('0x17')](_0x458764)[_0x8a4e('0x24')](_0x236968);};}exports[_0x8a4e('0x25')]=function(_0x49a31f,_0x4fda4e){var _0x59ac36={},_0x425970={},_0x427f96={'count':0x0,'rows':[]};var _0x50fd1b=_[_0x8a4e('0x26')](db['AnalyticFieldReport'][_0x8a4e('0x27')],function(_0x50b73f){return{'name':_0x50b73f['fieldName'],'type':_0x50b73f[_0x8a4e('0x28')]['key']};});_0x425970[_0x8a4e('0x29')]=_['map'](_0x50fd1b,'name');_0x425970['query']=_[_0x8a4e('0x2a')](_0x49a31f['query']);_0x425970[_0x8a4e('0x2b')]=_[_0x8a4e('0x2c')](_0x425970['model'],_0x425970[_0x8a4e('0x2d')]);_0x59ac36[_0x8a4e('0x2e')]=_['intersection'](_0x425970['model'],qs['fields'](_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x2f')]));_0x59ac36[_0x8a4e('0x2e')]=_0x59ac36[_0x8a4e('0x2e')]['length']?_0x59ac36[_0x8a4e('0x2e')]:_0x425970['model'];if(!_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x30')](_0x8a4e('0x31'))){_0x59ac36[_0x8a4e('0x1c')]=qs[_0x8a4e('0x1c')](_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x1c')]);_0x59ac36['offset']=qs[_0x8a4e('0x1b')](_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x1b')]);}_0x59ac36[_0x8a4e('0x32')]=qs[_0x8a4e('0x33')](_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x33')]);_0x59ac36['where']=qs['filters'](_[_0x8a4e('0x34')](_0x49a31f[_0x8a4e('0x2d')],_0x425970[_0x8a4e('0x2b')]),_0x50fd1b);if(_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x35')]){_0x59ac36[_0x8a4e('0x36')]=_[_0x8a4e('0x37')](_0x59ac36['where'],{'$or':_[_0x8a4e('0x26')](_0x50fd1b,function(_0x33eeb3){if(_0x33eeb3[_0x8a4e('0x28')]!==_0x8a4e('0x38')){var _0x4f6819={};_0x4f6819[_0x33eeb3[_0x8a4e('0x23')]]={'$like':'%'+_0x49a31f[_0x8a4e('0x2d')][_0x8a4e('0x35')]+'%'};return _0x4f6819;}})});}_0x59ac36=_[_0x8a4e('0x37')]({},_0x59ac36,_0x49a31f[_0x8a4e('0x39')]);var _0x606ddf={'where':_0x59ac36[_0x8a4e('0x36')]};return db[_0x8a4e('0x3a')][_0x8a4e('0x1a')](_0x606ddf)[_0x8a4e('0x21')](function(_0x21cfed){_0x427f96[_0x8a4e('0x1a')]=_0x21cfed;if(_0x49a31f[_0x8a4e('0x2d')]['includeAll']){_0x59ac36[_0x8a4e('0x3b')]=[{'all':!![]}];}return db[_0x8a4e('0x3a')][_0x8a4e('0x3c')](_0x59ac36);})[_0x8a4e('0x21')](function(_0x421554){_0x427f96['rows']=_0x421554;return _0x427f96;})[_0x8a4e('0x21')](respondWithFilteredResult(_0x4fda4e,_0x59ac36))[_0x8a4e('0x3d')](handleError(_0x4fda4e,null));};exports['show']=function(_0x5603f7,_0x238c43){var _0x5b236a={'raw':![],'where':{'id':_0x5603f7[_0x8a4e('0x3e')]['id']}},_0x4cffee={};_0x4cffee[_0x8a4e('0x29')]=_[_0x8a4e('0x2a')](db[_0x8a4e('0x3a')][_0x8a4e('0x27')]);_0x4cffee[_0x8a4e('0x2d')]=_[_0x8a4e('0x2a')](_0x5603f7[_0x8a4e('0x2d')]);_0x4cffee[_0x8a4e('0x2b')]=_['intersection'](_0x4cffee[_0x8a4e('0x29')],_0x4cffee[_0x8a4e('0x2d')]);_0x5b236a[_0x8a4e('0x2e')]=_[_0x8a4e('0x2c')](_0x4cffee[_0x8a4e('0x29')],qs[_0x8a4e('0x2f')](_0x5603f7[_0x8a4e('0x2d')][_0x8a4e('0x2f')]));_0x5b236a[_0x8a4e('0x2e')]=_0x5b236a[_0x8a4e('0x2e')][_0x8a4e('0x3f')]?_0x5b236a[_0x8a4e('0x2e')]:_0x4cffee[_0x8a4e('0x29')];if(_0x5603f7['query'][_0x8a4e('0x40')]){_0x5b236a[_0x8a4e('0x3b')]=[{'all':!![]}];}_0x5b236a=_[_0x8a4e('0x37')]({},_0x5b236a,_0x5603f7[_0x8a4e('0x39')]);return db[_0x8a4e('0x3a')][_0x8a4e('0x41')](_0x5b236a)[_0x8a4e('0x21')](handleEntityNotFound(_0x238c43,null))['then'](respondWithResult(_0x238c43,null))['catch'](handleError(_0x238c43,null));};exports[_0x8a4e('0x42')]=function(_0x29856b,_0x25a0ef){return db[_0x8a4e('0x3a')][_0x8a4e('0x42')](_0x29856b[_0x8a4e('0x43')],{})[_0x8a4e('0x21')](respondWithResult(_0x25a0ef,0xc9))[_0x8a4e('0x3d')](handleError(_0x25a0ef,null));};exports[_0x8a4e('0x44')]=function(_0x5d8e2f,_0x463fa6){return db['AnalyticFieldReport']['bulkCreate'](_0x5d8e2f[_0x8a4e('0x43')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x463fa6,0xc9))[_0x8a4e('0x3d')](handleError(_0x463fa6,null));};exports[_0x8a4e('0x20')]=function(_0x2b1784,_0x234fd7){if(_0x2b1784[_0x8a4e('0x43')]['id']){delete _0x2b1784['body']['id'];}return db[_0x8a4e('0x3a')][_0x8a4e('0x41')]({'where':{'id':_0x2b1784[_0x8a4e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x234fd7,null))[_0x8a4e('0x21')](saveUpdates(_0x2b1784[_0x8a4e('0x43')],null))[_0x8a4e('0x21')](respondWithResult(_0x234fd7,null))[_0x8a4e('0x3d')](handleError(_0x234fd7,null));};exports['destroy']=function(_0x3e32e9,_0x5a8b42){return db[_0x8a4e('0x3a')][_0x8a4e('0x41')]({'where':{'id':_0x3e32e9[_0x8a4e('0x3e')]['id']}})[_0x8a4e('0x21')](handleEntityNotFound(_0x5a8b42,null))['then'](removeEntity(_0x5a8b42,null))[_0x8a4e('0x3d')](handleError(_0x5a8b42,null));};exports[_0x8a4e('0x45')]=function(_0x3667b9,_0x41b6e8){return db['AnalyticFieldReport'][_0x8a4e('0x46')]({'where':{'id':_0x3667b9[_0x8a4e('0x2d')][_0x8a4e('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x41b6e8,0xcc))[_0x8a4e('0x3d')](handleError(_0x41b6e8,null));};exports[_0x8a4e('0x48')]=function(_0x4edc4f,_0x185b8d,_0x24b21f){return db[_0x8a4e('0x49')]['findOne']({'where':{'id':_0x4edc4f['params']['id']}})[_0x8a4e('0x21')](handleEntityNotFound(_0x185b8d,null))[_0x8a4e('0x21')](function(_0x2b5930){if(_0x2b5930){return db[_0x8a4e('0x4a')][_0x8a4e('0x4b')](function(_0x3320ec){return db[_0x8a4e('0x3a')]['destroy']({'where':{'CustomReportId':_0x4edc4f['params']['id']},'transaction':_0x3320ec})[_0x8a4e('0x21')](function(_0x3e187e){var _0x5b6039=_['map'](_0x4edc4f[_0x8a4e('0x43')],function(_0x3ccc51){delete _0x3ccc51['id'];_0x3ccc51[_0x8a4e('0x4c')]=_0x4edc4f[_0x8a4e('0x3e')]['id'];return _0x3ccc51;});return db[_0x8a4e('0x3a')][_0x8a4e('0x44')](_0x5b6039,{'transaction':_0x3320ec});});})['then'](function(){return db[_0x8a4e('0x3a')][_0x8a4e('0x3c')]({'where':{'CustomReportId':_0x4edc4f[_0x8a4e('0x3e')]['id']}});});}})[_0x8a4e('0x21')](respondWithResult(_0x185b8d,null))[_0x8a4e('0x3d')](handleError(_0x185b8d,null));};
\ No newline at end of file
+var _0x4f71=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','AnalyticFieldReport','includeAll','findAll','rows','catch','show','params','length','include','options','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x4f71,0x70));var _0x14f7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4f71[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x14f7('0x0'));var emlformat=require(_0x14f7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x14f7('0x2'));var jsonpatch=require(_0x14f7('0x3'));var rp=require('request-promise');var moment=require(_0x14f7('0x4'));var BPromise=require(_0x14f7('0x5'));var Mustache=require(_0x14f7('0x6'));var util=require('util');var path=require(_0x14f7('0x7'));var sox=require(_0x14f7('0x8'));var csv=require(_0x14f7('0x9'));var ejs=require(_0x14f7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x14f7('0xb'));var crypto=require('crypto');var jsforce=require(_0x14f7('0xc'));var deskjs=require(_0x14f7('0xd'));var toCsv=require(_0x14f7('0x9'));var querystring=require(_0x14f7('0xe'));var Papa=require(_0x14f7('0xf'));var Redis=require(_0x14f7('0x10'));var authService=require(_0x14f7('0x11'));var qs=require(_0x14f7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x14f7('0x13'));var utils=require('../../config/utils');var config=require(_0x14f7('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x552147,_0x34eb44){_0x34eb44=_0x34eb44||0xcc;return function(_0x1003f2){if(_0x1003f2){return _0x552147[_0x14f7('0x15')](_0x34eb44);}return _0x552147[_0x14f7('0x16')](_0x34eb44)[_0x14f7('0x17')]();};}function respondWithResult(_0x1f6788,_0x3e74fa){_0x3e74fa=_0x3e74fa||0xc8;return function(_0xa4dfc7){if(_0xa4dfc7){return _0x1f6788['status'](_0x3e74fa)[_0x14f7('0x18')](_0xa4dfc7);}};}function respondWithFilteredResult(_0x45c186,_0x1c43f7){return function(_0x5391e3){if(_0x5391e3){var _0x216f67=_0x5391e3[_0x14f7('0x19')],_0x1a17b0=_0x1c43f7[_0x14f7('0x1a')],_0x40e42c=_0x1c43f7[_0x14f7('0x1a')]+_0x1c43f7[_0x14f7('0x1b')],_0x39bc3a;if(_0x40e42c>=_0x216f67){_0x40e42c=_0x216f67;_0x39bc3a=0xc8;}else{_0x39bc3a=0xce;}_0x45c186[_0x14f7('0x16')](_0x39bc3a);return _0x45c186['set'](_0x14f7('0x1c'),_0x1a17b0+'-'+_0x40e42c+'/'+_0x216f67)['json'](_0x5391e3);}return null;};}function patchUpdates(_0x5e8d99){return function(_0x2216f7){try{jsonpatch[_0x14f7('0x1d')](_0x2216f7,_0x5e8d99,!![]);}catch(_0x3935e7){return BPromise[_0x14f7('0x1e')](_0x3935e7);}return _0x2216f7['save']();};}function saveUpdates(_0x1e2c87,_0x35ed06){return function(_0x5cf5e7){if(_0x5cf5e7){return _0x5cf5e7['update'](_0x1e2c87)[_0x14f7('0x1f')](function(_0xa1f98e){return _0xa1f98e;});}return null;};}function removeEntity(_0x5162db,_0x2467f7){return function(_0x570cf3){if(_0x570cf3){return _0x570cf3[_0x14f7('0x20')]()['then'](function(){_0x5162db[_0x14f7('0x16')](0xcc)[_0x14f7('0x17')]();});}};}function handleEntityNotFound(_0x1ad54c,_0x3ca363){return function(_0x12033c){if(!_0x12033c){_0x1ad54c[_0x14f7('0x15')](0x194);}return _0x12033c;};}function handleError(_0x36bc5e,_0x5113e5){_0x5113e5=_0x5113e5||0x1f4;return function(_0x241945){logger[_0x14f7('0x21')](_0x241945[_0x14f7('0x22')]);if(_0x241945[_0x14f7('0x23')]){delete _0x241945[_0x14f7('0x23')];}_0x36bc5e[_0x14f7('0x16')](_0x5113e5)['send'](_0x241945);};}exports[_0x14f7('0x24')]=function(_0x1185d4,_0x32ed89){var _0x4b3379={},_0x282b1b={},_0x4444e5={'count':0x0,'rows':[]};var _0x5c5d63=_[_0x14f7('0x25')](db['AnalyticFieldReport'][_0x14f7('0x26')],function(_0x3853bb){return{'name':_0x3853bb[_0x14f7('0x27')],'type':_0x3853bb['type'][_0x14f7('0x28')]};});_0x282b1b['model']=_[_0x14f7('0x25')](_0x5c5d63,_0x14f7('0x23'));_0x282b1b['query']=_[_0x14f7('0x29')](_0x1185d4[_0x14f7('0x2a')]);_0x282b1b[_0x14f7('0x2b')]=_[_0x14f7('0x2c')](_0x282b1b[_0x14f7('0x2d')],_0x282b1b['query']);_0x4b3379[_0x14f7('0x2e')]=_[_0x14f7('0x2c')](_0x282b1b[_0x14f7('0x2d')],qs[_0x14f7('0x2f')](_0x1185d4[_0x14f7('0x2a')]['fields']));_0x4b3379['attributes']=_0x4b3379[_0x14f7('0x2e')]['length']?_0x4b3379[_0x14f7('0x2e')]:_0x282b1b[_0x14f7('0x2d')];if(!_0x1185d4[_0x14f7('0x2a')][_0x14f7('0x30')](_0x14f7('0x31'))){_0x4b3379[_0x14f7('0x1b')]=qs['limit'](_0x1185d4['query'][_0x14f7('0x1b')]);_0x4b3379['offset']=qs['offset'](_0x1185d4[_0x14f7('0x2a')][_0x14f7('0x1a')]);}_0x4b3379[_0x14f7('0x32')]=qs['sort'](_0x1185d4[_0x14f7('0x2a')][_0x14f7('0x33')]);_0x4b3379[_0x14f7('0x34')]=qs[_0x14f7('0x2b')](_[_0x14f7('0x35')](_0x1185d4[_0x14f7('0x2a')],_0x282b1b[_0x14f7('0x2b')]),_0x5c5d63);if(_0x1185d4[_0x14f7('0x2a')][_0x14f7('0x36')]){_0x4b3379[_0x14f7('0x34')]=_[_0x14f7('0x37')](_0x4b3379[_0x14f7('0x34')],{'$or':_['map'](_0x5c5d63,function(_0x14fae2){if(_0x14fae2[_0x14f7('0x38')]!==_0x14f7('0x39')){var _0x52e319={};_0x52e319[_0x14fae2['name']]={'$like':'%'+_0x1185d4['query'][_0x14f7('0x36')]+'%'};return _0x52e319;}})});}_0x4b3379=_[_0x14f7('0x37')]({},_0x4b3379,_0x1185d4['options']);var _0x4d8952={'where':_0x4b3379[_0x14f7('0x34')]};return db[_0x14f7('0x3a')][_0x14f7('0x19')](_0x4d8952)[_0x14f7('0x1f')](function(_0xbd0d97){_0x4444e5[_0x14f7('0x19')]=_0xbd0d97;if(_0x1185d4[_0x14f7('0x2a')][_0x14f7('0x3b')]){_0x4b3379['include']=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x14f7('0x3c')](_0x4b3379);})[_0x14f7('0x1f')](function(_0x22bdf3){_0x4444e5[_0x14f7('0x3d')]=_0x22bdf3;return _0x4444e5;})[_0x14f7('0x1f')](respondWithFilteredResult(_0x32ed89,_0x4b3379))[_0x14f7('0x3e')](handleError(_0x32ed89,null));};exports[_0x14f7('0x3f')]=function(_0x809631,_0x5009d5){var _0x43d597={'raw':![],'where':{'id':_0x809631[_0x14f7('0x40')]['id']}},_0x5b403c={};_0x5b403c[_0x14f7('0x2d')]=_[_0x14f7('0x29')](db[_0x14f7('0x3a')][_0x14f7('0x26')]);_0x5b403c[_0x14f7('0x2a')]=_[_0x14f7('0x29')](_0x809631[_0x14f7('0x2a')]);_0x5b403c[_0x14f7('0x2b')]=_[_0x14f7('0x2c')](_0x5b403c['model'],_0x5b403c[_0x14f7('0x2a')]);_0x43d597[_0x14f7('0x2e')]=_['intersection'](_0x5b403c[_0x14f7('0x2d')],qs[_0x14f7('0x2f')](_0x809631['query'][_0x14f7('0x2f')]));_0x43d597['attributes']=_0x43d597[_0x14f7('0x2e')][_0x14f7('0x41')]?_0x43d597[_0x14f7('0x2e')]:_0x5b403c[_0x14f7('0x2d')];if(_0x809631[_0x14f7('0x2a')][_0x14f7('0x3b')]){_0x43d597[_0x14f7('0x42')]=[{'all':!![]}];}_0x43d597=_[_0x14f7('0x37')]({},_0x43d597,_0x809631[_0x14f7('0x43')]);return db['AnalyticFieldReport'][_0x14f7('0x44')](_0x43d597)[_0x14f7('0x1f')](handleEntityNotFound(_0x5009d5,null))[_0x14f7('0x1f')](respondWithResult(_0x5009d5,null))[_0x14f7('0x3e')](handleError(_0x5009d5,null));};exports[_0x14f7('0x45')]=function(_0x41424e,_0x49f4d5){return db[_0x14f7('0x3a')][_0x14f7('0x45')](_0x41424e[_0x14f7('0x46')],{})[_0x14f7('0x1f')](respondWithResult(_0x49f4d5,0xc9))['catch'](handleError(_0x49f4d5,null));};exports[_0x14f7('0x47')]=function(_0x27f1a,_0x3b91f1){return db[_0x14f7('0x3a')]['bulkCreate'](_0x27f1a['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x3b91f1,0xc9))['catch'](handleError(_0x3b91f1,null));};exports[_0x14f7('0x48')]=function(_0x326340,_0x53d16f){if(_0x326340[_0x14f7('0x46')]['id']){delete _0x326340[_0x14f7('0x46')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x326340[_0x14f7('0x40')]['id']}})['then'](handleEntityNotFound(_0x53d16f,null))['then'](saveUpdates(_0x326340[_0x14f7('0x46')],null))['then'](respondWithResult(_0x53d16f,null))[_0x14f7('0x3e')](handleError(_0x53d16f,null));};exports[_0x14f7('0x20')]=function(_0x3328f9,_0x341d01){return db[_0x14f7('0x3a')][_0x14f7('0x44')]({'where':{'id':_0x3328f9['params']['id']}})[_0x14f7('0x1f')](handleEntityNotFound(_0x341d01,null))['then'](removeEntity(_0x341d01,null))[_0x14f7('0x3e')](handleError(_0x341d01,null));};exports[_0x14f7('0x49')]=function(_0x5f4408,_0x277e59){return db[_0x14f7('0x3a')][_0x14f7('0x20')]({'where':{'id':_0x5f4408['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x277e59,0xcc))[_0x14f7('0x3e')](handleError(_0x277e59,null));};exports[_0x14f7('0x4a')]=function(_0x2d41dd,_0x416091,_0x4f2c69){return db[_0x14f7('0x4b')][_0x14f7('0x4c')]({'where':{'id':_0x2d41dd[_0x14f7('0x40')]['id']}})[_0x14f7('0x1f')](handleEntityNotFound(_0x416091,null))[_0x14f7('0x1f')](function(_0xea07ff){if(_0xea07ff){return db['sequelize'][_0x14f7('0x4d')](function(_0x5c91b8){return db[_0x14f7('0x3a')][_0x14f7('0x20')]({'where':{'CustomReportId':_0x2d41dd[_0x14f7('0x40')]['id']},'transaction':_0x5c91b8})[_0x14f7('0x1f')](function(_0x5963b8){var _0x32d4dd=_['map'](_0x2d41dd['body'],function(_0x9a91fa){delete _0x9a91fa['id'];_0x9a91fa[_0x14f7('0x4e')]=_0x2d41dd[_0x14f7('0x40')]['id'];return _0x9a91fa;});return db[_0x14f7('0x3a')][_0x14f7('0x47')](_0x32d4dd,{'transaction':_0x5c91b8});});})[_0x14f7('0x1f')](function(){return db[_0x14f7('0x3a')][_0x14f7('0x3c')]({'where':{'CustomReportId':_0x2d41dd['params']['id']}});});}})[_0x14f7('0x1f')](respondWithResult(_0x416091,null))[_0x14f7('0x3e')](handleError(_0x416091,null));};
\ No newline at end of file