Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index 791cd9b..6e5fb7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4c6=['moment','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','key','keys','filters','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','AnalyticFieldReport','include','findAll','rows','catch','show','params','includeAll','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2d138a,_0x38524c){var _0x1c13e9=function(_0x342d00){while(--_0x342d00){_0x2d138a['push'](_0x2d138a['shift']());}};_0x1c13e9(++_0x38524c);}(_0xd4c6,0x14b));var _0x6d4c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4c6[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x6d4c('0x0'));var emlformat=require(_0x6d4c('0x1'));var rimraf=require(_0x6d4c('0x2'));var zipdir=require(_0x6d4c('0x3'));var jsonpatch=require(_0x6d4c('0x4'));var rp=require('request-promise');var moment=require(_0x6d4c('0x5'));var BPromise=require(_0x6d4c('0x6'));var Mustache=require(_0x6d4c('0x7'));var util=require(_0x6d4c('0x8'));var path=require('path');var sox=require(_0x6d4c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6d4c('0xa'));var squel=require(_0x6d4c('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d4c('0xc'));var deskjs=require(_0x6d4c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6d4c('0xe'));var Papa=require('papaparse');var Redis=require(_0x6d4c('0xf'));var authService=require(_0x6d4c('0x10'));var qs=require(_0x6d4c('0x11'));var as=require(_0x6d4c('0x12'));var hardwareService=require(_0x6d4c('0x13'));var logger=require(_0x6d4c('0x14'))(_0x6d4c('0x15'));var utils=require(_0x6d4c('0x16'));var config=require(_0x6d4c('0x17'));var licenseUtil=require(_0x6d4c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9c19d5,_0x543cf0){_0x543cf0=_0x543cf0||0xcc;return function(_0x64c11b){if(_0x64c11b){return _0x9c19d5[_0x6d4c('0x19')](_0x543cf0);}return _0x9c19d5[_0x6d4c('0x1a')](_0x543cf0)[_0x6d4c('0x1b')]();};}function respondWithResult(_0x4cd1a9,_0x410fca){_0x410fca=_0x410fca||0xc8;return function(_0x5cabf0){if(_0x5cabf0){return _0x4cd1a9['status'](_0x410fca)[_0x6d4c('0x1c')](_0x5cabf0);}};}function respondWithFilteredResult(_0x27f77e,_0x34478e){return function(_0x5f0ad6){if(_0x5f0ad6){var _0x5f0347=_0x5f0ad6[_0x6d4c('0x1d')],_0x4bd44e=_0x34478e[_0x6d4c('0x1e')],_0x4f75b2=_0x34478e[_0x6d4c('0x1e')]+_0x34478e[_0x6d4c('0x1f')],_0x1115eb;if(_0x4f75b2>=_0x5f0347){_0x4f75b2=_0x5f0347;_0x1115eb=0xc8;}else{_0x1115eb=0xce;}_0x27f77e[_0x6d4c('0x1a')](_0x1115eb);return _0x27f77e[_0x6d4c('0x20')]('Content-Range',_0x4bd44e+'-'+_0x4f75b2+'/'+_0x5f0347)[_0x6d4c('0x1c')](_0x5f0ad6);}return null;};}function patchUpdates(_0x38dd08){return function(_0x11eac2){try{jsonpatch[_0x6d4c('0x21')](_0x11eac2,_0x38dd08,!![]);}catch(_0x2c0f4f){return BPromise['reject'](_0x2c0f4f);}return _0x11eac2[_0x6d4c('0x22')]();};}function saveUpdates(_0x3922a2,_0x14954c){return function(_0x56827d){if(_0x56827d){return _0x56827d[_0x6d4c('0x23')](_0x3922a2)['then'](function(_0x31d2d3){return _0x31d2d3;});}return null;};}function removeEntity(_0x1c922e,_0x59cc5c){return function(_0x99077e){if(_0x99077e){return _0x99077e[_0x6d4c('0x24')]()[_0x6d4c('0x25')](function(){_0x1c922e[_0x6d4c('0x1a')](0xcc)[_0x6d4c('0x1b')]();});}};}function handleEntityNotFound(_0x290253,_0x3f72b4){return function(_0x94ebe1){if(!_0x94ebe1){_0x290253[_0x6d4c('0x19')](0x194);}return _0x94ebe1;};}function handleError(_0x3ec130,_0x44081f){_0x44081f=_0x44081f||0x1f4;return function(_0x319646){logger[_0x6d4c('0x26')](_0x319646[_0x6d4c('0x27')]);if(_0x319646[_0x6d4c('0x28')]){delete _0x319646[_0x6d4c('0x28')];}_0x3ec130['status'](_0x44081f)[_0x6d4c('0x29')](_0x319646);};}exports[_0x6d4c('0x2a')]=function(_0x34b290,_0x1bbe97){var _0x42700f={},_0x2b032b={},_0x3d86d7={'count':0x0,'rows':[]};var _0x1c0d7c=_['map'](db['AnalyticFieldReport'][_0x6d4c('0x2b')],function(_0xf01b6c){return{'name':_0xf01b6c[_0x6d4c('0x2c')],'type':_0xf01b6c['type'][_0x6d4c('0x2d')]};});_0x2b032b['model']=_['map'](_0x1c0d7c,'name');_0x2b032b['query']=_[_0x6d4c('0x2e')](_0x34b290['query']);_0x2b032b[_0x6d4c('0x2f')]=_['intersection'](_0x2b032b[_0x6d4c('0x30')],_0x2b032b[_0x6d4c('0x31')]);_0x42700f[_0x6d4c('0x32')]=_[_0x6d4c('0x33')](_0x2b032b[_0x6d4c('0x30')],qs[_0x6d4c('0x34')](_0x34b290[_0x6d4c('0x31')][_0x6d4c('0x34')]));_0x42700f[_0x6d4c('0x32')]=_0x42700f['attributes'][_0x6d4c('0x35')]?_0x42700f[_0x6d4c('0x32')]:_0x2b032b['model'];if(!_0x34b290[_0x6d4c('0x31')]['hasOwnProperty'](_0x6d4c('0x36'))){_0x42700f[_0x6d4c('0x1f')]=qs[_0x6d4c('0x1f')](_0x34b290[_0x6d4c('0x31')]['limit']);_0x42700f[_0x6d4c('0x1e')]=qs[_0x6d4c('0x1e')](_0x34b290[_0x6d4c('0x31')]['offset']);}_0x42700f[_0x6d4c('0x37')]=qs[_0x6d4c('0x38')](_0x34b290[_0x6d4c('0x31')][_0x6d4c('0x38')]);_0x42700f[_0x6d4c('0x39')]=qs[_0x6d4c('0x2f')](_[_0x6d4c('0x3a')](_0x34b290[_0x6d4c('0x31')],_0x2b032b[_0x6d4c('0x2f')]),_0x1c0d7c);if(_0x34b290[_0x6d4c('0x31')]['filter']){_0x42700f[_0x6d4c('0x39')]=_[_0x6d4c('0x3b')](_0x42700f[_0x6d4c('0x39')],{'$or':_[_0x6d4c('0x3c')](_0x1c0d7c,function(_0x1f993b){if(_0x1f993b[_0x6d4c('0x3d')]!==_0x6d4c('0x3e')){var _0x33fcc6={};_0x33fcc6[_0x1f993b[_0x6d4c('0x28')]]={'$like':'%'+_0x34b290['query'][_0x6d4c('0x3f')]+'%'};return _0x33fcc6;}})});}_0x42700f=_[_0x6d4c('0x3b')]({},_0x42700f,_0x34b290[_0x6d4c('0x40')]);var _0x5af181={'where':_0x42700f[_0x6d4c('0x39')]};return db[_0x6d4c('0x41')]['count'](_0x5af181)[_0x6d4c('0x25')](function(_0x1c8e59){_0x3d86d7[_0x6d4c('0x1d')]=_0x1c8e59;if(_0x34b290[_0x6d4c('0x31')]['includeAll']){_0x42700f[_0x6d4c('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x6d4c('0x43')](_0x42700f);})[_0x6d4c('0x25')](function(_0x3254d8){_0x3d86d7[_0x6d4c('0x44')]=_0x3254d8;return _0x3d86d7;})[_0x6d4c('0x25')](respondWithFilteredResult(_0x1bbe97,_0x42700f))[_0x6d4c('0x45')](handleError(_0x1bbe97,null));};exports[_0x6d4c('0x46')]=function(_0x423ee3,_0xf2a656){var _0x1bb160={'raw':![],'where':{'id':_0x423ee3[_0x6d4c('0x47')]['id']}},_0x2bafbe={};_0x2bafbe[_0x6d4c('0x30')]=_[_0x6d4c('0x2e')](db[_0x6d4c('0x41')]['rawAttributes']);_0x2bafbe[_0x6d4c('0x31')]=_[_0x6d4c('0x2e')](_0x423ee3[_0x6d4c('0x31')]);_0x2bafbe[_0x6d4c('0x2f')]=_['intersection'](_0x2bafbe[_0x6d4c('0x30')],_0x2bafbe[_0x6d4c('0x31')]);_0x1bb160[_0x6d4c('0x32')]=_[_0x6d4c('0x33')](_0x2bafbe[_0x6d4c('0x30')],qs[_0x6d4c('0x34')](_0x423ee3[_0x6d4c('0x31')][_0x6d4c('0x34')]));_0x1bb160[_0x6d4c('0x32')]=_0x1bb160[_0x6d4c('0x32')][_0x6d4c('0x35')]?_0x1bb160[_0x6d4c('0x32')]:_0x2bafbe[_0x6d4c('0x30')];if(_0x423ee3[_0x6d4c('0x31')][_0x6d4c('0x48')]){_0x1bb160['include']=[{'all':!![]}];}_0x1bb160=_[_0x6d4c('0x3b')]({},_0x1bb160,_0x423ee3['options']);return db[_0x6d4c('0x41')]['find'](_0x1bb160)[_0x6d4c('0x25')](handleEntityNotFound(_0xf2a656,null))[_0x6d4c('0x25')](respondWithResult(_0xf2a656,null))['catch'](handleError(_0xf2a656,null));};exports[_0x6d4c('0x49')]=function(_0x1d6997,_0x208f7c){return db[_0x6d4c('0x41')][_0x6d4c('0x49')](_0x1d6997[_0x6d4c('0x4a')],{})[_0x6d4c('0x25')](respondWithResult(_0x208f7c,0xc9))['catch'](handleError(_0x208f7c,null));};exports[_0x6d4c('0x4b')]=function(_0x591c04,_0x1d25de){return db['AnalyticFieldReport'][_0x6d4c('0x4b')](_0x591c04[_0x6d4c('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1d25de,0xc9))[_0x6d4c('0x45')](handleError(_0x1d25de,null));};exports['update']=function(_0x48f659,_0x2622fc){if(_0x48f659['body']['id']){delete _0x48f659['body']['id'];}return db[_0x6d4c('0x41')][_0x6d4c('0x4c')]({'where':{'id':_0x48f659[_0x6d4c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2622fc,null))['then'](saveUpdates(_0x48f659[_0x6d4c('0x4a')],null))['then'](respondWithResult(_0x2622fc,null))['catch'](handleError(_0x2622fc,null));};exports['destroy']=function(_0x34d06b,_0x4627c7){return db['AnalyticFieldReport']['find']({'where':{'id':_0x34d06b['params']['id']}})[_0x6d4c('0x25')](handleEntityNotFound(_0x4627c7,null))[_0x6d4c('0x25')](removeEntity(_0x4627c7,null))[_0x6d4c('0x45')](handleError(_0x4627c7,null));};exports[_0x6d4c('0x4d')]=function(_0x73fea7,_0x426361){return db['AnalyticFieldReport'][_0x6d4c('0x24')]({'where':{'id':_0x73fea7[_0x6d4c('0x31')][_0x6d4c('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x6d4c('0x25')](respondWithResult(_0x426361,0xcc))['catch'](handleError(_0x426361,null));};exports[_0x6d4c('0x4f')]=function(_0x2e6826,_0x7e3503,_0xcca244){return db[_0x6d4c('0x50')][_0x6d4c('0x51')]({'where':{'id':_0x2e6826[_0x6d4c('0x47')]['id']}})[_0x6d4c('0x25')](handleEntityNotFound(_0x7e3503,null))[_0x6d4c('0x25')](function(_0x54b659){if(_0x54b659){return db[_0x6d4c('0x52')][_0x6d4c('0x53')](function(_0x44dc84){return db['AnalyticFieldReport'][_0x6d4c('0x24')]({'where':{'CustomReportId':_0x2e6826['params']['id']},'transaction':_0x44dc84})[_0x6d4c('0x25')](function(_0x3d1eb){var _0xfa0710=_['map'](_0x2e6826['body'],function(_0x4f44e1){delete _0x4f44e1['id'];_0x4f44e1['CustomReportId']=_0x2e6826[_0x6d4c('0x47')]['id'];return _0x4f44e1;});return db[_0x6d4c('0x41')][_0x6d4c('0x4b')](_0xfa0710,{'transaction':_0x44dc84});});})[_0x6d4c('0x25')](function(){return db[_0x6d4c('0x41')]['findAll']({'where':{'CustomReportId':_0x2e6826[_0x6d4c('0x47')]['id']}});});}})[_0x6d4c('0x25')](respondWithResult(_0x7e3503,null))[_0x6d4c('0x45')](handleError(_0x7e3503,null));};
\ No newline at end of file
+var _0xc485=['nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','create','body','bulkCreate','find','params','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','status','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0xc485,0x105));var _0x5c48=function(_0xdb628e,_0x103e9a){_0xdb628e=_0xdb628e-0x0;var _0x493aa5=_0xc485[_0xdb628e];return _0x493aa5;};'use strict';var emlformat=require(_0x5c48('0x0'));var rimraf=require(_0x5c48('0x1'));var zipdir=require(_0x5c48('0x2'));var jsonpatch=require(_0x5c48('0x3'));var rp=require(_0x5c48('0x4'));var moment=require(_0x5c48('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5c48('0x6'));var util=require(_0x5c48('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5c48('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c48('0x9'));var jsforce=require(_0x5c48('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5c48('0xb'));var querystring=require(_0x5c48('0xc'));var Papa=require(_0x5c48('0xd'));var Redis=require('ioredis');var authService=require(_0x5c48('0xe'));var qs=require(_0x5c48('0xf'));var as=require(_0x5c48('0x10'));var hardwareService=require(_0x5c48('0x11'));var logger=require(_0x5c48('0x12'))(_0x5c48('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c48('0x14'));var db=require(_0x5c48('0x15'))['db'];function respondWithStatusCode(_0x427684,_0x37f8d9){_0x37f8d9=_0x37f8d9||0xcc;return function(_0x3df1d1){if(_0x3df1d1){return _0x427684[_0x5c48('0x16')](_0x37f8d9);}return _0x427684['status'](_0x37f8d9)['end']();};}function respondWithResult(_0x36cb51,_0x1c116e){_0x1c116e=_0x1c116e||0xc8;return function(_0x1e93bc){if(_0x1e93bc){return _0x36cb51['status'](_0x1c116e)[_0x5c48('0x17')](_0x1e93bc);}};}function respondWithFilteredResult(_0x3dda19,_0x36371b){return function(_0x19dc50){if(_0x19dc50){var _0x17a784=typeof _0x36371b[_0x5c48('0x18')]==='undefined'&&typeof _0x36371b[_0x5c48('0x19')]===_0x5c48('0x1a');var _0x12c781=_0x19dc50[_0x5c48('0x1b')];var _0x1b1877=_0x17a784?0x0:_0x36371b[_0x5c48('0x18')];var _0x4f57dc=_0x17a784?_0x19dc50['count']:_0x36371b[_0x5c48('0x18')]+_0x36371b['limit'];var _0x1f1c9a;if(_0x4f57dc>=_0x12c781){_0x4f57dc=_0x12c781;_0x1f1c9a=0xc8;}else{_0x1f1c9a=0xce;}_0x3dda19['status'](_0x1f1c9a);return _0x3dda19['set'](_0x5c48('0x1c'),_0x1b1877+'-'+_0x4f57dc+'/'+_0x12c781)['json'](_0x19dc50);}return null;};}function patchUpdates(_0x3a7975){return function(_0x2adb1d){try{jsonpatch[_0x5c48('0x1d')](_0x2adb1d,_0x3a7975,!![]);}catch(_0xc28b4c){return BPromise[_0x5c48('0x1e')](_0xc28b4c);}return _0x2adb1d[_0x5c48('0x1f')]();};}function saveUpdates(_0x5eb373,_0x175fa7){return function(_0x28c09b){if(_0x28c09b){return _0x28c09b[_0x5c48('0x20')](_0x5eb373)[_0x5c48('0x21')](function(_0x36bc86){return _0x36bc86;});}return null;};}function removeEntity(_0x63c5b1,_0x37c5eb){return function(_0x237380){if(_0x237380){return _0x237380[_0x5c48('0x22')]()[_0x5c48('0x21')](function(){_0x63c5b1[_0x5c48('0x23')](0xcc)[_0x5c48('0x24')]();});}};}function handleEntityNotFound(_0x1c2474,_0x18e2fe){return function(_0x468e49){if(!_0x468e49){_0x1c2474[_0x5c48('0x16')](0x194);}return _0x468e49;};}function handleError(_0x47b309,_0x72662c){_0x72662c=_0x72662c||0x1f4;return function(_0x1ad680){logger[_0x5c48('0x25')](_0x1ad680[_0x5c48('0x26')]);if(_0x1ad680[_0x5c48('0x27')]){delete _0x1ad680[_0x5c48('0x27')];}_0x47b309[_0x5c48('0x23')](_0x72662c)[_0x5c48('0x28')](_0x1ad680);};}exports[_0x5c48('0x29')]=function(_0x2391d8,_0x16f33b){var _0x7c1e9c={},_0x4d1623={},_0x5a5bf7={'count':0x0,'rows':[]};var _0x2c3131=_[_0x5c48('0x2a')](db[_0x5c48('0x2b')][_0x5c48('0x2c')],function(_0x4ec341){return{'name':_0x4ec341[_0x5c48('0x2d')],'type':_0x4ec341[_0x5c48('0x2e')][_0x5c48('0x2f')]};});_0x4d1623['model']=_[_0x5c48('0x2a')](_0x2c3131,_0x5c48('0x27'));_0x4d1623[_0x5c48('0x30')]=_[_0x5c48('0x31')](_0x2391d8[_0x5c48('0x30')]);_0x4d1623[_0x5c48('0x32')]=_[_0x5c48('0x33')](_0x4d1623[_0x5c48('0x34')],_0x4d1623[_0x5c48('0x30')]);_0x7c1e9c[_0x5c48('0x35')]=_[_0x5c48('0x33')](_0x4d1623[_0x5c48('0x34')],qs[_0x5c48('0x36')](_0x2391d8['query']['fields']));_0x7c1e9c[_0x5c48('0x35')]=_0x7c1e9c[_0x5c48('0x35')]['length']?_0x7c1e9c[_0x5c48('0x35')]:_0x4d1623[_0x5c48('0x34')];if(!_0x2391d8[_0x5c48('0x30')]['hasOwnProperty'](_0x5c48('0x37'))){_0x7c1e9c[_0x5c48('0x19')]=qs['limit'](_0x2391d8[_0x5c48('0x30')][_0x5c48('0x19')]);_0x7c1e9c['offset']=qs['offset'](_0x2391d8[_0x5c48('0x30')][_0x5c48('0x18')]);}_0x7c1e9c['order']=qs[_0x5c48('0x38')](_0x2391d8[_0x5c48('0x30')]['sort']);_0x7c1e9c['where']=qs[_0x5c48('0x32')](_[_0x5c48('0x39')](_0x2391d8[_0x5c48('0x30')],_0x4d1623['filters']),_0x2c3131);if(_0x2391d8[_0x5c48('0x30')][_0x5c48('0x3a')]){_0x7c1e9c[_0x5c48('0x3b')]=_['merge'](_0x7c1e9c['where'],{'$or':_[_0x5c48('0x2a')](_0x2c3131,function(_0x22faaa){if(_0x22faaa[_0x5c48('0x2e')]!=='VIRTUAL'){var _0x43bdac={};_0x43bdac[_0x22faaa['name']]={'$like':'%'+_0x2391d8[_0x5c48('0x30')][_0x5c48('0x3a')]+'%'};return _0x43bdac;}})});}_0x7c1e9c=_[_0x5c48('0x3c')]({},_0x7c1e9c,_0x2391d8[_0x5c48('0x3d')]);var _0xe36d2b={'where':_0x7c1e9c[_0x5c48('0x3b')]};return db[_0x5c48('0x2b')][_0x5c48('0x1b')](_0xe36d2b)[_0x5c48('0x21')](function(_0x18b3b1){_0x5a5bf7['count']=_0x18b3b1;if(_0x2391d8[_0x5c48('0x30')][_0x5c48('0x3e')]){_0x7c1e9c[_0x5c48('0x3f')]=[{'all':!![]}];}return db[_0x5c48('0x2b')][_0x5c48('0x40')](_0x7c1e9c);})[_0x5c48('0x21')](function(_0x35cf29){_0x5a5bf7[_0x5c48('0x41')]=_0x35cf29;return _0x5a5bf7;})[_0x5c48('0x21')](respondWithFilteredResult(_0x16f33b,_0x7c1e9c))[_0x5c48('0x42')](handleError(_0x16f33b,null));};exports['show']=function(_0x14036a,_0x5b8a6d){var _0x129860={'raw':![],'where':{'id':_0x14036a['params']['id']}},_0x20bc00={};_0x20bc00[_0x5c48('0x34')]=_[_0x5c48('0x31')](db['AnalyticFieldReport'][_0x5c48('0x2c')]);_0x20bc00[_0x5c48('0x30')]=_[_0x5c48('0x31')](_0x14036a[_0x5c48('0x30')]);_0x20bc00[_0x5c48('0x32')]=_[_0x5c48('0x33')](_0x20bc00[_0x5c48('0x34')],_0x20bc00[_0x5c48('0x30')]);_0x129860[_0x5c48('0x35')]=_[_0x5c48('0x33')](_0x20bc00[_0x5c48('0x34')],qs['fields'](_0x14036a[_0x5c48('0x30')][_0x5c48('0x36')]));_0x129860[_0x5c48('0x35')]=_0x129860[_0x5c48('0x35')]['length']?_0x129860[_0x5c48('0x35')]:_0x20bc00['model'];if(_0x14036a['query']['includeAll']){_0x129860[_0x5c48('0x3f')]=[{'all':!![]}];}_0x129860=_[_0x5c48('0x3c')]({},_0x129860,_0x14036a[_0x5c48('0x3d')]);return db[_0x5c48('0x2b')]['find'](_0x129860)[_0x5c48('0x21')](handleEntityNotFound(_0x5b8a6d,null))[_0x5c48('0x21')](respondWithResult(_0x5b8a6d,null))[_0x5c48('0x42')](handleError(_0x5b8a6d,null));};exports[_0x5c48('0x43')]=function(_0x4e0380,_0x5f1de4){return db[_0x5c48('0x2b')][_0x5c48('0x43')](_0x4e0380[_0x5c48('0x44')],{})[_0x5c48('0x21')](respondWithResult(_0x5f1de4,0xc9))[_0x5c48('0x42')](handleError(_0x5f1de4,null));};exports[_0x5c48('0x45')]=function(_0x16de15,_0x17f77c){return db['AnalyticFieldReport']['bulkCreate'](_0x16de15['body'],{'raw':![],'individualHooks':!![]})[_0x5c48('0x21')](respondWithResult(_0x17f77c,0xc9))[_0x5c48('0x42')](handleError(_0x17f77c,null));};exports[_0x5c48('0x20')]=function(_0x58c0f1,_0x396409){if(_0x58c0f1[_0x5c48('0x44')]['id']){delete _0x58c0f1[_0x5c48('0x44')]['id'];}return db[_0x5c48('0x2b')]['find']({'where':{'id':_0x58c0f1['params']['id']}})['then'](handleEntityNotFound(_0x396409,null))[_0x5c48('0x21')](saveUpdates(_0x58c0f1['body'],null))[_0x5c48('0x21')](respondWithResult(_0x396409,null))['catch'](handleError(_0x396409,null));};exports['destroy']=function(_0x44c605,_0x13895d){return db[_0x5c48('0x2b')][_0x5c48('0x46')]({'where':{'id':_0x44c605[_0x5c48('0x47')]['id']}})[_0x5c48('0x21')](handleEntityNotFound(_0x13895d,null))['then'](removeEntity(_0x13895d,null))['catch'](handleError(_0x13895d,null));};exports[_0x5c48('0x48')]=function(_0x422f26,_0x4a9b31){return db['AnalyticFieldReport'][_0x5c48('0x22')]({'where':{'id':_0x422f26[_0x5c48('0x30')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a9b31,0xcc))[_0x5c48('0x42')](handleError(_0x4a9b31,null));};exports[_0x5c48('0x49')]=function(_0xc74a0a,_0x76aeae,_0x4e5fcf){return db[_0x5c48('0x4a')][_0x5c48('0x4b')]({'where':{'id':_0xc74a0a[_0x5c48('0x47')]['id']}})['then'](handleEntityNotFound(_0x76aeae,null))[_0x5c48('0x21')](function(_0x1d3c75){if(_0x1d3c75){return db[_0x5c48('0x4c')][_0x5c48('0x4d')](function(_0x2f9338){return db['AnalyticFieldReport'][_0x5c48('0x22')]({'where':{'CustomReportId':_0xc74a0a[_0x5c48('0x47')]['id']},'transaction':_0x2f9338})[_0x5c48('0x21')](function(_0xa102c4){var _0x3509f4=_[_0x5c48('0x2a')](_0xc74a0a[_0x5c48('0x44')],function(_0x254d43){delete _0x254d43['id'];_0x254d43[_0x5c48('0x4e')]=_0xc74a0a[_0x5c48('0x47')]['id'];return _0x254d43;});return db['AnalyticFieldReport'][_0x5c48('0x45')](_0x3509f4,{'transaction':_0x2f9338});});})['then'](function(){return db[_0x5c48('0x2b')][_0x5c48('0x40')]({'where':{'CustomReportId':_0xc74a0a[_0x5c48('0x47')]['id']}});});}})[_0x5c48('0x21')](respondWithResult(_0x76aeae,null))['catch'](handleError(_0x76aeae,null));};
\ No newline at end of file