Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index dee2e93..5aec812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f36=['options','find','create','bulkCreate','body','params','bulkDestroy','ids','addFields','findOne','sequelize','transaction','findAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','AnalyticFieldReport','includeAll','include','catch','show','rawAttributes'];(function(_0xbbff02,_0x3e239b){var _0x31abbf=function(_0x5754ce){while(--_0x5754ce){_0xbbff02['push'](_0xbbff02['shift']());}};_0x31abbf(++_0x3e239b);}(_0x1f36,0x1ed));var _0x61f3=function(_0x28e28b,_0x340c0f){_0x28e28b=_0x28e28b-0x0;var _0x40a4e1=_0x1f36[_0x28e28b];return _0x40a4e1;};'use strict';var emlformat=require(_0x61f3('0x0'));var rimraf=require(_0x61f3('0x1'));var zipdir=require(_0x61f3('0x2'));var jsonpatch=require(_0x61f3('0x3'));var rp=require('request-promise');var moment=require(_0x61f3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61f3('0x5'));var util=require(_0x61f3('0x6'));var path=require(_0x61f3('0x7'));var sox=require(_0x61f3('0x8'));var csv=require(_0x61f3('0x9'));var ejs=require(_0x61f3('0xa'));var fs=require('fs');var fs_extra=require(_0x61f3('0xb'));var _=require('lodash');var squel=require(_0x61f3('0xc'));var crypto=require(_0x61f3('0xd'));var jsforce=require(_0x61f3('0xe'));var deskjs=require(_0x61f3('0xf'));var toCsv=require(_0x61f3('0x9'));var querystring=require(_0x61f3('0x10'));var Papa=require(_0x61f3('0x11'));var Redis=require('ioredis');var authService=require(_0x61f3('0x12'));var qs=require(_0x61f3('0x13'));var as=require(_0x61f3('0x14'));var hardwareService=require(_0x61f3('0x15'));var logger=require(_0x61f3('0x16'))('api');var utils=require(_0x61f3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x61f3('0x18'));var db=require(_0x61f3('0x19'))['db'];function respondWithStatusCode(_0x5c50a1,_0x2d70e0){_0x2d70e0=_0x2d70e0||0xcc;return function(_0x2eacb1){if(_0x2eacb1){return _0x5c50a1['sendStatus'](_0x2d70e0);}return _0x5c50a1[_0x61f3('0x1a')](_0x2d70e0)['end']();};}function respondWithResult(_0x42c8b4,_0x41a09b){_0x41a09b=_0x41a09b||0xc8;return function(_0x4d3130){if(_0x4d3130){return _0x42c8b4[_0x61f3('0x1a')](_0x41a09b)['json'](_0x4d3130);}};}function respondWithFilteredResult(_0x1b74c4,_0x222d54){return function(_0x2212c3){if(_0x2212c3){var _0x55c02e=typeof _0x222d54[_0x61f3('0x1b')]==='undefined'&&typeof _0x222d54[_0x61f3('0x1c')]===_0x61f3('0x1d');var _0xf55071=_0x2212c3[_0x61f3('0x1e')];var _0x1d6fde=_0x55c02e?0x0:_0x222d54[_0x61f3('0x1b')];var _0x45e9ac=_0x55c02e?_0x2212c3[_0x61f3('0x1e')]:_0x222d54[_0x61f3('0x1b')]+_0x222d54[_0x61f3('0x1c')];var _0xb61897;if(_0x45e9ac>=_0xf55071){_0x45e9ac=_0xf55071;_0xb61897=0xc8;}else{_0xb61897=0xce;}_0x1b74c4['status'](_0xb61897);return _0x1b74c4['set'](_0x61f3('0x1f'),_0x1d6fde+'-'+_0x45e9ac+'/'+_0xf55071)[_0x61f3('0x20')](_0x2212c3);}return null;};}function patchUpdates(_0x1b3d73){return function(_0x34ca5d){try{jsonpatch['apply'](_0x34ca5d,_0x1b3d73,!![]);}catch(_0x233514){return BPromise['reject'](_0x233514);}return _0x34ca5d[_0x61f3('0x21')]();};}function saveUpdates(_0x548765,_0x5cc484){return function(_0x3395e9){if(_0x3395e9){return _0x3395e9[_0x61f3('0x22')](_0x548765)[_0x61f3('0x23')](function(_0x114621){return _0x114621;});}return null;};}function removeEntity(_0x4cc0b4,_0xb96730){return function(_0x4b0e73){if(_0x4b0e73){return _0x4b0e73[_0x61f3('0x24')]()[_0x61f3('0x23')](function(){_0x4cc0b4[_0x61f3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1563b5,_0x2a1e32){return function(_0x27b13e){if(!_0x27b13e){_0x1563b5['sendStatus'](0x194);}return _0x27b13e;};}function handleError(_0x327cf9,_0x420b58){_0x420b58=_0x420b58||0x1f4;return function(_0x3ae86f){logger[_0x61f3('0x25')](_0x3ae86f[_0x61f3('0x26')]);if(_0x3ae86f[_0x61f3('0x27')]){delete _0x3ae86f['name'];}_0x327cf9['status'](_0x420b58)[_0x61f3('0x28')](_0x3ae86f);};}exports[_0x61f3('0x29')]=function(_0x2aa56,_0x1cb919){var _0x1d066a={},_0x129a27={},_0x2ce55c={'count':0x0,'rows':[]};var _0x7f0c52=_['map'](db['AnalyticFieldReport']['rawAttributes'],function(_0x297a44){return{'name':_0x297a44['fieldName'],'type':_0x297a44['type'][_0x61f3('0x2a')]};});_0x129a27['model']=_[_0x61f3('0x2b')](_0x7f0c52,'name');_0x129a27[_0x61f3('0x2c')]=_[_0x61f3('0x2d')](_0x2aa56[_0x61f3('0x2c')]);_0x129a27[_0x61f3('0x2e')]=_[_0x61f3('0x2f')](_0x129a27[_0x61f3('0x30')],_0x129a27['query']);_0x1d066a[_0x61f3('0x31')]=_[_0x61f3('0x2f')](_0x129a27[_0x61f3('0x30')],qs['fields'](_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x32')]));_0x1d066a[_0x61f3('0x31')]=_0x1d066a[_0x61f3('0x31')][_0x61f3('0x33')]?_0x1d066a[_0x61f3('0x31')]:_0x129a27['model'];if(!_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x34')](_0x61f3('0x35'))){_0x1d066a[_0x61f3('0x1c')]=qs[_0x61f3('0x1c')](_0x2aa56[_0x61f3('0x2c')]['limit']);_0x1d066a['offset']=qs[_0x61f3('0x1b')](_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x1b')]);}_0x1d066a[_0x61f3('0x36')]=qs['sort'](_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x37')]);_0x1d066a[_0x61f3('0x38')]=qs[_0x61f3('0x2e')](_['pick'](_0x2aa56[_0x61f3('0x2c')],_0x129a27['filters']),_0x7f0c52);if(_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x39')]){_0x1d066a['where']=_[_0x61f3('0x3a')](_0x1d066a[_0x61f3('0x38')],{'$or':_[_0x61f3('0x2b')](_0x7f0c52,function(_0x34ea53){if(_0x34ea53[_0x61f3('0x3b')]!==_0x61f3('0x3c')){var _0x31afa1={};_0x31afa1[_0x34ea53[_0x61f3('0x27')]]={'$like':'%'+_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x39')]+'%'};return _0x31afa1;}})});}_0x1d066a=_[_0x61f3('0x3a')]({},_0x1d066a,_0x2aa56['options']);var _0x49c79a={'where':_0x1d066a[_0x61f3('0x38')]};return db[_0x61f3('0x3d')][_0x61f3('0x1e')](_0x49c79a)[_0x61f3('0x23')](function(_0xd8c178){_0x2ce55c[_0x61f3('0x1e')]=_0xd8c178;if(_0x2aa56[_0x61f3('0x2c')][_0x61f3('0x3e')]){_0x1d066a[_0x61f3('0x3f')]=[{'all':!![]}];}return db[_0x61f3('0x3d')]['findAll'](_0x1d066a);})[_0x61f3('0x23')](function(_0x1197e8){_0x2ce55c['rows']=_0x1197e8;return _0x2ce55c;})['then'](respondWithFilteredResult(_0x1cb919,_0x1d066a))[_0x61f3('0x40')](handleError(_0x1cb919,null));};exports[_0x61f3('0x41')]=function(_0x4aeb7d,_0x3a6856){var _0x4010fd={'raw':![],'where':{'id':_0x4aeb7d['params']['id']}},_0x1c09a5={};_0x1c09a5['model']=_[_0x61f3('0x2d')](db[_0x61f3('0x3d')][_0x61f3('0x42')]);_0x1c09a5[_0x61f3('0x2c')]=_[_0x61f3('0x2d')](_0x4aeb7d[_0x61f3('0x2c')]);_0x1c09a5[_0x61f3('0x2e')]=_[_0x61f3('0x2f')](_0x1c09a5[_0x61f3('0x30')],_0x1c09a5[_0x61f3('0x2c')]);_0x4010fd[_0x61f3('0x31')]=_[_0x61f3('0x2f')](_0x1c09a5[_0x61f3('0x30')],qs['fields'](_0x4aeb7d[_0x61f3('0x2c')][_0x61f3('0x32')]));_0x4010fd[_0x61f3('0x31')]=_0x4010fd[_0x61f3('0x31')][_0x61f3('0x33')]?_0x4010fd[_0x61f3('0x31')]:_0x1c09a5[_0x61f3('0x30')];if(_0x4aeb7d[_0x61f3('0x2c')]['includeAll']){_0x4010fd[_0x61f3('0x3f')]=[{'all':!![]}];}_0x4010fd=_[_0x61f3('0x3a')]({},_0x4010fd,_0x4aeb7d[_0x61f3('0x43')]);return db['AnalyticFieldReport'][_0x61f3('0x44')](_0x4010fd)['then'](handleEntityNotFound(_0x3a6856,null))[_0x61f3('0x23')](respondWithResult(_0x3a6856,null))[_0x61f3('0x40')](handleError(_0x3a6856,null));};exports[_0x61f3('0x45')]=function(_0x6488d7,_0xb41ab8){return db[_0x61f3('0x3d')][_0x61f3('0x45')](_0x6488d7['body'],{})[_0x61f3('0x23')](respondWithResult(_0xb41ab8,0xc9))['catch'](handleError(_0xb41ab8,null));};exports[_0x61f3('0x46')]=function(_0x27767e,_0x3c182d){return db[_0x61f3('0x3d')][_0x61f3('0x46')](_0x27767e['body'],{'raw':![],'individualHooks':!![]})[_0x61f3('0x23')](respondWithResult(_0x3c182d,0xc9))[_0x61f3('0x40')](handleError(_0x3c182d,null));};exports['update']=function(_0x55bce2,_0x1c4563){if(_0x55bce2['body']['id']){delete _0x55bce2[_0x61f3('0x47')]['id'];}return db['AnalyticFieldReport'][_0x61f3('0x44')]({'where':{'id':_0x55bce2[_0x61f3('0x48')]['id']}})[_0x61f3('0x23')](handleEntityNotFound(_0x1c4563,null))['then'](saveUpdates(_0x55bce2[_0x61f3('0x47')],null))[_0x61f3('0x23')](respondWithResult(_0x1c4563,null))[_0x61f3('0x40')](handleError(_0x1c4563,null));};exports['destroy']=function(_0x593a7b,_0x4d1576){return db[_0x61f3('0x3d')][_0x61f3('0x44')]({'where':{'id':_0x593a7b[_0x61f3('0x48')]['id']}})[_0x61f3('0x23')](handleEntityNotFound(_0x4d1576,null))[_0x61f3('0x23')](removeEntity(_0x4d1576,null))[_0x61f3('0x40')](handleError(_0x4d1576,null));};exports[_0x61f3('0x49')]=function(_0x1ac3a5,_0x12e2d1){return db[_0x61f3('0x3d')]['destroy']({'where':{'id':_0x1ac3a5[_0x61f3('0x2c')][_0x61f3('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x61f3('0x23')](respondWithResult(_0x12e2d1,0xcc))[_0x61f3('0x40')](handleError(_0x12e2d1,null));};exports[_0x61f3('0x4b')]=function(_0x2e54df,_0x54fd70,_0x52708e){return db['AnalyticCustomReport'][_0x61f3('0x4c')]({'where':{'id':_0x2e54df[_0x61f3('0x48')]['id']}})[_0x61f3('0x23')](handleEntityNotFound(_0x54fd70,null))[_0x61f3('0x23')](function(_0x5e7c1c){if(_0x5e7c1c){return db[_0x61f3('0x4d')][_0x61f3('0x4e')](function(_0x1890e4){return db[_0x61f3('0x3d')][_0x61f3('0x24')]({'where':{'CustomReportId':_0x2e54df[_0x61f3('0x48')]['id']},'transaction':_0x1890e4})[_0x61f3('0x23')](function(_0x2c970f){var _0x270815=_[_0x61f3('0x2b')](_0x2e54df[_0x61f3('0x47')],function(_0x2bf46d){delete _0x2bf46d['id'];_0x2bf46d['CustomReportId']=_0x2e54df[_0x61f3('0x48')]['id'];return _0x2bf46d;});return db[_0x61f3('0x3d')][_0x61f3('0x46')](_0x270815,{'transaction':_0x1890e4});});})[_0x61f3('0x23')](function(){return db[_0x61f3('0x3d')][_0x61f3('0x4f')]({'where':{'CustomReportId':_0x2e54df[_0x61f3('0x48')]['id']}});});}})[_0x61f3('0x23')](respondWithResult(_0x54fd70,null))[_0x61f3('0x40')](handleError(_0x54fd70,null));};
\ No newline at end of file
+var _0x2fa7=['bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','bulkCreate','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','rimraf','zip-dir','request-promise','moment'];(function(_0x169282,_0x434986){var _0xceaf0a=function(_0x845141){while(--_0x845141){_0x169282['push'](_0x169282['shift']());}};_0xceaf0a(++_0x434986);}(_0x2fa7,0x1aa));var _0x72fa=function(_0x58085f,_0x51f950){_0x58085f=_0x58085f-0x0;var _0x4ec671=_0x2fa7[_0x58085f];return _0x4ec671;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72fa('0x0'));var zipdir=require(_0x72fa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72fa('0x2'));var moment=require(_0x72fa('0x3'));var BPromise=require(_0x72fa('0x4'));var Mustache=require(_0x72fa('0x5'));var util=require('util');var path=require(_0x72fa('0x6'));var sox=require('sox');var csv=require(_0x72fa('0x7'));var ejs=require(_0x72fa('0x8'));var fs=require('fs');var fs_extra=require(_0x72fa('0x9'));var _=require(_0x72fa('0xa'));var squel=require(_0x72fa('0xb'));var crypto=require('crypto');var jsforce=require(_0x72fa('0xc'));var deskjs=require(_0x72fa('0xd'));var toCsv=require(_0x72fa('0x7'));var querystring=require('querystring');var Papa=require(_0x72fa('0xe'));var Redis=require(_0x72fa('0xf'));var authService=require(_0x72fa('0x10'));var qs=require(_0x72fa('0x11'));var as=require(_0x72fa('0x12'));var hardwareService=require(_0x72fa('0x13'));var logger=require(_0x72fa('0x14'))(_0x72fa('0x15'));var utils=require('../../config/utils');var config=require(_0x72fa('0x16'));var licenseUtil=require(_0x72fa('0x17'));var db=require(_0x72fa('0x18'))['db'];function respondWithStatusCode(_0x5a3797,_0x57af88){_0x57af88=_0x57af88||0xcc;return function(_0x440e9a){if(_0x440e9a){return _0x5a3797['sendStatus'](_0x57af88);}return _0x5a3797[_0x72fa('0x19')](_0x57af88)[_0x72fa('0x1a')]();};}function respondWithResult(_0x4455ce,_0xa2cd02){_0xa2cd02=_0xa2cd02||0xc8;return function(_0x4466bd){if(_0x4466bd){return _0x4455ce[_0x72fa('0x19')](_0xa2cd02)[_0x72fa('0x1b')](_0x4466bd);}};}function respondWithFilteredResult(_0x112c1d,_0x20724a){return function(_0x352191){if(_0x352191){var _0x20ac7f=typeof _0x20724a[_0x72fa('0x1c')]===_0x72fa('0x1d')&&typeof _0x20724a[_0x72fa('0x1e')]==='undefined';var _0x390472=_0x352191['count'];var _0x252a20=_0x20ac7f?0x0:_0x20724a[_0x72fa('0x1c')];var _0x16625e=_0x20ac7f?_0x352191[_0x72fa('0x1f')]:_0x20724a[_0x72fa('0x1c')]+_0x20724a[_0x72fa('0x1e')];var _0x1ace33;if(_0x16625e>=_0x390472){_0x16625e=_0x390472;_0x1ace33=0xc8;}else{_0x1ace33=0xce;}_0x112c1d['status'](_0x1ace33);return _0x112c1d[_0x72fa('0x20')](_0x72fa('0x21'),_0x252a20+'-'+_0x16625e+'/'+_0x390472)[_0x72fa('0x1b')](_0x352191);}return null;};}function patchUpdates(_0x16534e){return function(_0x4999c7){try{jsonpatch[_0x72fa('0x22')](_0x4999c7,_0x16534e,!![]);}catch(_0x56613e){return BPromise[_0x72fa('0x23')](_0x56613e);}return _0x4999c7[_0x72fa('0x24')]();};}function saveUpdates(_0x5d0485,_0x3d1ed0){return function(_0xea9818){if(_0xea9818){return _0xea9818[_0x72fa('0x25')](_0x5d0485)[_0x72fa('0x26')](function(_0x341e08){return _0x341e08;});}return null;};}function removeEntity(_0x13542f,_0x20b44f){return function(_0x1cd657){if(_0x1cd657){return _0x1cd657['destroy']()[_0x72fa('0x26')](function(){_0x13542f['status'](0xcc)[_0x72fa('0x1a')]();});}};}function handleEntityNotFound(_0x4ec447,_0x32f22c){return function(_0x1c8e59){if(!_0x1c8e59){_0x4ec447[_0x72fa('0x27')](0x194);}return _0x1c8e59;};}function handleError(_0x54b359,_0x949fcd){_0x949fcd=_0x949fcd||0x1f4;return function(_0x51746f){logger[_0x72fa('0x28')](_0x51746f[_0x72fa('0x29')]);if(_0x51746f[_0x72fa('0x2a')]){delete _0x51746f[_0x72fa('0x2a')];}_0x54b359[_0x72fa('0x19')](_0x949fcd)['send'](_0x51746f);};}exports[_0x72fa('0x2b')]=function(_0x227fa1,_0x205b5b){var _0x14a01f={},_0x1abee4={},_0x593620={'count':0x0,'rows':[]};var _0x4bc57f=_[_0x72fa('0x2c')](db[_0x72fa('0x2d')][_0x72fa('0x2e')],function(_0x5e1e49){return{'name':_0x5e1e49[_0x72fa('0x2f')],'type':_0x5e1e49['type'][_0x72fa('0x30')]};});_0x1abee4[_0x72fa('0x31')]=_[_0x72fa('0x2c')](_0x4bc57f,'name');_0x1abee4[_0x72fa('0x32')]=_['keys'](_0x227fa1[_0x72fa('0x32')]);_0x1abee4[_0x72fa('0x33')]=_[_0x72fa('0x34')](_0x1abee4[_0x72fa('0x31')],_0x1abee4[_0x72fa('0x32')]);_0x14a01f['attributes']=_[_0x72fa('0x34')](_0x1abee4[_0x72fa('0x31')],qs[_0x72fa('0x35')](_0x227fa1[_0x72fa('0x32')][_0x72fa('0x35')]));_0x14a01f[_0x72fa('0x36')]=_0x14a01f['attributes']['length']?_0x14a01f[_0x72fa('0x36')]:_0x1abee4[_0x72fa('0x31')];if(!_0x227fa1['query'][_0x72fa('0x37')]('nolimit')){_0x14a01f['limit']=qs['limit'](_0x227fa1[_0x72fa('0x32')][_0x72fa('0x1e')]);_0x14a01f[_0x72fa('0x1c')]=qs['offset'](_0x227fa1[_0x72fa('0x32')][_0x72fa('0x1c')]);}_0x14a01f[_0x72fa('0x38')]=qs['sort'](_0x227fa1[_0x72fa('0x32')][_0x72fa('0x39')]);_0x14a01f[_0x72fa('0x3a')]=qs[_0x72fa('0x33')](_[_0x72fa('0x3b')](_0x227fa1['query'],_0x1abee4['filters']),_0x4bc57f);if(_0x227fa1['query'][_0x72fa('0x3c')]){_0x14a01f[_0x72fa('0x3a')]=_[_0x72fa('0x3d')](_0x14a01f[_0x72fa('0x3a')],{'$or':_[_0x72fa('0x2c')](_0x4bc57f,function(_0x3fd15c){if(_0x3fd15c[_0x72fa('0x3e')]!=='VIRTUAL'){var _0x6b1f5c={};_0x6b1f5c[_0x3fd15c[_0x72fa('0x2a')]]={'$like':'%'+_0x227fa1[_0x72fa('0x32')][_0x72fa('0x3c')]+'%'};return _0x6b1f5c;}})});}_0x14a01f=_['merge']({},_0x14a01f,_0x227fa1['options']);var _0x535e38={'where':_0x14a01f[_0x72fa('0x3a')]};return db[_0x72fa('0x2d')][_0x72fa('0x1f')](_0x535e38)[_0x72fa('0x26')](function(_0x305052){_0x593620[_0x72fa('0x1f')]=_0x305052;if(_0x227fa1[_0x72fa('0x32')][_0x72fa('0x3f')]){_0x14a01f[_0x72fa('0x40')]=[{'all':!![]}];}return db[_0x72fa('0x2d')][_0x72fa('0x41')](_0x14a01f);})[_0x72fa('0x26')](function(_0x2f84aa){_0x593620[_0x72fa('0x42')]=_0x2f84aa;return _0x593620;})[_0x72fa('0x26')](respondWithFilteredResult(_0x205b5b,_0x14a01f))[_0x72fa('0x43')](handleError(_0x205b5b,null));};exports[_0x72fa('0x44')]=function(_0x2bcdd,_0x816b92){var _0x28fe90={'raw':![],'where':{'id':_0x2bcdd[_0x72fa('0x45')]['id']}},_0x559f5a={};_0x559f5a[_0x72fa('0x31')]=_[_0x72fa('0x46')](db[_0x72fa('0x2d')][_0x72fa('0x2e')]);_0x559f5a[_0x72fa('0x32')]=_['keys'](_0x2bcdd[_0x72fa('0x32')]);_0x559f5a[_0x72fa('0x33')]=_[_0x72fa('0x34')](_0x559f5a[_0x72fa('0x31')],_0x559f5a[_0x72fa('0x32')]);_0x28fe90[_0x72fa('0x36')]=_[_0x72fa('0x34')](_0x559f5a[_0x72fa('0x31')],qs['fields'](_0x2bcdd['query'][_0x72fa('0x35')]));_0x28fe90['attributes']=_0x28fe90[_0x72fa('0x36')][_0x72fa('0x47')]?_0x28fe90[_0x72fa('0x36')]:_0x559f5a['model'];if(_0x2bcdd[_0x72fa('0x32')][_0x72fa('0x3f')]){_0x28fe90[_0x72fa('0x40')]=[{'all':!![]}];}_0x28fe90=_['merge']({},_0x28fe90,_0x2bcdd[_0x72fa('0x48')]);return db[_0x72fa('0x2d')][_0x72fa('0x49')](_0x28fe90)[_0x72fa('0x26')](handleEntityNotFound(_0x816b92,null))[_0x72fa('0x26')](respondWithResult(_0x816b92,null))['catch'](handleError(_0x816b92,null));};exports['create']=function(_0x3916b3,_0x5aa661){return db[_0x72fa('0x2d')][_0x72fa('0x4a')](_0x3916b3[_0x72fa('0x4b')],{})['then'](respondWithResult(_0x5aa661,0xc9))[_0x72fa('0x43')](handleError(_0x5aa661,null));};exports[_0x72fa('0x4c')]=function(_0x1e91f1,_0x180c88){return db[_0x72fa('0x2d')][_0x72fa('0x4c')](_0x1e91f1[_0x72fa('0x4b')],{'raw':![],'individualHooks':!![]})[_0x72fa('0x26')](respondWithResult(_0x180c88,0xc9))[_0x72fa('0x43')](handleError(_0x180c88,null));};exports[_0x72fa('0x25')]=function(_0x3c0f86,_0x3dc36c){if(_0x3c0f86[_0x72fa('0x4b')]['id']){delete _0x3c0f86['body']['id'];}return db[_0x72fa('0x2d')][_0x72fa('0x49')]({'where':{'id':_0x3c0f86['params']['id']}})[_0x72fa('0x26')](handleEntityNotFound(_0x3dc36c,null))[_0x72fa('0x26')](saveUpdates(_0x3c0f86['body'],null))[_0x72fa('0x26')](respondWithResult(_0x3dc36c,null))[_0x72fa('0x43')](handleError(_0x3dc36c,null));};exports[_0x72fa('0x4d')]=function(_0x425d4d,_0x11f8ab){return db[_0x72fa('0x2d')]['find']({'where':{'id':_0x425d4d[_0x72fa('0x45')]['id']}})[_0x72fa('0x26')](handleEntityNotFound(_0x11f8ab,null))[_0x72fa('0x26')](removeEntity(_0x11f8ab,null))[_0x72fa('0x43')](handleError(_0x11f8ab,null));};exports[_0x72fa('0x4e')]=function(_0x2e5e4c,_0x1dcffe){return db[_0x72fa('0x2d')][_0x72fa('0x4d')]({'where':{'id':_0x2e5e4c['query'][_0x72fa('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x72fa('0x26')](respondWithResult(_0x1dcffe,0xcc))[_0x72fa('0x43')](handleError(_0x1dcffe,null));};exports[_0x72fa('0x50')]=function(_0x306112,_0x48e5e7,_0xe03305){return db[_0x72fa('0x51')][_0x72fa('0x52')]({'where':{'id':_0x306112['params']['id']}})[_0x72fa('0x26')](handleEntityNotFound(_0x48e5e7,null))[_0x72fa('0x26')](function(_0x1b8cf3){if(_0x1b8cf3){return db[_0x72fa('0x53')][_0x72fa('0x54')](function(_0x4a4120){return db[_0x72fa('0x2d')][_0x72fa('0x4d')]({'where':{'CustomReportId':_0x306112[_0x72fa('0x45')]['id']},'transaction':_0x4a4120})[_0x72fa('0x26')](function(_0x7ec0af){var _0x1ff8f3=_[_0x72fa('0x2c')](_0x306112[_0x72fa('0x4b')],function(_0x1c823c){delete _0x1c823c['id'];_0x1c823c[_0x72fa('0x55')]=_0x306112[_0x72fa('0x45')]['id'];return _0x1c823c;});return db[_0x72fa('0x2d')][_0x72fa('0x4c')](_0x1ff8f3,{'transaction':_0x4a4120});});})[_0x72fa('0x26')](function(){return db[_0x72fa('0x2d')][_0x72fa('0x41')]({'where':{'CustomReportId':_0x306112['params']['id']}});});}})[_0x72fa('0x26')](respondWithResult(_0x48e5e7,null))[_0x72fa('0x43')](handleError(_0x48e5e7,null));};
\ No newline at end of file