Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index 24b3b5a..4462cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf350=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','bulkCreate','body','find','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x29de5a,_0x34201f){var _0x11339a=function(_0x4e6ce9){while(--_0x4e6ce9){_0x29de5a['push'](_0x29de5a['shift']());}};_0x11339a(++_0x34201f);}(_0xf350,0x105));var _0x0f35=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf350[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x0f35('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0f35('0x1'));var rp=require(_0x0f35('0x2'));var moment=require(_0x0f35('0x3'));var BPromise=require(_0x0f35('0x4'));var Mustache=require(_0x0f35('0x5'));var util=require(_0x0f35('0x6'));var path=require(_0x0f35('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0f35('0x8'));var _=require(_0x0f35('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f35('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0f35('0xb'));var querystring=require('querystring');var Papa=require(_0x0f35('0xc'));var Redis=require(_0x0f35('0xd'));var authService=require(_0x0f35('0xe'));var qs=require(_0x0f35('0xf'));var as=require(_0x0f35('0x10'));var hardwareService=require(_0x0f35('0x11'));var logger=require(_0x0f35('0x12'))(_0x0f35('0x13'));var utils=require(_0x0f35('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x0f35('0x15'));var db=require(_0x0f35('0x16'))['db'];function respondWithStatusCode(_0x515954,_0x21698e){_0x21698e=_0x21698e||0xcc;return function(_0x579b38){if(_0x579b38){return _0x515954[_0x0f35('0x17')](_0x21698e);}return _0x515954['status'](_0x21698e)['end']();};}function respondWithResult(_0x1a2f7c,_0x20cfb8){_0x20cfb8=_0x20cfb8||0xc8;return function(_0x322ed3){if(_0x322ed3){return _0x1a2f7c['status'](_0x20cfb8)[_0x0f35('0x18')](_0x322ed3);}};}function respondWithFilteredResult(_0x4011ab,_0x25e86d){return function(_0x38d9de){if(_0x38d9de){var _0xa07e54=typeof _0x25e86d[_0x0f35('0x19')]===_0x0f35('0x1a')&&typeof _0x25e86d[_0x0f35('0x1b')]===_0x0f35('0x1a');var _0x34b759=_0x38d9de[_0x0f35('0x1c')];var _0x1bcf51=_0xa07e54?0x0:_0x25e86d[_0x0f35('0x19')];var _0x496ff9=_0xa07e54?_0x38d9de[_0x0f35('0x1c')]:_0x25e86d[_0x0f35('0x19')]+_0x25e86d[_0x0f35('0x1b')];var _0x190ee7;if(_0x496ff9>=_0x34b759){_0x496ff9=_0x34b759;_0x190ee7=0xc8;}else{_0x190ee7=0xce;}_0x4011ab[_0x0f35('0x1d')](_0x190ee7);return _0x4011ab[_0x0f35('0x1e')](_0x0f35('0x1f'),_0x1bcf51+'-'+_0x496ff9+'/'+_0x34b759)[_0x0f35('0x18')](_0x38d9de);}return null;};}function patchUpdates(_0x2edf27){return function(_0x19dacb){try{jsonpatch[_0x0f35('0x20')](_0x19dacb,_0x2edf27,!![]);}catch(_0x1ecc64){return BPromise[_0x0f35('0x21')](_0x1ecc64);}return _0x19dacb[_0x0f35('0x22')]();};}function saveUpdates(_0x152e01,_0x42aaa0){return function(_0x4c7b08){if(_0x4c7b08){return _0x4c7b08[_0x0f35('0x23')](_0x152e01)[_0x0f35('0x24')](function(_0x43cf26){return _0x43cf26;});}return null;};}function removeEntity(_0x47d9ee,_0x4a71ed){return function(_0x252515){if(_0x252515){return _0x252515['destroy']()[_0x0f35('0x24')](function(){_0x47d9ee[_0x0f35('0x1d')](0xcc)[_0x0f35('0x25')]();});}};}function handleEntityNotFound(_0x494140,_0x1aed0a){return function(_0x3ce83d){if(!_0x3ce83d){_0x494140[_0x0f35('0x17')](0x194);}return _0x3ce83d;};}function handleError(_0x4a43c7,_0x4863f9){_0x4863f9=_0x4863f9||0x1f4;return function(_0x9091f0){logger[_0x0f35('0x26')](_0x9091f0['stack']);if(_0x9091f0[_0x0f35('0x27')]){delete _0x9091f0[_0x0f35('0x27')];}_0x4a43c7[_0x0f35('0x1d')](_0x4863f9)[_0x0f35('0x28')](_0x9091f0);};}exports[_0x0f35('0x29')]=function(_0x100301,_0x81ec3f){var _0x5d93f2={},_0x4021aa={},_0x3081f8={'count':0x0,'rows':[]};var _0x5cdf8=_['map'](db[_0x0f35('0x2a')][_0x0f35('0x2b')],function(_0x3d4a2d){return{'name':_0x3d4a2d[_0x0f35('0x2c')],'type':_0x3d4a2d[_0x0f35('0x2d')][_0x0f35('0x2e')]};});_0x4021aa['model']=_[_0x0f35('0x2f')](_0x5cdf8,_0x0f35('0x27'));_0x4021aa[_0x0f35('0x30')]=_['keys'](_0x100301[_0x0f35('0x30')]);_0x4021aa[_0x0f35('0x31')]=_[_0x0f35('0x32')](_0x4021aa['model'],_0x4021aa[_0x0f35('0x30')]);_0x5d93f2[_0x0f35('0x33')]=_[_0x0f35('0x32')](_0x4021aa[_0x0f35('0x34')],qs['fields'](_0x100301[_0x0f35('0x30')][_0x0f35('0x35')]));_0x5d93f2[_0x0f35('0x33')]=_0x5d93f2[_0x0f35('0x33')][_0x0f35('0x36')]?_0x5d93f2[_0x0f35('0x33')]:_0x4021aa[_0x0f35('0x34')];if(!_0x100301[_0x0f35('0x30')][_0x0f35('0x37')](_0x0f35('0x38'))){_0x5d93f2[_0x0f35('0x1b')]=qs[_0x0f35('0x1b')](_0x100301[_0x0f35('0x30')]['limit']);_0x5d93f2['offset']=qs[_0x0f35('0x19')](_0x100301[_0x0f35('0x30')]['offset']);}_0x5d93f2['order']=qs[_0x0f35('0x39')](_0x100301[_0x0f35('0x30')]['sort']);_0x5d93f2[_0x0f35('0x3a')]=qs['filters'](_[_0x0f35('0x3b')](_0x100301[_0x0f35('0x30')],_0x4021aa[_0x0f35('0x31')]),_0x5cdf8);if(_0x100301['query'][_0x0f35('0x3c')]){_0x5d93f2['where']=_[_0x0f35('0x3d')](_0x5d93f2[_0x0f35('0x3a')],{'$or':_[_0x0f35('0x2f')](_0x5cdf8,function(_0x1d58df){if(_0x1d58df[_0x0f35('0x2d')]!==_0x0f35('0x3e')){var _0x42e795={};_0x42e795[_0x1d58df[_0x0f35('0x27')]]={'$like':'%'+_0x100301[_0x0f35('0x30')][_0x0f35('0x3c')]+'%'};return _0x42e795;}})});}_0x5d93f2=_[_0x0f35('0x3d')]({},_0x5d93f2,_0x100301[_0x0f35('0x3f')]);var _0x640ce8={'where':_0x5d93f2['where']};return db['AnalyticFieldReport']['count'](_0x640ce8)[_0x0f35('0x24')](function(_0x5059af){_0x3081f8[_0x0f35('0x1c')]=_0x5059af;if(_0x100301[_0x0f35('0x30')][_0x0f35('0x40')]){_0x5d93f2[_0x0f35('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x0f35('0x42')](_0x5d93f2);})[_0x0f35('0x24')](function(_0x49c115){_0x3081f8[_0x0f35('0x43')]=_0x49c115;return _0x3081f8;})[_0x0f35('0x24')](respondWithFilteredResult(_0x81ec3f,_0x5d93f2))[_0x0f35('0x44')](handleError(_0x81ec3f,null));};exports['show']=function(_0x35bf7f,_0x531dac){var _0x1eb325={'raw':![],'where':{'id':_0x35bf7f[_0x0f35('0x45')]['id']}},_0x3e880a={};_0x3e880a[_0x0f35('0x34')]=_[_0x0f35('0x46')](db[_0x0f35('0x2a')]['rawAttributes']);_0x3e880a['query']=_[_0x0f35('0x46')](_0x35bf7f[_0x0f35('0x30')]);_0x3e880a[_0x0f35('0x31')]=_['intersection'](_0x3e880a[_0x0f35('0x34')],_0x3e880a[_0x0f35('0x30')]);_0x1eb325['attributes']=_[_0x0f35('0x32')](_0x3e880a[_0x0f35('0x34')],qs[_0x0f35('0x35')](_0x35bf7f['query']['fields']));_0x1eb325[_0x0f35('0x33')]=_0x1eb325[_0x0f35('0x33')][_0x0f35('0x36')]?_0x1eb325[_0x0f35('0x33')]:_0x3e880a['model'];if(_0x35bf7f['query']['includeAll']){_0x1eb325[_0x0f35('0x41')]=[{'all':!![]}];}_0x1eb325=_[_0x0f35('0x3d')]({},_0x1eb325,_0x35bf7f[_0x0f35('0x3f')]);return db[_0x0f35('0x2a')]['find'](_0x1eb325)[_0x0f35('0x24')](handleEntityNotFound(_0x531dac,null))[_0x0f35('0x24')](respondWithResult(_0x531dac,null))[_0x0f35('0x44')](handleError(_0x531dac,null));};exports['create']=function(_0x2c18ae,_0x6eafce){return db[_0x0f35('0x2a')]['create'](_0x2c18ae['body'],{})[_0x0f35('0x24')](respondWithResult(_0x6eafce,0xc9))['catch'](handleError(_0x6eafce,null));};exports[_0x0f35('0x47')]=function(_0x1af57d,_0x28bc42){return db[_0x0f35('0x2a')]['bulkCreate'](_0x1af57d[_0x0f35('0x48')],{'raw':![],'individualHooks':!![]})[_0x0f35('0x24')](respondWithResult(_0x28bc42,0xc9))[_0x0f35('0x44')](handleError(_0x28bc42,null));};exports[_0x0f35('0x23')]=function(_0x219469,_0x4cac98){if(_0x219469[_0x0f35('0x48')]['id']){delete _0x219469[_0x0f35('0x48')]['id'];}return db[_0x0f35('0x2a')][_0x0f35('0x49')]({'where':{'id':_0x219469[_0x0f35('0x45')]['id']}})[_0x0f35('0x24')](handleEntityNotFound(_0x4cac98,null))[_0x0f35('0x24')](saveUpdates(_0x219469[_0x0f35('0x48')],null))['then'](respondWithResult(_0x4cac98,null))['catch'](handleError(_0x4cac98,null));};exports[_0x0f35('0x4a')]=function(_0xf9ad33,_0x235ce6){return db['AnalyticFieldReport']['find']({'where':{'id':_0xf9ad33[_0x0f35('0x45')]['id']}})['then'](handleEntityNotFound(_0x235ce6,null))[_0x0f35('0x24')](removeEntity(_0x235ce6,null))[_0x0f35('0x44')](handleError(_0x235ce6,null));};exports['bulkDestroy']=function(_0x5311ba,_0x28d29b){return db[_0x0f35('0x2a')]['destroy']({'where':{'id':_0x5311ba[_0x0f35('0x30')][_0x0f35('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x0f35('0x24')](respondWithResult(_0x28d29b,0xcc))[_0x0f35('0x44')](handleError(_0x28d29b,null));};exports[_0x0f35('0x4c')]=function(_0x29669a,_0x409a08,_0x281abd){return db[_0x0f35('0x4d')][_0x0f35('0x4e')]({'where':{'id':_0x29669a[_0x0f35('0x45')]['id']}})['then'](handleEntityNotFound(_0x409a08,null))[_0x0f35('0x24')](function(_0x1246cf){if(_0x1246cf){return db[_0x0f35('0x4f')]['transaction'](function(_0x1d803e){return db[_0x0f35('0x2a')][_0x0f35('0x4a')]({'where':{'CustomReportId':_0x29669a['params']['id']},'transaction':_0x1d803e})[_0x0f35('0x24')](function(_0x43e3ec){var _0x249072=_['map'](_0x29669a[_0x0f35('0x48')],function(_0x3ae1b2){delete _0x3ae1b2['id'];_0x3ae1b2['CustomReportId']=_0x29669a[_0x0f35('0x45')]['id'];return _0x3ae1b2;});return db['AnalyticFieldReport'][_0x0f35('0x47')](_0x249072,{'transaction':_0x1d803e});});})[_0x0f35('0x24')](function(){return db[_0x0f35('0x2a')][_0x0f35('0x42')]({'where':{'CustomReportId':_0x29669a[_0x0f35('0x45')]['id']}});});}})[_0x0f35('0x24')](respondWithResult(_0x409a08,null))[_0x0f35('0x44')](handleError(_0x409a08,null));};
\ No newline at end of file
+var _0xa6c5=['keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','AnalyticFieldReport','includeAll','include','rows','catch','show','merge','options','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x37bf7b,_0x857bca){var _0x4db72f=function(_0x7e56b){while(--_0x7e56b){_0x37bf7b['push'](_0x37bf7b['shift']());}};_0x4db72f(++_0x857bca);}(_0xa6c5,0x7a));var _0x5a6c=function(_0x5bdc0f,_0xd2ca59){_0x5bdc0f=_0x5bdc0f-0x0;var _0x318e07=_0xa6c5[_0x5bdc0f];return _0x318e07;};'use strict';var emlformat=require(_0x5a6c('0x0'));var rimraf=require(_0x5a6c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a6c('0x2'));var rp=require(_0x5a6c('0x3'));var moment=require(_0x5a6c('0x4'));var BPromise=require(_0x5a6c('0x5'));var Mustache=require(_0x5a6c('0x6'));var util=require(_0x5a6c('0x7'));var path=require(_0x5a6c('0x8'));var sox=require(_0x5a6c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5a6c('0xa'));var _=require('lodash');var squel=require(_0x5a6c('0xb'));var crypto=require(_0x5a6c('0xc'));var jsforce=require(_0x5a6c('0xd'));var deskjs=require(_0x5a6c('0xe'));var toCsv=require(_0x5a6c('0xf'));var querystring=require(_0x5a6c('0x10'));var Papa=require(_0x5a6c('0x11'));var Redis=require('ioredis');var authService=require(_0x5a6c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5a6c('0x13'));var hardwareService=require(_0x5a6c('0x14'));var logger=require(_0x5a6c('0x15'))('api');var utils=require(_0x5a6c('0x16'));var config=require(_0x5a6c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5a6c('0x18'))['db'];function respondWithStatusCode(_0x38b4bd,_0x3315c6){_0x3315c6=_0x3315c6||0xcc;return function(_0x420fe4){if(_0x420fe4){return _0x38b4bd[_0x5a6c('0x19')](_0x3315c6);}return _0x38b4bd[_0x5a6c('0x1a')](_0x3315c6)[_0x5a6c('0x1b')]();};}function respondWithResult(_0x1c7346,_0x9baab){_0x9baab=_0x9baab||0xc8;return function(_0x227a11){if(_0x227a11){return _0x1c7346[_0x5a6c('0x1a')](_0x9baab)[_0x5a6c('0x1c')](_0x227a11);}};}function respondWithFilteredResult(_0x1bc710,_0x244c30){return function(_0x1305d4){if(_0x1305d4){var _0xfbb06c=typeof _0x244c30[_0x5a6c('0x1d')]==='undefined'&&typeof _0x244c30[_0x5a6c('0x1e')]==='undefined';var _0x8231fd=_0x1305d4[_0x5a6c('0x1f')];var _0xf82d73=_0xfbb06c?0x0:_0x244c30[_0x5a6c('0x1d')];var _0xa874f1=_0xfbb06c?_0x1305d4[_0x5a6c('0x1f')]:_0x244c30['offset']+_0x244c30['limit'];var _0x29840f;if(_0xa874f1>=_0x8231fd){_0xa874f1=_0x8231fd;_0x29840f=0xc8;}else{_0x29840f=0xce;}_0x1bc710[_0x5a6c('0x1a')](_0x29840f);return _0x1bc710[_0x5a6c('0x20')]('Content-Range',_0xf82d73+'-'+_0xa874f1+'/'+_0x8231fd)[_0x5a6c('0x1c')](_0x1305d4);}return null;};}function patchUpdates(_0x2a507a){return function(_0x40cdaa){try{jsonpatch[_0x5a6c('0x21')](_0x40cdaa,_0x2a507a,!![]);}catch(_0x46d974){return BPromise[_0x5a6c('0x22')](_0x46d974);}return _0x40cdaa['save']();};}function saveUpdates(_0x2f1dba,_0x59a70b){return function(_0x2040ea){if(_0x2040ea){return _0x2040ea['update'](_0x2f1dba)[_0x5a6c('0x23')](function(_0x4c84c5){return _0x4c84c5;});}return null;};}function removeEntity(_0x387b09,_0x595d63){return function(_0x564a2f){if(_0x564a2f){return _0x564a2f[_0x5a6c('0x24')]()['then'](function(){_0x387b09[_0x5a6c('0x1a')](0xcc)[_0x5a6c('0x1b')]();});}};}function handleEntityNotFound(_0x47fa2f,_0x35613a){return function(_0x379509){if(!_0x379509){_0x47fa2f[_0x5a6c('0x19')](0x194);}return _0x379509;};}function handleError(_0x390272,_0x33229c){_0x33229c=_0x33229c||0x1f4;return function(_0xbf1520){logger[_0x5a6c('0x25')](_0xbf1520['stack']);if(_0xbf1520['name']){delete _0xbf1520[_0x5a6c('0x26')];}_0x390272[_0x5a6c('0x1a')](_0x33229c)[_0x5a6c('0x27')](_0xbf1520);};}exports[_0x5a6c('0x28')]=function(_0x1347d4,_0x142c8e){var _0x4098b8={},_0x660e34={},_0x2fdf14={'count':0x0,'rows':[]};var _0x195dae=_[_0x5a6c('0x29')](db['AnalyticFieldReport'][_0x5a6c('0x2a')],function(_0x5c931e){return{'name':_0x5c931e[_0x5a6c('0x2b')],'type':_0x5c931e[_0x5a6c('0x2c')][_0x5a6c('0x2d')]};});_0x660e34['model']=_[_0x5a6c('0x29')](_0x195dae,_0x5a6c('0x26'));_0x660e34['query']=_[_0x5a6c('0x2e')](_0x1347d4[_0x5a6c('0x2f')]);_0x660e34['filters']=_[_0x5a6c('0x30')](_0x660e34[_0x5a6c('0x31')],_0x660e34[_0x5a6c('0x2f')]);_0x4098b8[_0x5a6c('0x32')]=_[_0x5a6c('0x30')](_0x660e34[_0x5a6c('0x31')],qs[_0x5a6c('0x33')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x33')]));_0x4098b8['attributes']=_0x4098b8[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x4098b8[_0x5a6c('0x32')]:_0x660e34[_0x5a6c('0x31')];if(!_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x35')](_0x5a6c('0x36'))){_0x4098b8[_0x5a6c('0x1e')]=qs[_0x5a6c('0x1e')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x1e')]);_0x4098b8[_0x5a6c('0x1d')]=qs[_0x5a6c('0x1d')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x1d')]);}_0x4098b8[_0x5a6c('0x37')]=qs[_0x5a6c('0x38')](_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x38')]);_0x4098b8[_0x5a6c('0x39')]=qs['filters'](_[_0x5a6c('0x3a')](_0x1347d4['query'],_0x660e34[_0x5a6c('0x3b')]),_0x195dae);if(_0x1347d4[_0x5a6c('0x2f')]['filter']){_0x4098b8[_0x5a6c('0x39')]=_['merge'](_0x4098b8[_0x5a6c('0x39')],{'$or':_[_0x5a6c('0x29')](_0x195dae,function(_0xbebc5c){if(_0xbebc5c['type']!==_0x5a6c('0x3c')){var _0x20017b={};_0x20017b[_0xbebc5c['name']]={'$like':'%'+_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x3d')]+'%'};return _0x20017b;}})});}_0x4098b8=_['merge']({},_0x4098b8,_0x1347d4['options']);var _0x596c5a={'where':_0x4098b8[_0x5a6c('0x39')]};return db[_0x5a6c('0x3e')]['count'](_0x596c5a)[_0x5a6c('0x23')](function(_0x3e7467){_0x2fdf14[_0x5a6c('0x1f')]=_0x3e7467;if(_0x1347d4[_0x5a6c('0x2f')][_0x5a6c('0x3f')]){_0x4098b8[_0x5a6c('0x40')]=[{'all':!![]}];}return db[_0x5a6c('0x3e')]['findAll'](_0x4098b8);})['then'](function(_0x1bbf3a){_0x2fdf14[_0x5a6c('0x41')]=_0x1bbf3a;return _0x2fdf14;})['then'](respondWithFilteredResult(_0x142c8e,_0x4098b8))[_0x5a6c('0x42')](handleError(_0x142c8e,null));};exports[_0x5a6c('0x43')]=function(_0xb8a6a7,_0x4334eb){var _0x4cd59a={'raw':![],'where':{'id':_0xb8a6a7['params']['id']}},_0x414bde={};_0x414bde[_0x5a6c('0x31')]=_['keys'](db[_0x5a6c('0x3e')]['rawAttributes']);_0x414bde['query']=_['keys'](_0xb8a6a7['query']);_0x414bde[_0x5a6c('0x3b')]=_[_0x5a6c('0x30')](_0x414bde['model'],_0x414bde['query']);_0x4cd59a[_0x5a6c('0x32')]=_[_0x5a6c('0x30')](_0x414bde[_0x5a6c('0x31')],qs[_0x5a6c('0x33')](_0xb8a6a7[_0x5a6c('0x2f')][_0x5a6c('0x33')]));_0x4cd59a[_0x5a6c('0x32')]=_0x4cd59a[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x4cd59a[_0x5a6c('0x32')]:_0x414bde[_0x5a6c('0x31')];if(_0xb8a6a7[_0x5a6c('0x2f')][_0x5a6c('0x3f')]){_0x4cd59a[_0x5a6c('0x40')]=[{'all':!![]}];}_0x4cd59a=_[_0x5a6c('0x44')]({},_0x4cd59a,_0xb8a6a7[_0x5a6c('0x45')]);return db[_0x5a6c('0x3e')][_0x5a6c('0x46')](_0x4cd59a)[_0x5a6c('0x23')](handleEntityNotFound(_0x4334eb,null))[_0x5a6c('0x23')](respondWithResult(_0x4334eb,null))[_0x5a6c('0x42')](handleError(_0x4334eb,null));};exports[_0x5a6c('0x47')]=function(_0x781aa2,_0x496911){return db[_0x5a6c('0x3e')][_0x5a6c('0x47')](_0x781aa2[_0x5a6c('0x48')],{})['then'](respondWithResult(_0x496911,0xc9))['catch'](handleError(_0x496911,null));};exports[_0x5a6c('0x49')]=function(_0x44d64a,_0x3d0ccc){return db[_0x5a6c('0x3e')]['bulkCreate'](_0x44d64a[_0x5a6c('0x48')],{'raw':![],'individualHooks':!![]})[_0x5a6c('0x23')](respondWithResult(_0x3d0ccc,0xc9))[_0x5a6c('0x42')](handleError(_0x3d0ccc,null));};exports[_0x5a6c('0x4a')]=function(_0x18fe25,_0x320eb4){if(_0x18fe25[_0x5a6c('0x48')]['id']){delete _0x18fe25['body']['id'];}return db[_0x5a6c('0x3e')][_0x5a6c('0x46')]({'where':{'id':_0x18fe25[_0x5a6c('0x4b')]['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x320eb4,null))[_0x5a6c('0x23')](saveUpdates(_0x18fe25[_0x5a6c('0x48')],null))[_0x5a6c('0x23')](respondWithResult(_0x320eb4,null))['catch'](handleError(_0x320eb4,null));};exports[_0x5a6c('0x24')]=function(_0x48054e,_0x50e6ad){return db[_0x5a6c('0x3e')]['find']({'where':{'id':_0x48054e['params']['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x50e6ad,null))[_0x5a6c('0x23')](removeEntity(_0x50e6ad,null))[_0x5a6c('0x42')](handleError(_0x50e6ad,null));};exports[_0x5a6c('0x4c')]=function(_0x1ef635,_0xc652d8){return db['AnalyticFieldReport'][_0x5a6c('0x24')]({'where':{'id':_0x1ef635[_0x5a6c('0x2f')][_0x5a6c('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x5a6c('0x23')](respondWithResult(_0xc652d8,0xcc))['catch'](handleError(_0xc652d8,null));};exports[_0x5a6c('0x4e')]=function(_0x5eb248,_0x9fffce,_0xbb9f41){return db['AnalyticCustomReport'][_0x5a6c('0x4f')]({'where':{'id':_0x5eb248[_0x5a6c('0x4b')]['id']}})[_0x5a6c('0x23')](handleEntityNotFound(_0x9fffce,null))[_0x5a6c('0x23')](function(_0x1e5965){if(_0x1e5965){return db[_0x5a6c('0x50')][_0x5a6c('0x51')](function(_0x1c1cf4){return db[_0x5a6c('0x3e')][_0x5a6c('0x24')]({'where':{'CustomReportId':_0x5eb248[_0x5a6c('0x4b')]['id']},'transaction':_0x1c1cf4})[_0x5a6c('0x23')](function(_0x1355b4){var _0x3234bb=_[_0x5a6c('0x29')](_0x5eb248[_0x5a6c('0x48')],function(_0x2af1a1){delete _0x2af1a1['id'];_0x2af1a1[_0x5a6c('0x52')]=_0x5eb248[_0x5a6c('0x4b')]['id'];return _0x2af1a1;});return db[_0x5a6c('0x3e')][_0x5a6c('0x49')](_0x3234bb,{'transaction':_0x1c1cf4});});})[_0x5a6c('0x23')](function(){return db['AnalyticFieldReport'][_0x5a6c('0x53')]({'where':{'CustomReportId':_0x5eb248[_0x5a6c('0x4b')]['id']}});});}})[_0x5a6c('0x23')](respondWithResult(_0x9fffce,null))[_0x5a6c('0x42')](handleError(_0x9fffce,null));};
\ No newline at end of file