Built motion from commit b5996064.|2.6.21
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index 8b1d909..70b40f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf72b=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','catch','params','find','create','body','bulkCreate','bulkDestroy','ids','addFields','transaction','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x27a65e,_0x15e437){var _0x18355a=function(_0x4b88fd){while(--_0x4b88fd){_0x27a65e['push'](_0x27a65e['shift']());}};_0x18355a(++_0x15e437);}(_0xf72b,0x118));var _0xbf72=function(_0x4d5ed6,_0x2ec70b){_0x4d5ed6=_0x4d5ed6-0x0;var _0x34dc03=_0xf72b[_0x4d5ed6];return _0x34dc03;};'use strict';var emlformat=require(_0xbf72('0x0'));var rimraf=require(_0xbf72('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf72('0x2'));var rp=require('request-promise');var moment=require(_0xbf72('0x3'));var BPromise=require(_0xbf72('0x4'));var Mustache=require(_0xbf72('0x5'));var util=require(_0xbf72('0x6'));var path=require(_0xbf72('0x7'));var sox=require(_0xbf72('0x8'));var csv=require(_0xbf72('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf72('0xa'));var _=require('lodash');var squel=require(_0xbf72('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbf72('0xc'));var toCsv=require(_0xbf72('0x9'));var querystring=require(_0xbf72('0xd'));var Papa=require(_0xbf72('0xe'));var Redis=require(_0xbf72('0xf'));var authService=require(_0xbf72('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf72('0x11'))(_0xbf72('0x12'));var utils=require(_0xbf72('0x13'));var config=require(_0xbf72('0x14'));var licenseUtil=require(_0xbf72('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47c5c0,_0x3faff3){_0x3faff3=_0x3faff3||0xcc;return function(_0xb0fba2){if(_0xb0fba2){return _0x47c5c0[_0xbf72('0x16')](_0x3faff3);}return _0x47c5c0['status'](_0x3faff3)[_0xbf72('0x17')]();};}function respondWithResult(_0x278e74,_0x537411){_0x537411=_0x537411||0xc8;return function(_0x1b7897){if(_0x1b7897){return _0x278e74[_0xbf72('0x18')](_0x537411)[_0xbf72('0x19')](_0x1b7897);}};}function respondWithFilteredResult(_0x34cec5,_0x2dda54){return function(_0xe910){if(_0xe910){var _0x333ca2=_0xe910[_0xbf72('0x1a')],_0x285249=_0x2dda54['offset'],_0x1a9018=_0x2dda54[_0xbf72('0x1b')]+_0x2dda54[_0xbf72('0x1c')],_0x4e1dcf;if(_0x1a9018>=_0x333ca2){_0x1a9018=_0x333ca2;_0x4e1dcf=0xc8;}else{_0x4e1dcf=0xce;}_0x34cec5['status'](_0x4e1dcf);return _0x34cec5[_0xbf72('0x1d')](_0xbf72('0x1e'),_0x285249+'-'+_0x1a9018+'/'+_0x333ca2)[_0xbf72('0x19')](_0xe910);}return null;};}function patchUpdates(_0x4249e4){return function(_0x56555d){try{jsonpatch[_0xbf72('0x1f')](_0x56555d,_0x4249e4,!![]);}catch(_0x293004){return BPromise[_0xbf72('0x20')](_0x293004);}return _0x56555d[_0xbf72('0x21')]();};}function saveUpdates(_0x23d3fe,_0x48360a){return function(_0x402ca2){if(_0x402ca2){return _0x402ca2[_0xbf72('0x22')](_0x23d3fe)[_0xbf72('0x23')](function(_0x4c81b4){return _0x4c81b4;});}return null;};}function removeEntity(_0x75c238,_0x327752){return function(_0x584eee){if(_0x584eee){return _0x584eee[_0xbf72('0x24')]()['then'](function(){_0x75c238[_0xbf72('0x18')](0xcc)[_0xbf72('0x17')]();});}};}function handleEntityNotFound(_0xcf5567,_0x3d34ce){return function(_0x34a711){if(!_0x34a711){_0xcf5567[_0xbf72('0x16')](0x194);}return _0x34a711;};}function handleError(_0x436ad4,_0xf88dcf){_0xf88dcf=_0xf88dcf||0x1f4;return function(_0xb715b){logger[_0xbf72('0x25')](_0xb715b['stack']);if(_0xb715b[_0xbf72('0x26')]){delete _0xb715b[_0xbf72('0x26')];}_0x436ad4[_0xbf72('0x18')](_0xf88dcf)[_0xbf72('0x27')](_0xb715b);};}exports[_0xbf72('0x28')]=function(_0x1d1ac0,_0xd67ff7){var _0x3b6c56={},_0x48f0e5={},_0x494848={'count':0x0,'rows':[]};var _0x3f5f4b=_[_0xbf72('0x29')](db['AnalyticFieldReport']['rawAttributes'],function(_0x1bc991){return{'name':_0x1bc991[_0xbf72('0x2a')],'type':_0x1bc991['type'][_0xbf72('0x2b')]};});_0x48f0e5[_0xbf72('0x2c')]=_[_0xbf72('0x29')](_0x3f5f4b,'name');_0x48f0e5[_0xbf72('0x2d')]=_[_0xbf72('0x2e')](_0x1d1ac0['query']);_0x48f0e5[_0xbf72('0x2f')]=_[_0xbf72('0x30')](_0x48f0e5[_0xbf72('0x2c')],_0x48f0e5[_0xbf72('0x2d')]);_0x3b6c56['attributes']=_[_0xbf72('0x30')](_0x48f0e5[_0xbf72('0x2c')],qs[_0xbf72('0x31')](_0x1d1ac0[_0xbf72('0x2d')][_0xbf72('0x31')]));_0x3b6c56['attributes']=_0x3b6c56['attributes'][_0xbf72('0x32')]?_0x3b6c56[_0xbf72('0x33')]:_0x48f0e5[_0xbf72('0x2c')];if(!_0x1d1ac0[_0xbf72('0x2d')][_0xbf72('0x34')]('nolimit')){_0x3b6c56[_0xbf72('0x1c')]=qs[_0xbf72('0x1c')](_0x1d1ac0[_0xbf72('0x2d')]['limit']);_0x3b6c56[_0xbf72('0x1b')]=qs[_0xbf72('0x1b')](_0x1d1ac0[_0xbf72('0x2d')][_0xbf72('0x1b')]);}_0x3b6c56[_0xbf72('0x35')]=qs[_0xbf72('0x36')](_0x1d1ac0['query']['sort']);_0x3b6c56[_0xbf72('0x37')]=qs[_0xbf72('0x2f')](_[_0xbf72('0x38')](_0x1d1ac0[_0xbf72('0x2d')],_0x48f0e5[_0xbf72('0x2f')]),_0x3f5f4b);if(_0x1d1ac0[_0xbf72('0x2d')][_0xbf72('0x39')]){_0x3b6c56[_0xbf72('0x37')]=_[_0xbf72('0x3a')](_0x3b6c56[_0xbf72('0x37')],{'$or':_[_0xbf72('0x29')](_0x3f5f4b,function(_0xaf3564){if(_0xaf3564[_0xbf72('0x3b')]!==_0xbf72('0x3c')){var _0x2e6b78={};_0x2e6b78[_0xaf3564[_0xbf72('0x26')]]={'$like':'%'+_0x1d1ac0['query'][_0xbf72('0x39')]+'%'};return _0x2e6b78;}})});}_0x3b6c56=_[_0xbf72('0x3a')]({},_0x3b6c56,_0x1d1ac0[_0xbf72('0x3d')]);var _0x565d02={'where':_0x3b6c56[_0xbf72('0x37')]};return db[_0xbf72('0x3e')][_0xbf72('0x1a')](_0x565d02)[_0xbf72('0x23')](function(_0x2fb922){_0x494848[_0xbf72('0x1a')]=_0x2fb922;if(_0x1d1ac0['query'][_0xbf72('0x3f')]){_0x3b6c56[_0xbf72('0x40')]=[{'all':!![]}];}return db[_0xbf72('0x3e')][_0xbf72('0x41')](_0x3b6c56);})['then'](function(_0x4dcbb7){_0x494848['rows']=_0x4dcbb7;return _0x494848;})[_0xbf72('0x23')](respondWithFilteredResult(_0xd67ff7,_0x3b6c56))[_0xbf72('0x42')](handleError(_0xd67ff7,null));};exports['show']=function(_0x386d5b,_0x15c3be){var _0x4e6b05={'raw':![],'where':{'id':_0x386d5b[_0xbf72('0x43')]['id']}},_0x5ad68b={};_0x5ad68b['model']=_[_0xbf72('0x2e')](db[_0xbf72('0x3e')]['rawAttributes']);_0x5ad68b[_0xbf72('0x2d')]=_[_0xbf72('0x2e')](_0x386d5b[_0xbf72('0x2d')]);_0x5ad68b[_0xbf72('0x2f')]=_[_0xbf72('0x30')](_0x5ad68b['model'],_0x5ad68b[_0xbf72('0x2d')]);_0x4e6b05[_0xbf72('0x33')]=_[_0xbf72('0x30')](_0x5ad68b[_0xbf72('0x2c')],qs[_0xbf72('0x31')](_0x386d5b[_0xbf72('0x2d')]['fields']));_0x4e6b05[_0xbf72('0x33')]=_0x4e6b05[_0xbf72('0x33')]['length']?_0x4e6b05['attributes']:_0x5ad68b['model'];if(_0x386d5b[_0xbf72('0x2d')][_0xbf72('0x3f')]){_0x4e6b05[_0xbf72('0x40')]=[{'all':!![]}];}_0x4e6b05=_['merge']({},_0x4e6b05,_0x386d5b[_0xbf72('0x3d')]);return db[_0xbf72('0x3e')][_0xbf72('0x44')](_0x4e6b05)[_0xbf72('0x23')](handleEntityNotFound(_0x15c3be,null))[_0xbf72('0x23')](respondWithResult(_0x15c3be,null))[_0xbf72('0x42')](handleError(_0x15c3be,null));};exports[_0xbf72('0x45')]=function(_0x2caba9,_0x41f861){return db[_0xbf72('0x3e')]['create'](_0x2caba9[_0xbf72('0x46')],{})[_0xbf72('0x23')](respondWithResult(_0x41f861,0xc9))[_0xbf72('0x42')](handleError(_0x41f861,null));};exports['bulkCreate']=function(_0x2ade93,_0x4185e1){return db[_0xbf72('0x3e')][_0xbf72('0x47')](_0x2ade93[_0xbf72('0x46')],{'raw':![],'individualHooks':!![]})[_0xbf72('0x23')](respondWithResult(_0x4185e1,0xc9))['catch'](handleError(_0x4185e1,null));};exports[_0xbf72('0x22')]=function(_0x4d44f3,_0xd16a83){if(_0x4d44f3[_0xbf72('0x46')]['id']){delete _0x4d44f3[_0xbf72('0x46')]['id'];}return db['AnalyticFieldReport'][_0xbf72('0x44')]({'where':{'id':_0x4d44f3[_0xbf72('0x43')]['id']}})[_0xbf72('0x23')](handleEntityNotFound(_0xd16a83,null))[_0xbf72('0x23')](saveUpdates(_0x4d44f3['body'],null))[_0xbf72('0x23')](respondWithResult(_0xd16a83,null))['catch'](handleError(_0xd16a83,null));};exports[_0xbf72('0x24')]=function(_0x5cd735,_0xd1bb9f){return db['AnalyticFieldReport'][_0xbf72('0x44')]({'where':{'id':_0x5cd735[_0xbf72('0x43')]['id']}})[_0xbf72('0x23')](handleEntityNotFound(_0xd1bb9f,null))[_0xbf72('0x23')](removeEntity(_0xd1bb9f,null))[_0xbf72('0x42')](handleError(_0xd1bb9f,null));};exports[_0xbf72('0x48')]=function(_0x12d62f,_0x14fb43){return db['AnalyticFieldReport'][_0xbf72('0x24')]({'where':{'id':_0x12d62f[_0xbf72('0x2d')][_0xbf72('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xbf72('0x23')](respondWithResult(_0x14fb43,0xcc))[_0xbf72('0x42')](handleError(_0x14fb43,null));};exports[_0xbf72('0x4a')]=function(_0x4ead87,_0x5c8c37,_0x5e7112){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4ead87[_0xbf72('0x43')]['id']}})[_0xbf72('0x23')](handleEntityNotFound(_0x5c8c37,null))[_0xbf72('0x23')](function(_0x3d7625){if(_0x3d7625){return db['sequelize'][_0xbf72('0x4b')](function(_0x186321){return db[_0xbf72('0x3e')][_0xbf72('0x24')]({'where':{'CustomReportId':_0x4ead87[_0xbf72('0x43')]['id']},'transaction':_0x186321})[_0xbf72('0x23')](function(_0x4a4e73){var _0x1121d3=_[_0xbf72('0x29')](_0x4ead87[_0xbf72('0x46')],function(_0x5a1f3a){delete _0x5a1f3a['id'];_0x5a1f3a['CustomReportId']=_0x4ead87['params']['id'];return _0x5a1f3a;});return db[_0xbf72('0x3e')][_0xbf72('0x47')](_0x1121d3,{'transaction':_0x186321});});})['then'](function(){return db['AnalyticFieldReport'][_0xbf72('0x41')]({'where':{'CustomReportId':_0x4ead87['params']['id']}});});}})[_0xbf72('0x23')](respondWithResult(_0x5c8c37,null))[_0xbf72('0x42')](handleError(_0x5c8c37,null));};
\ No newline at end of file
+var _0x6b3d=['jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','type','key','query','keys','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','create','body','bulkCreate','update','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x8a09ac,_0x3b4333){var _0x3bf7c3=function(_0x11d3fb){while(--_0x11d3fb){_0x8a09ac['push'](_0x8a09ac['shift']());}};_0x3bf7c3(++_0x3b4333);}(_0x6b3d,0x1d5));var _0xd6b3=function(_0x16b63a,_0xece529){_0x16b63a=_0x16b63a-0x0;var _0x3c0d19=_0x6b3d[_0x16b63a];return _0x3c0d19;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6b3('0x0'));var zipdir=require(_0xd6b3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6b3('0x2'));var moment=require(_0xd6b3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xd6b3('0x4'));var sox=require(_0xd6b3('0x5'));var csv=require(_0xd6b3('0x6'));var ejs=require(_0xd6b3('0x7'));var fs=require('fs');var fs_extra=require(_0xd6b3('0x8'));var _=require(_0xd6b3('0x9'));var squel=require(_0xd6b3('0xa'));var crypto=require('crypto');var jsforce=require(_0xd6b3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd6b3('0x6'));var querystring=require('querystring');var Papa=require(_0xd6b3('0xc'));var Redis=require(_0xd6b3('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd6b3('0xe'));var as=require(_0xd6b3('0xf'));var hardwareService=require(_0xd6b3('0x10'));var logger=require(_0xd6b3('0x11'))(_0xd6b3('0x12'));var utils=require(_0xd6b3('0x13'));var config=require(_0xd6b3('0x14'));var licenseUtil=require(_0xd6b3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x313058,_0x44553f){_0x44553f=_0x44553f||0xcc;return function(_0x2061e8){if(_0x2061e8){return _0x313058[_0xd6b3('0x16')](_0x44553f);}return _0x313058[_0xd6b3('0x17')](_0x44553f)[_0xd6b3('0x18')]();};}function respondWithResult(_0x5ece82,_0xfb53f0){_0xfb53f0=_0xfb53f0||0xc8;return function(_0x2a5c28){if(_0x2a5c28){return _0x5ece82[_0xd6b3('0x17')](_0xfb53f0)[_0xd6b3('0x19')](_0x2a5c28);}};}function respondWithFilteredResult(_0x5f4f13,_0x3f0aac){return function(_0x3e9f1b){if(_0x3e9f1b){var _0xfd88a=typeof _0x3f0aac[_0xd6b3('0x1a')]===_0xd6b3('0x1b')&&typeof _0x3f0aac[_0xd6b3('0x1c')]===_0xd6b3('0x1b');var _0x524893=_0x3e9f1b[_0xd6b3('0x1d')];var _0x939fc1=_0xfd88a?0x0:_0x3f0aac['offset'];var _0x390b4f=_0xfd88a?_0x3e9f1b[_0xd6b3('0x1d')]:_0x3f0aac['offset']+_0x3f0aac['limit'];var _0xa6f71f;if(_0x390b4f>=_0x524893){_0x390b4f=_0x524893;_0xa6f71f=0xc8;}else{_0xa6f71f=0xce;}_0x5f4f13['status'](_0xa6f71f);return _0x5f4f13[_0xd6b3('0x1e')](_0xd6b3('0x1f'),_0x939fc1+'-'+_0x390b4f+'/'+_0x524893)[_0xd6b3('0x19')](_0x3e9f1b);}return null;};}function patchUpdates(_0x3c2047){return function(_0x3d43d2){try{jsonpatch['apply'](_0x3d43d2,_0x3c2047,!![]);}catch(_0x41437b){return BPromise[_0xd6b3('0x20')](_0x41437b);}return _0x3d43d2['save']();};}function saveUpdates(_0x287cf2,_0x12aa66){return function(_0x2b4358){if(_0x2b4358){return _0x2b4358['update'](_0x287cf2)['then'](function(_0x4d4182){return _0x4d4182;});}return null;};}function removeEntity(_0x464953,_0x37ad56){return function(_0x54c5aa){if(_0x54c5aa){return _0x54c5aa['destroy']()[_0xd6b3('0x21')](function(){_0x464953[_0xd6b3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b506c,_0x4a0d7e){return function(_0x3f338d){if(!_0x3f338d){_0x1b506c[_0xd6b3('0x16')](0x194);}return _0x3f338d;};}function handleError(_0x1626e5,_0x5df44f){_0x5df44f=_0x5df44f||0x1f4;return function(_0x2e328a){logger[_0xd6b3('0x22')](_0x2e328a['stack']);if(_0x2e328a[_0xd6b3('0x23')]){delete _0x2e328a[_0xd6b3('0x23')];}_0x1626e5[_0xd6b3('0x17')](_0x5df44f)[_0xd6b3('0x24')](_0x2e328a);};}exports[_0xd6b3('0x25')]=function(_0x345347,_0x3e2f26){var _0x1ee60c={},_0x477a99={},_0x29b0e4={'count':0x0,'rows':[]};var _0x19637c=_[_0xd6b3('0x26')](db[_0xd6b3('0x27')][_0xd6b3('0x28')],function(_0x4311c2){return{'name':_0x4311c2['fieldName'],'type':_0x4311c2[_0xd6b3('0x29')][_0xd6b3('0x2a')]};});_0x477a99['model']=_[_0xd6b3('0x26')](_0x19637c,'name');_0x477a99[_0xd6b3('0x2b')]=_[_0xd6b3('0x2c')](_0x345347[_0xd6b3('0x2b')]);_0x477a99['filters']=_[_0xd6b3('0x2d')](_0x477a99[_0xd6b3('0x2e')],_0x477a99[_0xd6b3('0x2b')]);_0x1ee60c[_0xd6b3('0x2f')]=_[_0xd6b3('0x2d')](_0x477a99[_0xd6b3('0x2e')],qs['fields'](_0x345347[_0xd6b3('0x2b')]['fields']));_0x1ee60c['attributes']=_0x1ee60c[_0xd6b3('0x2f')]['length']?_0x1ee60c['attributes']:_0x477a99['model'];if(!_0x345347['query'][_0xd6b3('0x30')](_0xd6b3('0x31'))){_0x1ee60c[_0xd6b3('0x1c')]=qs[_0xd6b3('0x1c')](_0x345347[_0xd6b3('0x2b')]['limit']);_0x1ee60c['offset']=qs[_0xd6b3('0x1a')](_0x345347[_0xd6b3('0x2b')]['offset']);}_0x1ee60c[_0xd6b3('0x32')]=qs['sort'](_0x345347[_0xd6b3('0x2b')][_0xd6b3('0x33')]);_0x1ee60c['where']=qs[_0xd6b3('0x34')](_['pick'](_0x345347['query'],_0x477a99[_0xd6b3('0x34')]),_0x19637c);if(_0x345347[_0xd6b3('0x2b')][_0xd6b3('0x35')]){_0x1ee60c[_0xd6b3('0x36')]=_[_0xd6b3('0x37')](_0x1ee60c[_0xd6b3('0x36')],{'$or':_['map'](_0x19637c,function(_0x3e8c01){if(_0x3e8c01['type']!==_0xd6b3('0x38')){var _0x55e677={};_0x55e677[_0x3e8c01['name']]={'$like':'%'+_0x345347[_0xd6b3('0x2b')][_0xd6b3('0x35')]+'%'};return _0x55e677;}})});}_0x1ee60c=_[_0xd6b3('0x37')]({},_0x1ee60c,_0x345347[_0xd6b3('0x39')]);var _0xb19cfd={'where':_0x1ee60c['where']};return db[_0xd6b3('0x27')]['count'](_0xb19cfd)[_0xd6b3('0x21')](function(_0x844e1d){_0x29b0e4['count']=_0x844e1d;if(_0x345347['query'][_0xd6b3('0x3a')]){_0x1ee60c[_0xd6b3('0x3b')]=[{'all':!![]}];}return db[_0xd6b3('0x27')][_0xd6b3('0x3c')](_0x1ee60c);})[_0xd6b3('0x21')](function(_0x7ceecc){_0x29b0e4[_0xd6b3('0x3d')]=_0x7ceecc;return _0x29b0e4;})[_0xd6b3('0x21')](respondWithFilteredResult(_0x3e2f26,_0x1ee60c))[_0xd6b3('0x3e')](handleError(_0x3e2f26,null));};exports[_0xd6b3('0x3f')]=function(_0x3e090a,_0x2144c9){var _0x4db27b={'raw':![],'where':{'id':_0x3e090a[_0xd6b3('0x40')]['id']}},_0xec106e={};_0xec106e[_0xd6b3('0x2e')]=_[_0xd6b3('0x2c')](db[_0xd6b3('0x27')][_0xd6b3('0x28')]);_0xec106e[_0xd6b3('0x2b')]=_['keys'](_0x3e090a[_0xd6b3('0x2b')]);_0xec106e[_0xd6b3('0x34')]=_['intersection'](_0xec106e[_0xd6b3('0x2e')],_0xec106e['query']);_0x4db27b[_0xd6b3('0x2f')]=_[_0xd6b3('0x2d')](_0xec106e[_0xd6b3('0x2e')],qs['fields'](_0x3e090a['query'][_0xd6b3('0x41')]));_0x4db27b['attributes']=_0x4db27b[_0xd6b3('0x2f')][_0xd6b3('0x42')]?_0x4db27b['attributes']:_0xec106e[_0xd6b3('0x2e')];if(_0x3e090a[_0xd6b3('0x2b')][_0xd6b3('0x3a')]){_0x4db27b[_0xd6b3('0x3b')]=[{'all':!![]}];}_0x4db27b=_[_0xd6b3('0x37')]({},_0x4db27b,_0x3e090a['options']);return db[_0xd6b3('0x27')][_0xd6b3('0x43')](_0x4db27b)['then'](handleEntityNotFound(_0x2144c9,null))[_0xd6b3('0x21')](respondWithResult(_0x2144c9,null))[_0xd6b3('0x3e')](handleError(_0x2144c9,null));};exports[_0xd6b3('0x44')]=function(_0x2081ea,_0x304525){return db[_0xd6b3('0x27')][_0xd6b3('0x44')](_0x2081ea[_0xd6b3('0x45')],{})[_0xd6b3('0x21')](respondWithResult(_0x304525,0xc9))[_0xd6b3('0x3e')](handleError(_0x304525,null));};exports['bulkCreate']=function(_0x591431,_0x1c41dd){return db[_0xd6b3('0x27')][_0xd6b3('0x46')](_0x591431[_0xd6b3('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1c41dd,0xc9))['catch'](handleError(_0x1c41dd,null));};exports[_0xd6b3('0x47')]=function(_0x98fc26,_0x2dd5d7){if(_0x98fc26[_0xd6b3('0x45')]['id']){delete _0x98fc26['body']['id'];}return db[_0xd6b3('0x27')][_0xd6b3('0x43')]({'where':{'id':_0x98fc26['params']['id']}})['then'](handleEntityNotFound(_0x2dd5d7,null))[_0xd6b3('0x21')](saveUpdates(_0x98fc26['body'],null))['then'](respondWithResult(_0x2dd5d7,null))['catch'](handleError(_0x2dd5d7,null));};exports['destroy']=function(_0x5171cf,_0x334d47){return db[_0xd6b3('0x27')][_0xd6b3('0x43')]({'where':{'id':_0x5171cf[_0xd6b3('0x40')]['id']}})[_0xd6b3('0x21')](handleEntityNotFound(_0x334d47,null))[_0xd6b3('0x21')](removeEntity(_0x334d47,null))[_0xd6b3('0x3e')](handleError(_0x334d47,null));};exports[_0xd6b3('0x48')]=function(_0x60c639,_0x1e12c6){return db[_0xd6b3('0x27')][_0xd6b3('0x49')]({'where':{'id':_0x60c639[_0xd6b3('0x2b')][_0xd6b3('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0xd6b3('0x21')](respondWithResult(_0x1e12c6,0xcc))[_0xd6b3('0x3e')](handleError(_0x1e12c6,null));};exports[_0xd6b3('0x4b')]=function(_0x3fd728,_0x5d0a13,_0x539250){return db[_0xd6b3('0x4c')]['findOne']({'where':{'id':_0x3fd728[_0xd6b3('0x40')]['id']}})[_0xd6b3('0x21')](handleEntityNotFound(_0x5d0a13,null))[_0xd6b3('0x21')](function(_0x14caa9){if(_0x14caa9){return db[_0xd6b3('0x4d')][_0xd6b3('0x4e')](function(_0x316fa2){return db[_0xd6b3('0x27')][_0xd6b3('0x49')]({'where':{'CustomReportId':_0x3fd728[_0xd6b3('0x40')]['id']},'transaction':_0x316fa2})['then'](function(_0x2d81a4){var _0x41dcf4=_['map'](_0x3fd728[_0xd6b3('0x45')],function(_0x12029c){delete _0x12029c['id'];_0x12029c[_0xd6b3('0x4f')]=_0x3fd728['params']['id'];return _0x12029c;});return db[_0xd6b3('0x27')][_0xd6b3('0x46')](_0x41dcf4,{'transaction':_0x316fa2});});})[_0xd6b3('0x21')](function(){return db[_0xd6b3('0x27')]['findAll']({'where':{'CustomReportId':_0x3fd728[_0xd6b3('0x40')]['id']}});});}})[_0xd6b3('0x21')](respondWithResult(_0x5d0a13,null))[_0xd6b3('0x3e')](handleError(_0x5d0a13,null));};
\ No newline at end of file