Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index a39d8a7..929cfa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90fb=['VIRTUAL','options','count','includeAll','include','findAll','rows','params','keys','find','create','body','catch','bulkCreate','destroy','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','end','name','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x90fb,0xb6));var _0xb90f=function(_0x26a906,_0x3d135c){_0x26a906=_0x26a906-0x0;var _0x495575=_0x90fb[_0x26a906];return _0x495575;};'use strict';var pdf=require(_0xb90f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb90f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb90f('0x2'));var moment=require(_0xb90f('0x3'));var BPromise=require(_0xb90f('0x4'));var Mustache=require(_0xb90f('0x5'));var util=require(_0xb90f('0x6'));var path=require(_0xb90f('0x7'));var sox=require(_0xb90f('0x8'));var csv=require(_0xb90f('0x9'));var ejs=require(_0xb90f('0xa'));var fs=require('fs');var _=require(_0xb90f('0xb'));var squel=require(_0xb90f('0xc'));var crypto=require(_0xb90f('0xd'));var jsforce=require(_0xb90f('0xe'));var deskjs=require(_0xb90f('0xf'));var toCsv=require(_0xb90f('0x9'));var querystring=require('querystring');var Papa=require(_0xb90f('0x10'));var Redis=require(_0xb90f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb90f('0x12'));var as=require(_0xb90f('0x13'));var hardwareService=require(_0xb90f('0x14'));var logger=require('../../config/logger')(_0xb90f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb90f('0x16'))['db'];function respondWithStatusCode(_0x1025d9,_0x57c8f5){_0x57c8f5=_0x57c8f5||0xcc;return function(_0x5149fe){if(_0x5149fe){return _0x1025d9[_0xb90f('0x17')](_0x57c8f5);}return _0x1025d9[_0xb90f('0x18')](_0x57c8f5)['end']();};}function respondWithResult(_0x37d95a,_0x4155e3){_0x4155e3=_0x4155e3||0xc8;return function(_0x1679d1){if(_0x1679d1){return _0x37d95a[_0xb90f('0x18')](_0x4155e3)[_0xb90f('0x19')](_0x1679d1);}};}function respondWithFilteredResult(_0x1d1502,_0x327233){return function(_0x28491d){if(_0x28491d){var _0x16cd6a=_0x28491d['count'],_0x744483=_0x327233[_0xb90f('0x1a')],_0x3066bc=_0x327233[_0xb90f('0x1a')]+_0x327233['limit'],_0xe34896;if(_0x3066bc>=_0x16cd6a){_0x3066bc=_0x16cd6a;_0xe34896=0xc8;}else{_0xe34896=0xce;}_0x1d1502[_0xb90f('0x18')](_0xe34896);return _0x1d1502[_0xb90f('0x1b')](_0xb90f('0x1c'),_0x744483+'-'+_0x3066bc+'/'+_0x16cd6a)[_0xb90f('0x19')](_0x28491d);}return null;};}function patchUpdates(_0xacb310){return function(_0x35bb9c){try{jsonpatch[_0xb90f('0x1d')](_0x35bb9c,_0xacb310,!![]);}catch(_0x116cfe){return BPromise[_0xb90f('0x1e')](_0x116cfe);}return _0x35bb9c[_0xb90f('0x1f')]();};}function saveUpdates(_0x4d3ca3,_0x128156){return function(_0x20272d){if(_0x20272d){return _0x20272d[_0xb90f('0x20')](_0x4d3ca3)[_0xb90f('0x21')](function(_0x4a4938){return _0x4a4938;});}return null;};}function removeEntity(_0x127c58,_0x1b27e9){return function(_0x4fe8c8){if(_0x4fe8c8){return _0x4fe8c8['destroy']()[_0xb90f('0x21')](function(){_0x127c58[_0xb90f('0x18')](0xcc)[_0xb90f('0x22')]();});}};}function handleEntityNotFound(_0x4e6976,_0xddc54b){return function(_0x4f80e5){if(!_0x4f80e5){_0x4e6976[_0xb90f('0x17')](0x194);}return _0x4f80e5;};}function handleError(_0x2ffcf3,_0xd1a4c2){_0xd1a4c2=_0xd1a4c2||0x1f4;return function(_0x916bfa){logger['error'](_0x916bfa['stack']);if(_0x916bfa[_0xb90f('0x23')]){delete _0x916bfa[_0xb90f('0x23')];}_0x2ffcf3[_0xb90f('0x18')](_0xd1a4c2)['send'](_0x916bfa);};}exports['index']=function(_0xf4aad6,_0x231ffe){var _0x733475={},_0x144a9a={},_0x157a17={'count':0x0,'rows':[]};var _0x1f6392=_['map'](db[_0xb90f('0x24')][_0xb90f('0x25')],function(_0x4773eb){return{'name':_0x4773eb[_0xb90f('0x26')],'type':_0x4773eb[_0xb90f('0x27')][_0xb90f('0x28')]};});_0x144a9a[_0xb90f('0x29')]=_[_0xb90f('0x2a')](_0x1f6392,_0xb90f('0x23'));_0x144a9a[_0xb90f('0x2b')]=_['keys'](_0xf4aad6[_0xb90f('0x2b')]);_0x144a9a[_0xb90f('0x2c')]=_[_0xb90f('0x2d')](_0x144a9a[_0xb90f('0x29')],_0x144a9a['query']);_0x733475['attributes']=_[_0xb90f('0x2d')](_0x144a9a[_0xb90f('0x29')],qs[_0xb90f('0x2e')](_0xf4aad6[_0xb90f('0x2b')]['fields']));_0x733475[_0xb90f('0x2f')]=_0x733475[_0xb90f('0x2f')][_0xb90f('0x30')]?_0x733475[_0xb90f('0x2f')]:_0x144a9a[_0xb90f('0x29')];if(!_0xf4aad6[_0xb90f('0x2b')][_0xb90f('0x31')](_0xb90f('0x32'))){_0x733475['limit']=qs[_0xb90f('0x33')](_0xf4aad6[_0xb90f('0x2b')][_0xb90f('0x33')]);_0x733475[_0xb90f('0x1a')]=qs[_0xb90f('0x1a')](_0xf4aad6[_0xb90f('0x2b')][_0xb90f('0x1a')]);}_0x733475[_0xb90f('0x34')]=qs[_0xb90f('0x35')](_0xf4aad6['query']['sort']);_0x733475['where']=qs[_0xb90f('0x2c')](_[_0xb90f('0x36')](_0xf4aad6[_0xb90f('0x2b')],_0x144a9a['filters']),_0x1f6392);if(_0xf4aad6[_0xb90f('0x2b')][_0xb90f('0x37')]){_0x733475[_0xb90f('0x38')]=_[_0xb90f('0x39')](_0x733475[_0xb90f('0x38')],{'$or':_[_0xb90f('0x2a')](_0x1f6392,function(_0x1677db){if(_0x1677db['type']!==_0xb90f('0x3a')){var _0x433627={};_0x433627[_0x1677db[_0xb90f('0x23')]]={'$like':'%'+_0xf4aad6[_0xb90f('0x2b')][_0xb90f('0x37')]+'%'};return _0x433627;}})});}_0x733475=_[_0xb90f('0x39')]({},_0x733475,_0xf4aad6[_0xb90f('0x3b')]);var _0x1fdddc={'where':_0x733475[_0xb90f('0x38')]};return db[_0xb90f('0x24')][_0xb90f('0x3c')](_0x1fdddc)[_0xb90f('0x21')](function(_0x208e51){_0x157a17['count']=_0x208e51;if(_0xf4aad6[_0xb90f('0x2b')][_0xb90f('0x3d')]){_0x733475[_0xb90f('0x3e')]=[{'all':!![]}];}return db[_0xb90f('0x24')][_0xb90f('0x3f')](_0x733475);})['then'](function(_0x47d30b){_0x157a17[_0xb90f('0x40')]=_0x47d30b;return _0x157a17;})[_0xb90f('0x21')](respondWithFilteredResult(_0x231ffe,_0x733475))['catch'](handleError(_0x231ffe,null));};exports['show']=function(_0x41640f,_0x44f7a){var _0x72abb9={'raw':![],'where':{'id':_0x41640f[_0xb90f('0x41')]['id']}},_0x2dda68={};_0x2dda68[_0xb90f('0x29')]=_[_0xb90f('0x42')](db[_0xb90f('0x24')][_0xb90f('0x25')]);_0x2dda68['query']=_[_0xb90f('0x42')](_0x41640f['query']);_0x2dda68[_0xb90f('0x2c')]=_[_0xb90f('0x2d')](_0x2dda68['model'],_0x2dda68[_0xb90f('0x2b')]);_0x72abb9['attributes']=_[_0xb90f('0x2d')](_0x2dda68['model'],qs[_0xb90f('0x2e')](_0x41640f['query'][_0xb90f('0x2e')]));_0x72abb9[_0xb90f('0x2f')]=_0x72abb9['attributes']['length']?_0x72abb9[_0xb90f('0x2f')]:_0x2dda68[_0xb90f('0x29')];if(_0x41640f[_0xb90f('0x2b')][_0xb90f('0x3d')]){_0x72abb9[_0xb90f('0x3e')]=[{'all':!![]}];}_0x72abb9=_[_0xb90f('0x39')]({},_0x72abb9,_0x41640f[_0xb90f('0x3b')]);return db[_0xb90f('0x24')][_0xb90f('0x43')](_0x72abb9)[_0xb90f('0x21')](handleEntityNotFound(_0x44f7a,null))[_0xb90f('0x21')](respondWithResult(_0x44f7a,null))['catch'](handleError(_0x44f7a,null));};exports[_0xb90f('0x44')]=function(_0x778b1a,_0x2d44db){return db['AnalyticFieldReport'][_0xb90f('0x44')](_0x778b1a[_0xb90f('0x45')],{})[_0xb90f('0x21')](respondWithResult(_0x2d44db,0xc9))[_0xb90f('0x46')](handleError(_0x2d44db,null));};exports[_0xb90f('0x47')]=function(_0x5b6d0a,_0x7b11b1){return db[_0xb90f('0x24')]['bulkCreate'](_0x5b6d0a[_0xb90f('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x7b11b1,0xc9))['catch'](handleError(_0x7b11b1,null));};exports[_0xb90f('0x20')]=function(_0x1b91f8,_0x1a2130){if(_0x1b91f8[_0xb90f('0x45')]['id']){delete _0x1b91f8['body']['id'];}return db[_0xb90f('0x24')][_0xb90f('0x43')]({'where':{'id':_0x1b91f8['params']['id']}})[_0xb90f('0x21')](handleEntityNotFound(_0x1a2130,null))[_0xb90f('0x21')](saveUpdates(_0x1b91f8['body'],null))[_0xb90f('0x21')](respondWithResult(_0x1a2130,null))['catch'](handleError(_0x1a2130,null));};exports[_0xb90f('0x48')]=function(_0x560bf7,_0x141828){return db[_0xb90f('0x24')][_0xb90f('0x43')]({'where':{'id':_0x560bf7[_0xb90f('0x41')]['id']}})['then'](handleEntityNotFound(_0x141828,null))['then'](removeEntity(_0x141828,null))['catch'](handleError(_0x141828,null));};exports[_0xb90f('0x49')]=function(_0x28c15c,_0x26fafb){return db[_0xb90f('0x24')][_0xb90f('0x48')]({'where':{'id':_0x28c15c['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x26fafb,0xcc))[_0xb90f('0x46')](handleError(_0x26fafb,null));};exports[_0xb90f('0x4a')]=function(_0x365760,_0x4bce62,_0x2d279c){return db[_0xb90f('0x4b')][_0xb90f('0x4c')]({'where':{'id':_0x365760[_0xb90f('0x41')]['id']}})[_0xb90f('0x21')](handleEntityNotFound(_0x4bce62,null))[_0xb90f('0x21')](function(_0x19397f){if(_0x19397f){return db[_0xb90f('0x4d')][_0xb90f('0x4e')](function(_0x565d29){return db[_0xb90f('0x24')][_0xb90f('0x48')]({'where':{'CustomReportId':_0x365760[_0xb90f('0x41')]['id']},'transaction':_0x565d29})['then'](function(_0x2999ec){var _0x175d56=_[_0xb90f('0x2a')](_0x365760[_0xb90f('0x45')],function(_0x2c2792){delete _0x2c2792['id'];_0x2c2792[_0xb90f('0x4f')]=_0x365760[_0xb90f('0x41')]['id'];return _0x2c2792;});return db[_0xb90f('0x24')][_0xb90f('0x47')](_0x175d56,{'transaction':_0x565d29});});})[_0xb90f('0x21')](function(){return db['AnalyticFieldReport'][_0xb90f('0x3f')]({'where':{'CustomReportId':_0x365760[_0xb90f('0x41')]['id']}});});}})[_0xb90f('0x21')](respondWithResult(_0x4bce62,null))['catch'](handleError(_0x4bce62,null));};
\ No newline at end of file
+var _0x5d36=['apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','show','length','catch','bulkCreate','body','find','params','bulkDestroy','ids','addFields','findOne','transaction','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x95942,_0x85da80){var _0x6d7f81=function(_0x510549){while(--_0x510549){_0x95942['push'](_0x95942['shift']());}};_0x6d7f81(++_0x85da80);}(_0x5d36,0x1cb));var _0x65d3=function(_0x50c86a,_0x2fec99){_0x50c86a=_0x50c86a-0x0;var _0x53420a=_0x5d36[_0x50c86a];return _0x53420a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65d3('0x0'));var zipdir=require(_0x65d3('0x1'));var jsonpatch=require(_0x65d3('0x2'));var rp=require(_0x65d3('0x3'));var moment=require(_0x65d3('0x4'));var BPromise=require(_0x65d3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x65d3('0x6'));var sox=require(_0x65d3('0x7'));var csv=require(_0x65d3('0x8'));var ejs=require(_0x65d3('0x9'));var fs=require('fs');var fs_extra=require(_0x65d3('0xa'));var _=require('lodash');var squel=require(_0x65d3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x65d3('0xc'));var toCsv=require(_0x65d3('0x8'));var querystring=require(_0x65d3('0xd'));var Papa=require(_0x65d3('0xe'));var Redis=require('ioredis');var authService=require(_0x65d3('0xf'));var qs=require(_0x65d3('0x10'));var as=require(_0x65d3('0x11'));var hardwareService=require(_0x65d3('0x12'));var logger=require(_0x65d3('0x13'))(_0x65d3('0x14'));var utils=require(_0x65d3('0x15'));var config=require(_0x65d3('0x16'));var licenseUtil=require(_0x65d3('0x17'));var db=require(_0x65d3('0x18'))['db'];function respondWithStatusCode(_0x5e34f7,_0x48958f){_0x48958f=_0x48958f||0xcc;return function(_0x4d58cc){if(_0x4d58cc){return _0x5e34f7['sendStatus'](_0x48958f);}return _0x5e34f7['status'](_0x48958f)['end']();};}function respondWithResult(_0xb15e33,_0xad4aff){_0xad4aff=_0xad4aff||0xc8;return function(_0x2595d2){if(_0x2595d2){return _0xb15e33[_0x65d3('0x19')](_0xad4aff)[_0x65d3('0x1a')](_0x2595d2);}};}function respondWithFilteredResult(_0xc2068e,_0x112418){return function(_0x14dd12){if(_0x14dd12){var _0xcff4cb=typeof _0x112418[_0x65d3('0x1b')]===_0x65d3('0x1c')&&typeof _0x112418[_0x65d3('0x1d')]===_0x65d3('0x1c');var _0x558609=_0x14dd12['count'];var _0xaec2b8=_0xcff4cb?0x0:_0x112418['offset'];var _0x54c404=_0xcff4cb?_0x14dd12[_0x65d3('0x1e')]:_0x112418[_0x65d3('0x1b')]+_0x112418[_0x65d3('0x1d')];var _0x4a8f9b;if(_0x54c404>=_0x558609){_0x54c404=_0x558609;_0x4a8f9b=0xc8;}else{_0x4a8f9b=0xce;}_0xc2068e[_0x65d3('0x19')](_0x4a8f9b);return _0xc2068e[_0x65d3('0x1f')](_0x65d3('0x20'),_0xaec2b8+'-'+_0x54c404+'/'+_0x558609)[_0x65d3('0x1a')](_0x14dd12);}return null;};}function patchUpdates(_0x17e335){return function(_0x2ffa46){try{jsonpatch[_0x65d3('0x21')](_0x2ffa46,_0x17e335,!![]);}catch(_0x28d861){return BPromise[_0x65d3('0x22')](_0x28d861);}return _0x2ffa46[_0x65d3('0x23')]();};}function saveUpdates(_0x255206,_0x3dd095){return function(_0x1091d9){if(_0x1091d9){return _0x1091d9[_0x65d3('0x24')](_0x255206)[_0x65d3('0x25')](function(_0x497eeb){return _0x497eeb;});}return null;};}function removeEntity(_0x3209f6,_0x2e79e6){return function(_0x5abe15){if(_0x5abe15){return _0x5abe15[_0x65d3('0x26')]()[_0x65d3('0x25')](function(){_0x3209f6['status'](0xcc)[_0x65d3('0x27')]();});}};}function handleEntityNotFound(_0x129bd7,_0x55dc69){return function(_0x18ffbd){if(!_0x18ffbd){_0x129bd7[_0x65d3('0x28')](0x194);}return _0x18ffbd;};}function handleError(_0x24c6c0,_0x35ea61){_0x35ea61=_0x35ea61||0x1f4;return function(_0x57e9c7){logger[_0x65d3('0x29')](_0x57e9c7[_0x65d3('0x2a')]);if(_0x57e9c7[_0x65d3('0x2b')]){delete _0x57e9c7['name'];}_0x24c6c0['status'](_0x35ea61)[_0x65d3('0x2c')](_0x57e9c7);};}exports[_0x65d3('0x2d')]=function(_0x5d63ee,_0x2a8d63){var _0x3674d4={},_0xe30c16={},_0x49a91b={'count':0x0,'rows':[]};var _0x5c3fff=_[_0x65d3('0x2e')](db['AnalyticFieldReport'][_0x65d3('0x2f')],function(_0xac7298){return{'name':_0xac7298[_0x65d3('0x30')],'type':_0xac7298['type']['key']};});_0xe30c16[_0x65d3('0x31')]=_[_0x65d3('0x2e')](_0x5c3fff,'name');_0xe30c16[_0x65d3('0x32')]=_[_0x65d3('0x33')](_0x5d63ee['query']);_0xe30c16[_0x65d3('0x34')]=_[_0x65d3('0x35')](_0xe30c16[_0x65d3('0x31')],_0xe30c16[_0x65d3('0x32')]);_0x3674d4[_0x65d3('0x36')]=_[_0x65d3('0x35')](_0xe30c16[_0x65d3('0x31')],qs[_0x65d3('0x37')](_0x5d63ee['query'][_0x65d3('0x37')]));_0x3674d4[_0x65d3('0x36')]=_0x3674d4[_0x65d3('0x36')]['length']?_0x3674d4[_0x65d3('0x36')]:_0xe30c16[_0x65d3('0x31')];if(!_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x38')](_0x65d3('0x39'))){_0x3674d4[_0x65d3('0x1d')]=qs[_0x65d3('0x1d')](_0x5d63ee[_0x65d3('0x32')]['limit']);_0x3674d4[_0x65d3('0x1b')]=qs['offset'](_0x5d63ee['query'][_0x65d3('0x1b')]);}_0x3674d4['order']=qs[_0x65d3('0x3a')](_0x5d63ee['query']['sort']);_0x3674d4[_0x65d3('0x3b')]=qs[_0x65d3('0x34')](_[_0x65d3('0x3c')](_0x5d63ee['query'],_0xe30c16[_0x65d3('0x34')]),_0x5c3fff);if(_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x3d')]){_0x3674d4[_0x65d3('0x3b')]=_[_0x65d3('0x3e')](_0x3674d4[_0x65d3('0x3b')],{'$or':_[_0x65d3('0x2e')](_0x5c3fff,function(_0x4b4b6b){if(_0x4b4b6b[_0x65d3('0x3f')]!==_0x65d3('0x40')){var _0x618baa={};_0x618baa[_0x4b4b6b['name']]={'$like':'%'+_0x5d63ee['query']['filter']+'%'};return _0x618baa;}})});}_0x3674d4=_[_0x65d3('0x3e')]({},_0x3674d4,_0x5d63ee[_0x65d3('0x41')]);var _0xfbb1bf={'where':_0x3674d4['where']};return db[_0x65d3('0x42')][_0x65d3('0x1e')](_0xfbb1bf)[_0x65d3('0x25')](function(_0x38de24){_0x49a91b[_0x65d3('0x1e')]=_0x38de24;if(_0x5d63ee[_0x65d3('0x32')][_0x65d3('0x43')]){_0x3674d4[_0x65d3('0x44')]=[{'all':!![]}];}return db[_0x65d3('0x42')][_0x65d3('0x45')](_0x3674d4);})[_0x65d3('0x25')](function(_0x3b262b){_0x49a91b['rows']=_0x3b262b;return _0x49a91b;})['then'](respondWithFilteredResult(_0x2a8d63,_0x3674d4))['catch'](handleError(_0x2a8d63,null));};exports[_0x65d3('0x46')]=function(_0x430f44,_0x817a5c){var _0x1b42e3={'raw':![],'where':{'id':_0x430f44['params']['id']}},_0x5eb27a={};_0x5eb27a[_0x65d3('0x31')]=_['keys'](db[_0x65d3('0x42')][_0x65d3('0x2f')]);_0x5eb27a[_0x65d3('0x32')]=_[_0x65d3('0x33')](_0x430f44[_0x65d3('0x32')]);_0x5eb27a[_0x65d3('0x34')]=_[_0x65d3('0x35')](_0x5eb27a[_0x65d3('0x31')],_0x5eb27a[_0x65d3('0x32')]);_0x1b42e3[_0x65d3('0x36')]=_[_0x65d3('0x35')](_0x5eb27a['model'],qs['fields'](_0x430f44['query'][_0x65d3('0x37')]));_0x1b42e3['attributes']=_0x1b42e3[_0x65d3('0x36')][_0x65d3('0x47')]?_0x1b42e3[_0x65d3('0x36')]:_0x5eb27a[_0x65d3('0x31')];if(_0x430f44['query'][_0x65d3('0x43')]){_0x1b42e3['include']=[{'all':!![]}];}_0x1b42e3=_['merge']({},_0x1b42e3,_0x430f44[_0x65d3('0x41')]);return db[_0x65d3('0x42')]['find'](_0x1b42e3)['then'](handleEntityNotFound(_0x817a5c,null))['then'](respondWithResult(_0x817a5c,null))[_0x65d3('0x48')](handleError(_0x817a5c,null));};exports['create']=function(_0x57f54e,_0x292474){return db[_0x65d3('0x42')]['create'](_0x57f54e['body'],{})[_0x65d3('0x25')](respondWithResult(_0x292474,0xc9))[_0x65d3('0x48')](handleError(_0x292474,null));};exports['bulkCreate']=function(_0x193ef2,_0x33b5a0){return db[_0x65d3('0x42')][_0x65d3('0x49')](_0x193ef2['body'],{'raw':![],'individualHooks':!![]})[_0x65d3('0x25')](respondWithResult(_0x33b5a0,0xc9))[_0x65d3('0x48')](handleError(_0x33b5a0,null));};exports[_0x65d3('0x24')]=function(_0x312dbb,_0x2b3785){if(_0x312dbb['body']['id']){delete _0x312dbb[_0x65d3('0x4a')]['id'];}return db[_0x65d3('0x42')][_0x65d3('0x4b')]({'where':{'id':_0x312dbb[_0x65d3('0x4c')]['id']}})[_0x65d3('0x25')](handleEntityNotFound(_0x2b3785,null))[_0x65d3('0x25')](saveUpdates(_0x312dbb[_0x65d3('0x4a')],null))['then'](respondWithResult(_0x2b3785,null))[_0x65d3('0x48')](handleError(_0x2b3785,null));};exports['destroy']=function(_0x439c7f,_0x28e42e){return db['AnalyticFieldReport'][_0x65d3('0x4b')]({'where':{'id':_0x439c7f[_0x65d3('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28e42e,null))['then'](removeEntity(_0x28e42e,null))[_0x65d3('0x48')](handleError(_0x28e42e,null));};exports[_0x65d3('0x4d')]=function(_0x5949da,_0xbd0af3){return db[_0x65d3('0x42')][_0x65d3('0x26')]({'where':{'id':_0x5949da[_0x65d3('0x32')][_0x65d3('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x65d3('0x25')](respondWithResult(_0xbd0af3,0xcc))['catch'](handleError(_0xbd0af3,null));};exports[_0x65d3('0x4f')]=function(_0x4f9807,_0x4744aa,_0x5054b6){return db['AnalyticCustomReport'][_0x65d3('0x50')]({'where':{'id':_0x4f9807[_0x65d3('0x4c')]['id']}})[_0x65d3('0x25')](handleEntityNotFound(_0x4744aa,null))[_0x65d3('0x25')](function(_0x1a524d){if(_0x1a524d){return db['sequelize'][_0x65d3('0x51')](function(_0x509899){return db[_0x65d3('0x42')][_0x65d3('0x26')]({'where':{'CustomReportId':_0x4f9807[_0x65d3('0x4c')]['id']},'transaction':_0x509899})[_0x65d3('0x25')](function(_0x274bc4){var _0x5489d1=_['map'](_0x4f9807['body'],function(_0x28173c){delete _0x28173c['id'];_0x28173c['CustomReportId']=_0x4f9807[_0x65d3('0x4c')]['id'];return _0x28173c;});return db[_0x65d3('0x42')][_0x65d3('0x49')](_0x5489d1,{'transaction':_0x509899});});})[_0x65d3('0x25')](function(){return db[_0x65d3('0x42')][_0x65d3('0x45')]({'where':{'CustomReportId':_0x4f9807[_0x65d3('0x4c')]['id']}});});}})[_0x65d3('0x25')](respondWithResult(_0x4744aa,null))[_0x65d3('0x48')](handleError(_0x4744aa,null));};
\ No newline at end of file