Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index 5d13534..671c720 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26ca=['merge','options','includeAll','include','findAll','catch','show','length','find','create','body','bulkCreate','update','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','stack','name','map','AnalyticFieldReport','fieldName','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL'];(function(_0x26d467,_0x864bb1){var _0x5b86dd=function(_0x393f83){while(--_0x393f83){_0x26d467['push'](_0x26d467['shift']());}};_0x5b86dd(++_0x864bb1);}(_0x26ca,0x161));var _0xa26c=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x26ca[_0x565ed7];return _0x183ad7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa26c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa26c('0x1'));var rp=require(_0xa26c('0x2'));var moment=require(_0xa26c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa26c('0x4'));var util=require(_0xa26c('0x5'));var path=require(_0xa26c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa26c('0x7'));var fs=require('fs');var fs_extra=require(_0xa26c('0x8'));var _=require(_0xa26c('0x9'));var squel=require(_0xa26c('0xa'));var crypto=require(_0xa26c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa26c('0xc'));var toCsv=require(_0xa26c('0xd'));var querystring=require(_0xa26c('0xe'));var Papa=require(_0xa26c('0xf'));var Redis=require(_0xa26c('0x10'));var authService=require(_0xa26c('0x11'));var qs=require(_0xa26c('0x12'));var as=require(_0xa26c('0x13'));var hardwareService=require(_0xa26c('0x14'));var logger=require(_0xa26c('0x15'))(_0xa26c('0x16'));var utils=require(_0xa26c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa26c('0x18'));var db=require(_0xa26c('0x19'))['db'];function respondWithStatusCode(_0x19bab9,_0xf2f526){_0xf2f526=_0xf2f526||0xcc;return function(_0x37e4b3){if(_0x37e4b3){return _0x19bab9[_0xa26c('0x1a')](_0xf2f526);}return _0x19bab9[_0xa26c('0x1b')](_0xf2f526)[_0xa26c('0x1c')]();};}function respondWithResult(_0x15d2fa,_0x3bb93e){_0x3bb93e=_0x3bb93e||0xc8;return function(_0x1e446b){if(_0x1e446b){return _0x15d2fa[_0xa26c('0x1b')](_0x3bb93e)[_0xa26c('0x1d')](_0x1e446b);}};}function respondWithFilteredResult(_0x4cb467,_0x14979b){return function(_0x55c17b){if(_0x55c17b){var _0x2727d0=typeof _0x14979b['offset']==='undefined'&&typeof _0x14979b['limit']===_0xa26c('0x1e');var _0x409795=_0x55c17b[_0xa26c('0x1f')];var _0x1ff400=_0x2727d0?0x0:_0x14979b[_0xa26c('0x20')];var _0x4a7135=_0x2727d0?_0x55c17b[_0xa26c('0x1f')]:_0x14979b[_0xa26c('0x20')]+_0x14979b[_0xa26c('0x21')];var _0x16d5de;if(_0x4a7135>=_0x409795){_0x4a7135=_0x409795;_0x16d5de=0xc8;}else{_0x16d5de=0xce;}_0x4cb467[_0xa26c('0x1b')](_0x16d5de);return _0x4cb467[_0xa26c('0x22')](_0xa26c('0x23'),_0x1ff400+'-'+_0x4a7135+'/'+_0x409795)['json'](_0x55c17b);}return null;};}function patchUpdates(_0x3a1c09){return function(_0x12f6f1){try{jsonpatch[_0xa26c('0x24')](_0x12f6f1,_0x3a1c09,!![]);}catch(_0xbf9778){return BPromise['reject'](_0xbf9778);}return _0x12f6f1[_0xa26c('0x25')]();};}function saveUpdates(_0x50c4bf,_0x3ebbb1){return function(_0x530732){if(_0x530732){return _0x530732['update'](_0x50c4bf)[_0xa26c('0x26')](function(_0x432934){return _0x432934;});}return null;};}function removeEntity(_0x350447,_0xaaaf93){return function(_0x3ca203){if(_0x3ca203){return _0x3ca203[_0xa26c('0x27')]()['then'](function(){_0x350447[_0xa26c('0x1b')](0xcc)[_0xa26c('0x1c')]();});}};}function handleEntityNotFound(_0x5624db,_0x1fd085){return function(_0x42b5c6){if(!_0x42b5c6){_0x5624db[_0xa26c('0x1a')](0x194);}return _0x42b5c6;};}function handleError(_0x34621f,_0x166a00){_0x166a00=_0x166a00||0x1f4;return function(_0x222dad){logger['error'](_0x222dad[_0xa26c('0x28')]);if(_0x222dad[_0xa26c('0x29')]){delete _0x222dad['name'];}_0x34621f[_0xa26c('0x1b')](_0x166a00)['send'](_0x222dad);};}exports['index']=function(_0x510eec,_0x5a0d2a){var _0x40e89b={},_0x4d7672={},_0x26771e={'count':0x0,'rows':[]};var _0x78b37f=_[_0xa26c('0x2a')](db[_0xa26c('0x2b')]['rawAttributes'],function(_0x3fd9c0){return{'name':_0x3fd9c0[_0xa26c('0x2c')],'type':_0x3fd9c0['type'][_0xa26c('0x2d')]};});_0x4d7672['model']=_[_0xa26c('0x2a')](_0x78b37f,_0xa26c('0x29'));_0x4d7672['query']=_[_0xa26c('0x2e')](_0x510eec[_0xa26c('0x2f')]);_0x4d7672[_0xa26c('0x30')]=_[_0xa26c('0x31')](_0x4d7672[_0xa26c('0x32')],_0x4d7672[_0xa26c('0x2f')]);_0x40e89b[_0xa26c('0x33')]=_['intersection'](_0x4d7672['model'],qs[_0xa26c('0x34')](_0x510eec[_0xa26c('0x2f')]['fields']));_0x40e89b[_0xa26c('0x33')]=_0x40e89b['attributes']['length']?_0x40e89b[_0xa26c('0x33')]:_0x4d7672[_0xa26c('0x32')];if(!_0x510eec[_0xa26c('0x2f')][_0xa26c('0x35')](_0xa26c('0x36'))){_0x40e89b['limit']=qs[_0xa26c('0x21')](_0x510eec[_0xa26c('0x2f')]['limit']);_0x40e89b['offset']=qs['offset'](_0x510eec['query'][_0xa26c('0x20')]);}_0x40e89b[_0xa26c('0x37')]=qs['sort'](_0x510eec[_0xa26c('0x2f')][_0xa26c('0x38')]);_0x40e89b['where']=qs[_0xa26c('0x30')](_[_0xa26c('0x39')](_0x510eec['query'],_0x4d7672[_0xa26c('0x30')]),_0x78b37f);if(_0x510eec[_0xa26c('0x2f')][_0xa26c('0x3a')]){_0x40e89b[_0xa26c('0x3b')]=_['merge'](_0x40e89b[_0xa26c('0x3b')],{'$or':_[_0xa26c('0x2a')](_0x78b37f,function(_0x5908a4){if(_0x5908a4[_0xa26c('0x3c')]!==_0xa26c('0x3d')){var _0xab28c={};_0xab28c[_0x5908a4[_0xa26c('0x29')]]={'$like':'%'+_0x510eec[_0xa26c('0x2f')]['filter']+'%'};return _0xab28c;}})});}_0x40e89b=_[_0xa26c('0x3e')]({},_0x40e89b,_0x510eec[_0xa26c('0x3f')]);var _0x49c73e={'where':_0x40e89b[_0xa26c('0x3b')]};return db[_0xa26c('0x2b')][_0xa26c('0x1f')](_0x49c73e)[_0xa26c('0x26')](function(_0x5c7ff3){_0x26771e[_0xa26c('0x1f')]=_0x5c7ff3;if(_0x510eec[_0xa26c('0x2f')][_0xa26c('0x40')]){_0x40e89b[_0xa26c('0x41')]=[{'all':!![]}];}return db[_0xa26c('0x2b')][_0xa26c('0x42')](_0x40e89b);})['then'](function(_0x1a0eae){_0x26771e['rows']=_0x1a0eae;return _0x26771e;})[_0xa26c('0x26')](respondWithFilteredResult(_0x5a0d2a,_0x40e89b))[_0xa26c('0x43')](handleError(_0x5a0d2a,null));};exports[_0xa26c('0x44')]=function(_0x2504a4,_0x661aa9){var _0x4b2d69={'raw':![],'where':{'id':_0x2504a4['params']['id']}},_0x4ce729={};_0x4ce729[_0xa26c('0x32')]=_[_0xa26c('0x2e')](db[_0xa26c('0x2b')]['rawAttributes']);_0x4ce729[_0xa26c('0x2f')]=_[_0xa26c('0x2e')](_0x2504a4[_0xa26c('0x2f')]);_0x4ce729[_0xa26c('0x30')]=_['intersection'](_0x4ce729[_0xa26c('0x32')],_0x4ce729[_0xa26c('0x2f')]);_0x4b2d69[_0xa26c('0x33')]=_[_0xa26c('0x31')](_0x4ce729[_0xa26c('0x32')],qs[_0xa26c('0x34')](_0x2504a4[_0xa26c('0x2f')]['fields']));_0x4b2d69[_0xa26c('0x33')]=_0x4b2d69[_0xa26c('0x33')][_0xa26c('0x45')]?_0x4b2d69[_0xa26c('0x33')]:_0x4ce729[_0xa26c('0x32')];if(_0x2504a4['query'][_0xa26c('0x40')]){_0x4b2d69[_0xa26c('0x41')]=[{'all':!![]}];}_0x4b2d69=_[_0xa26c('0x3e')]({},_0x4b2d69,_0x2504a4[_0xa26c('0x3f')]);return db['AnalyticFieldReport'][_0xa26c('0x46')](_0x4b2d69)[_0xa26c('0x26')](handleEntityNotFound(_0x661aa9,null))[_0xa26c('0x26')](respondWithResult(_0x661aa9,null))['catch'](handleError(_0x661aa9,null));};exports[_0xa26c('0x47')]=function(_0x2a474f,_0x5b0d53){return db[_0xa26c('0x2b')]['create'](_0x2a474f[_0xa26c('0x48')],{})[_0xa26c('0x26')](respondWithResult(_0x5b0d53,0xc9))[_0xa26c('0x43')](handleError(_0x5b0d53,null));};exports[_0xa26c('0x49')]=function(_0x119609,_0x34585f){return db[_0xa26c('0x2b')]['bulkCreate'](_0x119609[_0xa26c('0x48')],{'raw':![],'individualHooks':!![]})[_0xa26c('0x26')](respondWithResult(_0x34585f,0xc9))[_0xa26c('0x43')](handleError(_0x34585f,null));};exports[_0xa26c('0x4a')]=function(_0x44f584,_0x4db056){if(_0x44f584[_0xa26c('0x48')]['id']){delete _0x44f584['body']['id'];}return db[_0xa26c('0x2b')]['find']({'where':{'id':_0x44f584[_0xa26c('0x4b')]['id']}})[_0xa26c('0x26')](handleEntityNotFound(_0x4db056,null))[_0xa26c('0x26')](saveUpdates(_0x44f584['body'],null))[_0xa26c('0x26')](respondWithResult(_0x4db056,null))[_0xa26c('0x43')](handleError(_0x4db056,null));};exports['destroy']=function(_0x5e0ef2,_0x15103b){return db[_0xa26c('0x2b')][_0xa26c('0x46')]({'where':{'id':_0x5e0ef2[_0xa26c('0x4b')]['id']}})[_0xa26c('0x26')](handleEntityNotFound(_0x15103b,null))['then'](removeEntity(_0x15103b,null))[_0xa26c('0x43')](handleError(_0x15103b,null));};exports[_0xa26c('0x4c')]=function(_0x5a6f71,_0xccb577){return db[_0xa26c('0x2b')][_0xa26c('0x27')]({'where':{'id':_0x5a6f71[_0xa26c('0x2f')][_0xa26c('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0xa26c('0x26')](respondWithResult(_0xccb577,0xcc))[_0xa26c('0x43')](handleError(_0xccb577,null));};exports[_0xa26c('0x4e')]=function(_0xb73325,_0x1ed97d,_0x9a486b){return db[_0xa26c('0x4f')][_0xa26c('0x50')]({'where':{'id':_0xb73325[_0xa26c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ed97d,null))[_0xa26c('0x26')](function(_0x1ed859){if(_0x1ed859){return db[_0xa26c('0x51')]['transaction'](function(_0x2de34d){return db[_0xa26c('0x2b')][_0xa26c('0x27')]({'where':{'CustomReportId':_0xb73325[_0xa26c('0x4b')]['id']},'transaction':_0x2de34d})[_0xa26c('0x26')](function(_0x440403){var _0x1dd397=_[_0xa26c('0x2a')](_0xb73325[_0xa26c('0x48')],function(_0x3edb62){delete _0x3edb62['id'];_0x3edb62[_0xa26c('0x52')]=_0xb73325['params']['id'];return _0x3edb62;});return db[_0xa26c('0x2b')][_0xa26c('0x49')](_0x1dd397,{'transaction':_0x2de34d});});})[_0xa26c('0x26')](function(){return db[_0xa26c('0x2b')][_0xa26c('0x42')]({'where':{'CustomReportId':_0xb73325[_0xa26c('0x4b')]['id']}});});}})['then'](respondWithResult(_0x1ed97d,null))[_0xa26c('0x43')](handleError(_0x1ed97d,null));};
\ No newline at end of file
+var _0x3fc8=['hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','then','includeAll','include','findAll','rows','show','params','length','merge','options','catch','create','body','bulkCreate','update','find','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','moment','bluebird','mustache','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','error','stack','name','send','map','AnalyticFieldReport','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields'];(function(_0xb11858,_0x18c74b){var _0x44236a=function(_0x5a3e14){while(--_0x5a3e14){_0xb11858['push'](_0xb11858['shift']());}};_0x44236a(++_0x18c74b);}(_0x3fc8,0x10c));var _0x83fc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x3fc8[_0x56482c];return _0x5aae7a;};'use strict';var emlformat=require(_0x83fc('0x0'));var rimraf=require(_0x83fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x83fc('0x2'));var BPromise=require(_0x83fc('0x3'));var Mustache=require(_0x83fc('0x4'));var util=require('util');var path=require('path');var sox=require(_0x83fc('0x5'));var csv=require(_0x83fc('0x6'));var ejs=require(_0x83fc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x83fc('0x8'));var crypto=require('crypto');var jsforce=require(_0x83fc('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x83fc('0x6'));var querystring=require(_0x83fc('0xa'));var Papa=require('papaparse');var Redis=require(_0x83fc('0xb'));var authService=require(_0x83fc('0xc'));var qs=require(_0x83fc('0xd'));var as=require(_0x83fc('0xe'));var hardwareService=require(_0x83fc('0xf'));var logger=require(_0x83fc('0x10'))(_0x83fc('0x11'));var utils=require(_0x83fc('0x12'));var config=require(_0x83fc('0x13'));var licenseUtil=require(_0x83fc('0x14'));var db=require(_0x83fc('0x15'))['db'];function respondWithStatusCode(_0x2e7b2b,_0xf5e18b){_0xf5e18b=_0xf5e18b||0xcc;return function(_0x1a4cc0){if(_0x1a4cc0){return _0x2e7b2b[_0x83fc('0x16')](_0xf5e18b);}return _0x2e7b2b[_0x83fc('0x17')](_0xf5e18b)[_0x83fc('0x18')]();};}function respondWithResult(_0x306412,_0x4801f6){_0x4801f6=_0x4801f6||0xc8;return function(_0x48110c){if(_0x48110c){return _0x306412[_0x83fc('0x17')](_0x4801f6)[_0x83fc('0x19')](_0x48110c);}};}function respondWithFilteredResult(_0x1ec535,_0x4c1bb4){return function(_0x4835c9){if(_0x4835c9){var _0x40449f=typeof _0x4c1bb4[_0x83fc('0x1a')]===_0x83fc('0x1b')&&typeof _0x4c1bb4[_0x83fc('0x1c')]===_0x83fc('0x1b');var _0x58c3f3=_0x4835c9[_0x83fc('0x1d')];var _0x256519=_0x40449f?0x0:_0x4c1bb4[_0x83fc('0x1a')];var _0x4e386c=_0x40449f?_0x4835c9[_0x83fc('0x1d')]:_0x4c1bb4[_0x83fc('0x1a')]+_0x4c1bb4[_0x83fc('0x1c')];var _0x11c262;if(_0x4e386c>=_0x58c3f3){_0x4e386c=_0x58c3f3;_0x11c262=0xc8;}else{_0x11c262=0xce;}_0x1ec535[_0x83fc('0x17')](_0x11c262);return _0x1ec535[_0x83fc('0x1e')](_0x83fc('0x1f'),_0x256519+'-'+_0x4e386c+'/'+_0x58c3f3)[_0x83fc('0x19')](_0x4835c9);}return null;};}function patchUpdates(_0x2c01f5){return function(_0xa71f0b){try{jsonpatch[_0x83fc('0x20')](_0xa71f0b,_0x2c01f5,!![]);}catch(_0xd0ec3){return BPromise[_0x83fc('0x21')](_0xd0ec3);}return _0xa71f0b[_0x83fc('0x22')]();};}function saveUpdates(_0xa59630,_0x3245d7){return function(_0x555876){if(_0x555876){return _0x555876['update'](_0xa59630)['then'](function(_0x3f34b8){return _0x3f34b8;});}return null;};}function removeEntity(_0x419b24,_0x33595b){return function(_0x5d93df){if(_0x5d93df){return _0x5d93df[_0x83fc('0x23')]()['then'](function(){_0x419b24[_0x83fc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a8043,_0xba4c5b){return function(_0x3ad736){if(!_0x3ad736){_0x1a8043[_0x83fc('0x16')](0x194);}return _0x3ad736;};}function handleError(_0x4810b9,_0x2aa01c){_0x2aa01c=_0x2aa01c||0x1f4;return function(_0x2462a4){logger[_0x83fc('0x24')](_0x2462a4[_0x83fc('0x25')]);if(_0x2462a4[_0x83fc('0x26')]){delete _0x2462a4[_0x83fc('0x26')];}_0x4810b9['status'](_0x2aa01c)[_0x83fc('0x27')](_0x2462a4);};}exports['index']=function(_0x4adb72,_0x5b2545){var _0x33001e={},_0x2fdeca={},_0x5c7b84={'count':0x0,'rows':[]};var _0x41d34a=_[_0x83fc('0x28')](db[_0x83fc('0x29')]['rawAttributes'],function(_0x2f1497){return{'name':_0x2f1497[_0x83fc('0x2a')],'type':_0x2f1497[_0x83fc('0x2b')][_0x83fc('0x2c')]};});_0x2fdeca[_0x83fc('0x2d')]=_[_0x83fc('0x28')](_0x41d34a,_0x83fc('0x26'));_0x2fdeca['query']=_[_0x83fc('0x2e')](_0x4adb72[_0x83fc('0x2f')]);_0x2fdeca[_0x83fc('0x30')]=_['intersection'](_0x2fdeca[_0x83fc('0x2d')],_0x2fdeca[_0x83fc('0x2f')]);_0x33001e[_0x83fc('0x31')]=_[_0x83fc('0x32')](_0x2fdeca[_0x83fc('0x2d')],qs[_0x83fc('0x33')](_0x4adb72[_0x83fc('0x2f')][_0x83fc('0x33')]));_0x33001e[_0x83fc('0x31')]=_0x33001e['attributes']['length']?_0x33001e[_0x83fc('0x31')]:_0x2fdeca[_0x83fc('0x2d')];if(!_0x4adb72[_0x83fc('0x2f')][_0x83fc('0x34')](_0x83fc('0x35'))){_0x33001e[_0x83fc('0x1c')]=qs[_0x83fc('0x1c')](_0x4adb72[_0x83fc('0x2f')][_0x83fc('0x1c')]);_0x33001e[_0x83fc('0x1a')]=qs[_0x83fc('0x1a')](_0x4adb72['query']['offset']);}_0x33001e['order']=qs[_0x83fc('0x36')](_0x4adb72[_0x83fc('0x2f')][_0x83fc('0x36')]);_0x33001e[_0x83fc('0x37')]=qs['filters'](_['pick'](_0x4adb72['query'],_0x2fdeca[_0x83fc('0x30')]),_0x41d34a);if(_0x4adb72['query'][_0x83fc('0x38')]){_0x33001e[_0x83fc('0x37')]=_['merge'](_0x33001e['where'],{'$or':_[_0x83fc('0x28')](_0x41d34a,function(_0x5ebbb9){if(_0x5ebbb9[_0x83fc('0x2b')]!==_0x83fc('0x39')){var _0x5eaeb0={};_0x5eaeb0[_0x5ebbb9[_0x83fc('0x26')]]={'$like':'%'+_0x4adb72['query']['filter']+'%'};return _0x5eaeb0;}})});}_0x33001e=_['merge']({},_0x33001e,_0x4adb72['options']);var _0x315991={'where':_0x33001e[_0x83fc('0x37')]};return db[_0x83fc('0x29')]['count'](_0x315991)[_0x83fc('0x3a')](function(_0xa036b3){_0x5c7b84[_0x83fc('0x1d')]=_0xa036b3;if(_0x4adb72[_0x83fc('0x2f')][_0x83fc('0x3b')]){_0x33001e[_0x83fc('0x3c')]=[{'all':!![]}];}return db[_0x83fc('0x29')][_0x83fc('0x3d')](_0x33001e);})[_0x83fc('0x3a')](function(_0x20892e){_0x5c7b84[_0x83fc('0x3e')]=_0x20892e;return _0x5c7b84;})[_0x83fc('0x3a')](respondWithFilteredResult(_0x5b2545,_0x33001e))['catch'](handleError(_0x5b2545,null));};exports[_0x83fc('0x3f')]=function(_0x325484,_0x2f6504){var _0x22d568={'raw':![],'where':{'id':_0x325484[_0x83fc('0x40')]['id']}},_0x4d8527={};_0x4d8527[_0x83fc('0x2d')]=_['keys'](db[_0x83fc('0x29')]['rawAttributes']);_0x4d8527[_0x83fc('0x2f')]=_['keys'](_0x325484['query']);_0x4d8527[_0x83fc('0x30')]=_[_0x83fc('0x32')](_0x4d8527[_0x83fc('0x2d')],_0x4d8527[_0x83fc('0x2f')]);_0x22d568[_0x83fc('0x31')]=_[_0x83fc('0x32')](_0x4d8527[_0x83fc('0x2d')],qs[_0x83fc('0x33')](_0x325484[_0x83fc('0x2f')][_0x83fc('0x33')]));_0x22d568[_0x83fc('0x31')]=_0x22d568['attributes'][_0x83fc('0x41')]?_0x22d568[_0x83fc('0x31')]:_0x4d8527[_0x83fc('0x2d')];if(_0x325484[_0x83fc('0x2f')][_0x83fc('0x3b')]){_0x22d568[_0x83fc('0x3c')]=[{'all':!![]}];}_0x22d568=_[_0x83fc('0x42')]({},_0x22d568,_0x325484[_0x83fc('0x43')]);return db[_0x83fc('0x29')]['find'](_0x22d568)['then'](handleEntityNotFound(_0x2f6504,null))[_0x83fc('0x3a')](respondWithResult(_0x2f6504,null))[_0x83fc('0x44')](handleError(_0x2f6504,null));};exports[_0x83fc('0x45')]=function(_0x5603dd,_0x1a9aa4){return db[_0x83fc('0x29')][_0x83fc('0x45')](_0x5603dd[_0x83fc('0x46')],{})[_0x83fc('0x3a')](respondWithResult(_0x1a9aa4,0xc9))[_0x83fc('0x44')](handleError(_0x1a9aa4,null));};exports[_0x83fc('0x47')]=function(_0x4106e2,_0x32c5a7){return db[_0x83fc('0x29')][_0x83fc('0x47')](_0x4106e2['body'],{'raw':![],'individualHooks':!![]})[_0x83fc('0x3a')](respondWithResult(_0x32c5a7,0xc9))[_0x83fc('0x44')](handleError(_0x32c5a7,null));};exports[_0x83fc('0x48')]=function(_0x179982,_0x30de35){if(_0x179982[_0x83fc('0x46')]['id']){delete _0x179982[_0x83fc('0x46')]['id'];}return db[_0x83fc('0x29')][_0x83fc('0x49')]({'where':{'id':_0x179982['params']['id']}})['then'](handleEntityNotFound(_0x30de35,null))[_0x83fc('0x3a')](saveUpdates(_0x179982['body'],null))[_0x83fc('0x3a')](respondWithResult(_0x30de35,null))[_0x83fc('0x44')](handleError(_0x30de35,null));};exports[_0x83fc('0x23')]=function(_0x274dce,_0x404f66){return db['AnalyticFieldReport'][_0x83fc('0x49')]({'where':{'id':_0x274dce[_0x83fc('0x40')]['id']}})[_0x83fc('0x3a')](handleEntityNotFound(_0x404f66,null))[_0x83fc('0x3a')](removeEntity(_0x404f66,null))[_0x83fc('0x44')](handleError(_0x404f66,null));};exports[_0x83fc('0x4a')]=function(_0x5ea53c,_0x336102){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x5ea53c['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0x83fc('0x3a')](respondWithResult(_0x336102,0xcc))[_0x83fc('0x44')](handleError(_0x336102,null));};exports[_0x83fc('0x4b')]=function(_0x1e0e20,_0x3a08a2,_0x46c3c1){return db[_0x83fc('0x4c')][_0x83fc('0x4d')]({'where':{'id':_0x1e0e20['params']['id']}})[_0x83fc('0x3a')](handleEntityNotFound(_0x3a08a2,null))['then'](function(_0x5a1b54){if(_0x5a1b54){return db[_0x83fc('0x4e')]['transaction'](function(_0x4f28f2){return db['AnalyticFieldReport'][_0x83fc('0x23')]({'where':{'CustomReportId':_0x1e0e20[_0x83fc('0x40')]['id']},'transaction':_0x4f28f2})['then'](function(_0x171d3f){var _0x1b3d34=_[_0x83fc('0x28')](_0x1e0e20['body'],function(_0x43a2e9){delete _0x43a2e9['id'];_0x43a2e9[_0x83fc('0x4f')]=_0x1e0e20[_0x83fc('0x40')]['id'];return _0x43a2e9;});return db[_0x83fc('0x29')][_0x83fc('0x47')](_0x1b3d34,{'transaction':_0x4f28f2});});})[_0x83fc('0x3a')](function(){return db[_0x83fc('0x29')]['findAll']({'where':{'CustomReportId':_0x1e0e20[_0x83fc('0x40')]['id']}});});}})[_0x83fc('0x3a')](respondWithResult(_0x3a08a2,null))[_0x83fc('0x44')](handleError(_0x3a08a2,null));};
\ No newline at end of file