Built motion from commit (unavailable).|2.5.15
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index f144306..7262288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd43=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','bulkCreate','params','bulkDestroy','addFields','findOne','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','update','then','destroy','error','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where'];(function(_0x210a6c,_0x3ae28b){var _0x20eb37=function(_0x418368){while(--_0x418368){_0x210a6c['push'](_0x210a6c['shift']());}};_0x20eb37(++_0x3ae28b);}(_0xfd43,0xf9));var _0x3fd4=function(_0x17c540,_0x587758){_0x17c540=_0x17c540-0x0;var _0x242bbc=_0xfd43[_0x17c540];return _0x242bbc;};'use strict';var pdf=require(_0x3fd4('0x0'));var emlformat=require(_0x3fd4('0x1'));var rimraf=require(_0x3fd4('0x2'));var zipdir=require(_0x3fd4('0x3'));var jsonpatch=require(_0x3fd4('0x4'));var rp=require(_0x3fd4('0x5'));var moment=require(_0x3fd4('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3fd4('0x7'));var path=require('path');var sox=require(_0x3fd4('0x8'));var csv=require(_0x3fd4('0x9'));var ejs=require(_0x3fd4('0xa'));var fs=require('fs');var _=require(_0x3fd4('0xb'));var squel=require(_0x3fd4('0xc'));var crypto=require(_0x3fd4('0xd'));var jsforce=require(_0x3fd4('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3fd4('0xf'));var Redis=require(_0x3fd4('0x10'));var authService=require(_0x3fd4('0x11'));var qs=require(_0x3fd4('0x12'));var as=require(_0x3fd4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3fd4('0x14'));var utils=require(_0x3fd4('0x15'));var config=require(_0x3fd4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fd4('0x17'))['db'];function respondWithStatusCode(_0x227e62,_0x5641d2){_0x5641d2=_0x5641d2||0xcc;return function(_0x499445){if(_0x499445){return _0x227e62[_0x3fd4('0x18')](_0x5641d2);}return _0x227e62[_0x3fd4('0x19')](_0x5641d2)[_0x3fd4('0x1a')]();};}function respondWithResult(_0x574453,_0x487608){_0x487608=_0x487608||0xc8;return function(_0x57b3b4){if(_0x57b3b4){return _0x574453[_0x3fd4('0x19')](_0x487608)[_0x3fd4('0x1b')](_0x57b3b4);}};}function respondWithFilteredResult(_0x290616,_0x35de86){return function(_0x5448e9){if(_0x5448e9){var _0x6b22a9=_0x5448e9[_0x3fd4('0x1c')],_0x59a597=_0x35de86['offset'],_0x32ecfa=_0x35de86[_0x3fd4('0x1d')]+_0x35de86[_0x3fd4('0x1e')],_0x177e98;if(_0x32ecfa>=_0x6b22a9){_0x32ecfa=_0x6b22a9;_0x177e98=0xc8;}else{_0x177e98=0xce;}_0x290616[_0x3fd4('0x19')](_0x177e98);return _0x290616['set']('Content-Range',_0x59a597+'-'+_0x32ecfa+'/'+_0x6b22a9)['json'](_0x5448e9);}return null;};}function patchUpdates(_0x228a3a){return function(_0x10d4cd){try{jsonpatch[_0x3fd4('0x1f')](_0x10d4cd,_0x228a3a,!![]);}catch(_0x2f4a7a){return BPromise[_0x3fd4('0x20')](_0x2f4a7a);}return _0x10d4cd['save']();};}function saveUpdates(_0x25b243,_0x2c16a3){return function(_0x34ab38){if(_0x34ab38){return _0x34ab38[_0x3fd4('0x21')](_0x25b243)[_0x3fd4('0x22')](function(_0x35caf4){return _0x35caf4;});}return null;};}function removeEntity(_0x1e941e,_0x18f18a){return function(_0x209182){if(_0x209182){return _0x209182[_0x3fd4('0x23')]()[_0x3fd4('0x22')](function(){_0x1e941e['status'](0xcc)[_0x3fd4('0x1a')]();});}};}function handleEntityNotFound(_0x5ce12b,_0x152f27){return function(_0x1f84d1){if(!_0x1f84d1){_0x5ce12b['sendStatus'](0x194);}return _0x1f84d1;};}function handleError(_0x555220,_0x5d7713){_0x5d7713=_0x5d7713||0x1f4;return function(_0x320c4b){logger[_0x3fd4('0x24')](_0x320c4b[_0x3fd4('0x25')]);if(_0x320c4b[_0x3fd4('0x26')]){delete _0x320c4b[_0x3fd4('0x26')];}_0x555220['status'](_0x5d7713)[_0x3fd4('0x27')](_0x320c4b);};}exports['index']=function(_0x23de37,_0x22a1bf){var _0x4634c1={},_0xaf16ea={},_0x2de9a4={'count':0x0,'rows':[]};var _0x1c18d8=_[_0x3fd4('0x28')](db[_0x3fd4('0x29')][_0x3fd4('0x2a')],function(_0x3add67){return{'name':_0x3add67[_0x3fd4('0x2b')],'type':_0x3add67[_0x3fd4('0x2c')][_0x3fd4('0x2d')]};});_0xaf16ea[_0x3fd4('0x2e')]=_['map'](_0x1c18d8,'name');_0xaf16ea[_0x3fd4('0x2f')]=_[_0x3fd4('0x30')](_0x23de37[_0x3fd4('0x2f')]);_0xaf16ea['filters']=_[_0x3fd4('0x31')](_0xaf16ea['model'],_0xaf16ea[_0x3fd4('0x2f')]);_0x4634c1[_0x3fd4('0x32')]=_[_0x3fd4('0x31')](_0xaf16ea[_0x3fd4('0x2e')],qs[_0x3fd4('0x33')](_0x23de37['query'][_0x3fd4('0x33')]));_0x4634c1[_0x3fd4('0x32')]=_0x4634c1[_0x3fd4('0x32')][_0x3fd4('0x34')]?_0x4634c1[_0x3fd4('0x32')]:_0xaf16ea['model'];if(!_0x23de37[_0x3fd4('0x2f')][_0x3fd4('0x35')](_0x3fd4('0x36'))){_0x4634c1['limit']=qs[_0x3fd4('0x1e')](_0x23de37[_0x3fd4('0x2f')]['limit']);_0x4634c1[_0x3fd4('0x1d')]=qs['offset'](_0x23de37[_0x3fd4('0x2f')][_0x3fd4('0x1d')]);}_0x4634c1['order']=qs[_0x3fd4('0x37')](_0x23de37[_0x3fd4('0x2f')][_0x3fd4('0x37')]);_0x4634c1['where']=qs[_0x3fd4('0x38')](_['pick'](_0x23de37['query'],_0xaf16ea['filters']),_0x1c18d8);if(_0x23de37[_0x3fd4('0x2f')][_0x3fd4('0x39')]){_0x4634c1[_0x3fd4('0x3a')]=_[_0x3fd4('0x3b')](_0x4634c1['where'],{'$or':_['map'](_0x1c18d8,function(_0x12a7d2){if(_0x12a7d2[_0x3fd4('0x2c')]!==_0x3fd4('0x3c')){var _0x5c4edf={};_0x5c4edf[_0x12a7d2[_0x3fd4('0x26')]]={'$like':'%'+_0x23de37['query']['filter']+'%'};return _0x5c4edf;}})});}_0x4634c1=_['merge']({},_0x4634c1,_0x23de37[_0x3fd4('0x3d')]);var _0x45ddfa={'where':_0x4634c1[_0x3fd4('0x3a')]};return db[_0x3fd4('0x29')]['count'](_0x45ddfa)[_0x3fd4('0x22')](function(_0x3c7d6a){_0x2de9a4[_0x3fd4('0x1c')]=_0x3c7d6a;if(_0x23de37[_0x3fd4('0x2f')][_0x3fd4('0x3e')]){_0x4634c1[_0x3fd4('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x3fd4('0x40')](_0x4634c1);})[_0x3fd4('0x22')](function(_0x4c65f4){_0x2de9a4[_0x3fd4('0x41')]=_0x4c65f4;return _0x2de9a4;})['then'](respondWithFilteredResult(_0x22a1bf,_0x4634c1))['catch'](handleError(_0x22a1bf,null));};exports[_0x3fd4('0x42')]=function(_0x3f49e8,_0x48baa1){var _0x2bc33f={'raw':![],'where':{'id':_0x3f49e8['params']['id']}},_0x42ecd3={};_0x42ecd3[_0x3fd4('0x2e')]=_[_0x3fd4('0x30')](db['AnalyticFieldReport'][_0x3fd4('0x2a')]);_0x42ecd3[_0x3fd4('0x2f')]=_['keys'](_0x3f49e8[_0x3fd4('0x2f')]);_0x42ecd3[_0x3fd4('0x38')]=_['intersection'](_0x42ecd3[_0x3fd4('0x2e')],_0x42ecd3[_0x3fd4('0x2f')]);_0x2bc33f[_0x3fd4('0x32')]=_[_0x3fd4('0x31')](_0x42ecd3[_0x3fd4('0x2e')],qs[_0x3fd4('0x33')](_0x3f49e8['query']['fields']));_0x2bc33f[_0x3fd4('0x32')]=_0x2bc33f[_0x3fd4('0x32')]['length']?_0x2bc33f[_0x3fd4('0x32')]:_0x42ecd3[_0x3fd4('0x2e')];if(_0x3f49e8[_0x3fd4('0x2f')][_0x3fd4('0x3e')]){_0x2bc33f[_0x3fd4('0x3f')]=[{'all':!![]}];}_0x2bc33f=_[_0x3fd4('0x3b')]({},_0x2bc33f,_0x3f49e8[_0x3fd4('0x3d')]);return db[_0x3fd4('0x29')][_0x3fd4('0x43')](_0x2bc33f)[_0x3fd4('0x22')](handleEntityNotFound(_0x48baa1,null))[_0x3fd4('0x22')](respondWithResult(_0x48baa1,null))[_0x3fd4('0x44')](handleError(_0x48baa1,null));};exports[_0x3fd4('0x45')]=function(_0x29a8b7,_0x22eead){return db[_0x3fd4('0x29')][_0x3fd4('0x45')](_0x29a8b7[_0x3fd4('0x46')],{})['then'](respondWithResult(_0x22eead,0xc9))['catch'](handleError(_0x22eead,null));};exports[_0x3fd4('0x47')]=function(_0x5e6d50,_0x3a9588){return db[_0x3fd4('0x29')]['bulkCreate'](_0x5e6d50[_0x3fd4('0x46')],{'raw':![],'individualHooks':!![]})[_0x3fd4('0x22')](respondWithResult(_0x3a9588,0xc9))['catch'](handleError(_0x3a9588,null));};exports[_0x3fd4('0x21')]=function(_0x4b90d4,_0x2a01d5){if(_0x4b90d4['body']['id']){delete _0x4b90d4[_0x3fd4('0x46')]['id'];}return db['AnalyticFieldReport'][_0x3fd4('0x43')]({'where':{'id':_0x4b90d4[_0x3fd4('0x48')]['id']}})['then'](handleEntityNotFound(_0x2a01d5,null))[_0x3fd4('0x22')](saveUpdates(_0x4b90d4[_0x3fd4('0x46')],null))[_0x3fd4('0x22')](respondWithResult(_0x2a01d5,null))[_0x3fd4('0x44')](handleError(_0x2a01d5,null));};exports[_0x3fd4('0x23')]=function(_0x39f822,_0x4bb5f8){return db[_0x3fd4('0x29')][_0x3fd4('0x43')]({'where':{'id':_0x39f822['params']['id']}})['then'](handleEntityNotFound(_0x4bb5f8,null))[_0x3fd4('0x22')](removeEntity(_0x4bb5f8,null))[_0x3fd4('0x44')](handleError(_0x4bb5f8,null));};exports[_0x3fd4('0x49')]=function(_0x58ca8c,_0x281190){return db[_0x3fd4('0x29')][_0x3fd4('0x23')]({'where':{'id':_0x58ca8c[_0x3fd4('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x3fd4('0x22')](respondWithResult(_0x281190,0xcc))[_0x3fd4('0x44')](handleError(_0x281190,null));};exports[_0x3fd4('0x4a')]=function(_0x3ece83,_0x1ccd55,_0x2cf0f3){return db['AnalyticCustomReport'][_0x3fd4('0x4b')]({'where':{'id':_0x3ece83[_0x3fd4('0x48')]['id']}})[_0x3fd4('0x22')](handleEntityNotFound(_0x1ccd55,null))[_0x3fd4('0x22')](function(_0x12f6f4){if(_0x12f6f4){return db['sequelize'][_0x3fd4('0x4c')](function(_0x5053cf){return db['AnalyticFieldReport'][_0x3fd4('0x23')]({'where':{'CustomReportId':_0x3ece83[_0x3fd4('0x48')]['id']},'transaction':_0x5053cf})[_0x3fd4('0x22')](function(_0x4cbf2e){var _0x4c67de=_['map'](_0x3ece83[_0x3fd4('0x46')],function(_0x27d9df){delete _0x27d9df['id'];_0x27d9df['CustomReportId']=_0x3ece83['params']['id'];return _0x27d9df;});return db[_0x3fd4('0x29')][_0x3fd4('0x47')](_0x4c67de,{'transaction':_0x5053cf});});})['then'](function(){return db['AnalyticFieldReport'][_0x3fd4('0x40')]({'where':{'CustomReportId':_0x3ece83['params']['id']}});});}})[_0x3fd4('0x22')](respondWithResult(_0x1ccd55,null))[_0x3fd4('0x44')](handleError(_0x1ccd55,null));};
\ No newline at end of file
+var _0x626f=['destroy','then','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','bulkCreate','ids','addFields','AnalyticCustomReport','sequelize','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x626f,0x7f));var _0xf626=function(_0x294d78,_0x3fb7b6){_0x294d78=_0x294d78-0x0;var _0x179271=_0x626f[_0x294d78];return _0x179271;};'use strict';var pdf=require(_0xf626('0x0'));var emlformat=require(_0xf626('0x1'));var rimraf=require(_0xf626('0x2'));var zipdir=require(_0xf626('0x3'));var jsonpatch=require(_0xf626('0x4'));var rp=require(_0xf626('0x5'));var moment=require('moment');var BPromise=require(_0xf626('0x6'));var Mustache=require(_0xf626('0x7'));var util=require(_0xf626('0x8'));var path=require('path');var sox=require(_0xf626('0x9'));var csv=require(_0xf626('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf626('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf626('0xc'));var deskjs=require(_0xf626('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf626('0xe'));var Papa=require(_0xf626('0xf'));var Redis=require(_0xf626('0x10'));var authService=require(_0xf626('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf626('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf626('0x13'))(_0xf626('0x14'));var utils=require('../../config/utils');var config=require(_0xf626('0x15'));var licenseUtil=require(_0xf626('0x16'));var db=require(_0xf626('0x17'))['db'];function respondWithStatusCode(_0x1fb7b1,_0x104dba){_0x104dba=_0x104dba||0xcc;return function(_0x44b85f){if(_0x44b85f){return _0x1fb7b1[_0xf626('0x18')](_0x104dba);}return _0x1fb7b1[_0xf626('0x19')](_0x104dba)[_0xf626('0x1a')]();};}function respondWithResult(_0x3e4ac1,_0x2d4bd9){_0x2d4bd9=_0x2d4bd9||0xc8;return function(_0x303084){if(_0x303084){return _0x3e4ac1[_0xf626('0x19')](_0x2d4bd9)['json'](_0x303084);}};}function respondWithFilteredResult(_0x56638,_0x37f8c1){return function(_0x3134d5){if(_0x3134d5){var _0x439308=_0x3134d5[_0xf626('0x1b')],_0x2a942b=_0x37f8c1[_0xf626('0x1c')],_0x3e6280=_0x37f8c1['offset']+_0x37f8c1['limit'],_0x494b61;if(_0x3e6280>=_0x439308){_0x3e6280=_0x439308;_0x494b61=0xc8;}else{_0x494b61=0xce;}_0x56638[_0xf626('0x19')](_0x494b61);return _0x56638[_0xf626('0x1d')](_0xf626('0x1e'),_0x2a942b+'-'+_0x3e6280+'/'+_0x439308)['json'](_0x3134d5);}return null;};}function patchUpdates(_0x1543da){return function(_0x1680b3){try{jsonpatch[_0xf626('0x1f')](_0x1680b3,_0x1543da,!![]);}catch(_0x5224c2){return BPromise[_0xf626('0x20')](_0x5224c2);}return _0x1680b3[_0xf626('0x21')]();};}function saveUpdates(_0xa344a5,_0x822c71){return function(_0xabfbef){if(_0xabfbef){return _0xabfbef[_0xf626('0x22')](_0xa344a5)['then'](function(_0x5be5ad){return _0x5be5ad;});}return null;};}function removeEntity(_0x29ab23,_0xad5ae0){return function(_0x32b67e){if(_0x32b67e){return _0x32b67e[_0xf626('0x23')]()[_0xf626('0x24')](function(){_0x29ab23[_0xf626('0x19')](0xcc)[_0xf626('0x1a')]();});}};}function handleEntityNotFound(_0x118574,_0x1112e5){return function(_0x8c8ba6){if(!_0x8c8ba6){_0x118574[_0xf626('0x18')](0x194);}return _0x8c8ba6;};}function handleError(_0x52e830,_0x3510be){_0x3510be=_0x3510be||0x1f4;return function(_0x5de3d1){logger[_0xf626('0x25')](_0x5de3d1[_0xf626('0x26')]);if(_0x5de3d1['name']){delete _0x5de3d1[_0xf626('0x27')];}_0x52e830[_0xf626('0x19')](_0x3510be)[_0xf626('0x28')](_0x5de3d1);};}exports[_0xf626('0x29')]=function(_0x4a1d02,_0x324cf7){var _0x423bf4={},_0x4f04f3={},_0x548c24={'count':0x0,'rows':[]};var _0x2682a3=_[_0xf626('0x2a')](db[_0xf626('0x2b')][_0xf626('0x2c')],function(_0x2f13c8){return{'name':_0x2f13c8[_0xf626('0x2d')],'type':_0x2f13c8[_0xf626('0x2e')][_0xf626('0x2f')]};});_0x4f04f3[_0xf626('0x30')]=_[_0xf626('0x2a')](_0x2682a3,'name');_0x4f04f3[_0xf626('0x31')]=_[_0xf626('0x32')](_0x4a1d02[_0xf626('0x31')]);_0x4f04f3['filters']=_[_0xf626('0x33')](_0x4f04f3[_0xf626('0x30')],_0x4f04f3[_0xf626('0x31')]);_0x423bf4[_0xf626('0x34')]=_[_0xf626('0x33')](_0x4f04f3['model'],qs['fields'](_0x4a1d02[_0xf626('0x31')][_0xf626('0x35')]));_0x423bf4[_0xf626('0x34')]=_0x423bf4[_0xf626('0x34')][_0xf626('0x36')]?_0x423bf4[_0xf626('0x34')]:_0x4f04f3[_0xf626('0x30')];if(!_0x4a1d02['query'][_0xf626('0x37')]('nolimit')){_0x423bf4['limit']=qs[_0xf626('0x38')](_0x4a1d02[_0xf626('0x31')][_0xf626('0x38')]);_0x423bf4[_0xf626('0x1c')]=qs[_0xf626('0x1c')](_0x4a1d02[_0xf626('0x31')][_0xf626('0x1c')]);}_0x423bf4['order']=qs['sort'](_0x4a1d02[_0xf626('0x31')][_0xf626('0x39')]);_0x423bf4['where']=qs['filters'](_[_0xf626('0x3a')](_0x4a1d02[_0xf626('0x31')],_0x4f04f3[_0xf626('0x3b')]),_0x2682a3);if(_0x4a1d02[_0xf626('0x31')][_0xf626('0x3c')]){_0x423bf4[_0xf626('0x3d')]=_[_0xf626('0x3e')](_0x423bf4[_0xf626('0x3d')],{'$or':_[_0xf626('0x2a')](_0x2682a3,function(_0x536bf5){if(_0x536bf5[_0xf626('0x2e')]!==_0xf626('0x3f')){var _0x15e3bc={};_0x15e3bc[_0x536bf5[_0xf626('0x27')]]={'$like':'%'+_0x4a1d02['query'][_0xf626('0x3c')]+'%'};return _0x15e3bc;}})});}_0x423bf4=_[_0xf626('0x3e')]({},_0x423bf4,_0x4a1d02['options']);var _0xc80fcb={'where':_0x423bf4[_0xf626('0x3d')]};return db[_0xf626('0x2b')][_0xf626('0x1b')](_0xc80fcb)[_0xf626('0x24')](function(_0xec5383){_0x548c24[_0xf626('0x1b')]=_0xec5383;if(_0x4a1d02[_0xf626('0x31')][_0xf626('0x40')]){_0x423bf4[_0xf626('0x41')]=[{'all':!![]}];}return db[_0xf626('0x2b')][_0xf626('0x42')](_0x423bf4);})[_0xf626('0x24')](function(_0x348bc4){_0x548c24[_0xf626('0x43')]=_0x348bc4;return _0x548c24;})[_0xf626('0x24')](respondWithFilteredResult(_0x324cf7,_0x423bf4))[_0xf626('0x44')](handleError(_0x324cf7,null));};exports[_0xf626('0x45')]=function(_0x42e1ff,_0x553f89){var _0x4b209a={'raw':![],'where':{'id':_0x42e1ff[_0xf626('0x46')]['id']}},_0x55c520={};_0x55c520['model']=_['keys'](db[_0xf626('0x2b')][_0xf626('0x2c')]);_0x55c520['query']=_[_0xf626('0x32')](_0x42e1ff['query']);_0x55c520['filters']=_['intersection'](_0x55c520['model'],_0x55c520['query']);_0x4b209a[_0xf626('0x34')]=_[_0xf626('0x33')](_0x55c520[_0xf626('0x30')],qs[_0xf626('0x35')](_0x42e1ff[_0xf626('0x31')][_0xf626('0x35')]));_0x4b209a['attributes']=_0x4b209a[_0xf626('0x34')]['length']?_0x4b209a[_0xf626('0x34')]:_0x55c520[_0xf626('0x30')];if(_0x42e1ff[_0xf626('0x31')][_0xf626('0x40')]){_0x4b209a[_0xf626('0x41')]=[{'all':!![]}];}_0x4b209a=_['merge']({},_0x4b209a,_0x42e1ff[_0xf626('0x47')]);return db['AnalyticFieldReport'][_0xf626('0x48')](_0x4b209a)['then'](handleEntityNotFound(_0x553f89,null))['then'](respondWithResult(_0x553f89,null))[_0xf626('0x44')](handleError(_0x553f89,null));};exports[_0xf626('0x49')]=function(_0x35c38c,_0x276e1a){return db['AnalyticFieldReport'][_0xf626('0x49')](_0x35c38c[_0xf626('0x4a')],{})['then'](respondWithResult(_0x276e1a,0xc9))['catch'](handleError(_0x276e1a,null));};exports[_0xf626('0x4b')]=function(_0x810d18,_0x399915){return db['AnalyticFieldReport']['bulkCreate'](_0x810d18[_0xf626('0x4a')],{'raw':![],'individualHooks':!![]})[_0xf626('0x24')](respondWithResult(_0x399915,0xc9))[_0xf626('0x44')](handleError(_0x399915,null));};exports[_0xf626('0x22')]=function(_0x7b1aac,_0x574b80){if(_0x7b1aac[_0xf626('0x4a')]['id']){delete _0x7b1aac[_0xf626('0x4a')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x7b1aac[_0xf626('0x46')]['id']}})[_0xf626('0x24')](handleEntityNotFound(_0x574b80,null))[_0xf626('0x24')](saveUpdates(_0x7b1aac[_0xf626('0x4a')],null))[_0xf626('0x24')](respondWithResult(_0x574b80,null))[_0xf626('0x44')](handleError(_0x574b80,null));};exports[_0xf626('0x23')]=function(_0x340c39,_0x62c4c5){return db[_0xf626('0x2b')]['find']({'where':{'id':_0x340c39['params']['id']}})['then'](handleEntityNotFound(_0x62c4c5,null))['then'](removeEntity(_0x62c4c5,null))[_0xf626('0x44')](handleError(_0x62c4c5,null));};exports['bulkDestroy']=function(_0x4a3acc,_0x2f85f2){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4a3acc[_0xf626('0x31')][_0xf626('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xf626('0x24')](respondWithResult(_0x2f85f2,0xcc))[_0xf626('0x44')](handleError(_0x2f85f2,null));};exports[_0xf626('0x4d')]=function(_0xa73414,_0x159c1b,_0xb338c9){return db[_0xf626('0x4e')]['findOne']({'where':{'id':_0xa73414[_0xf626('0x46')]['id']}})['then'](handleEntityNotFound(_0x159c1b,null))[_0xf626('0x24')](function(_0x4e207a){if(_0x4e207a){return db[_0xf626('0x4f')]['transaction'](function(_0x1eb98c){return db[_0xf626('0x2b')][_0xf626('0x23')]({'where':{'CustomReportId':_0xa73414[_0xf626('0x46')]['id']},'transaction':_0x1eb98c})[_0xf626('0x24')](function(_0x44e9e3){var _0x2b6847=_['map'](_0xa73414[_0xf626('0x4a')],function(_0x470e89){delete _0x470e89['id'];_0x470e89[_0xf626('0x50')]=_0xa73414[_0xf626('0x46')]['id'];return _0x470e89;});return db[_0xf626('0x2b')][_0xf626('0x4b')](_0x2b6847,{'transaction':_0x1eb98c});});})[_0xf626('0x24')](function(){return db[_0xf626('0x2b')][_0xf626('0x42')]({'where':{'CustomReportId':_0xa73414[_0xf626('0x46')]['id']}});});}})['then'](respondWithResult(_0x159c1b,null))[_0xf626('0x44')](handleError(_0x159c1b,null));};
\ No newline at end of file