Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index 671c720..210180a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x3816=['model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','rows','catch','show','params','includeAll','find','create','body','bulkCreate','update','bulkDestroy','destroy','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','error','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type'];(function(_0x35bce3,_0x19b451){var _0x426644=function(_0x85a5f5){while(--_0x85a5f5){_0x35bce3['push'](_0x35bce3['shift']());}};_0x426644(++_0x19b451);}(_0x3816,0x113));var _0x6381=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0x3816[_0x11a220];return _0x20d8fe;};'use strict';var emlformat=require(_0x6381('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6381('0x1'));var jsonpatch=require(_0x6381('0x2'));var rp=require(_0x6381('0x3'));var moment=require(_0x6381('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6381('0x5'));var util=require(_0x6381('0x6'));var path=require('path');var sox=require(_0x6381('0x7'));var csv=require('to-csv');var ejs=require(_0x6381('0x8'));var fs=require('fs');var fs_extra=require(_0x6381('0x9'));var _=require('lodash');var squel=require(_0x6381('0xa'));var crypto=require(_0x6381('0xb'));var jsforce=require(_0x6381('0xc'));var deskjs=require(_0x6381('0xd'));var toCsv=require(_0x6381('0xe'));var querystring=require(_0x6381('0xf'));var Papa=require('papaparse');var Redis=require(_0x6381('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6381('0x11'));var hardwareService=require(_0x6381('0x12'));var logger=require(_0x6381('0x13'))(_0x6381('0x14'));var utils=require(_0x6381('0x15'));var config=require(_0x6381('0x16'));var licenseUtil=require(_0x6381('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12c4e9,_0x388be3){_0x388be3=_0x388be3||0xcc;return function(_0x204296){if(_0x204296){return _0x12c4e9[_0x6381('0x18')](_0x388be3);}return _0x12c4e9[_0x6381('0x19')](_0x388be3)[_0x6381('0x1a')]();};}function respondWithResult(_0x15913c,_0x15efad){_0x15efad=_0x15efad||0xc8;return function(_0x75cb26){if(_0x75cb26){return _0x15913c[_0x6381('0x19')](_0x15efad)['json'](_0x75cb26);}};}function respondWithFilteredResult(_0x548329,_0x5a7d5a){return function(_0x24195f){if(_0x24195f){var _0x524c84=typeof _0x5a7d5a[_0x6381('0x1b')]===_0x6381('0x1c')&&typeof _0x5a7d5a[_0x6381('0x1d')]==='undefined';var _0x3ba7cc=_0x24195f['count'];var _0x4a0bff=_0x524c84?0x0:_0x5a7d5a[_0x6381('0x1b')];var _0x7e6f36=_0x524c84?_0x24195f[_0x6381('0x1e')]:_0x5a7d5a[_0x6381('0x1b')]+_0x5a7d5a['limit'];var _0x19f306;if(_0x7e6f36>=_0x3ba7cc){_0x7e6f36=_0x3ba7cc;_0x19f306=0xc8;}else{_0x19f306=0xce;}_0x548329[_0x6381('0x19')](_0x19f306);return _0x548329['set'](_0x6381('0x1f'),_0x4a0bff+'-'+_0x7e6f36+'/'+_0x3ba7cc)[_0x6381('0x20')](_0x24195f);}return null;};}function patchUpdates(_0x4bfb35){return function(_0x5d7e7e){try{jsonpatch[_0x6381('0x21')](_0x5d7e7e,_0x4bfb35,!![]);}catch(_0x3f4fff){return BPromise[_0x6381('0x22')](_0x3f4fff);}return _0x5d7e7e[_0x6381('0x23')]();};}function saveUpdates(_0x53d0c2,_0x11ff66){return function(_0x2cb1c8){if(_0x2cb1c8){return _0x2cb1c8['update'](_0x53d0c2)[_0x6381('0x24')](function(_0x776e47){return _0x776e47;});}return null;};}function removeEntity(_0x5437c5,_0xa39d94){return function(_0x36226b){if(_0x36226b){return _0x36226b['destroy']()[_0x6381('0x24')](function(){_0x5437c5['status'](0xcc)[_0x6381('0x1a')]();});}};}function handleEntityNotFound(_0x2ba7b6,_0x45dffb){return function(_0x103f76){if(!_0x103f76){_0x2ba7b6[_0x6381('0x18')](0x194);}return _0x103f76;};}function handleError(_0x5ab02e,_0x15fa60){_0x15fa60=_0x15fa60||0x1f4;return function(_0x2d3751){logger[_0x6381('0x25')](_0x2d3751['stack']);if(_0x2d3751[_0x6381('0x26')]){delete _0x2d3751[_0x6381('0x26')];}_0x5ab02e[_0x6381('0x19')](_0x15fa60)[_0x6381('0x27')](_0x2d3751);};}exports[_0x6381('0x28')]=function(_0x99663f,_0x4db035){var _0x49e1f8={},_0x544e41={},_0x407210={'count':0x0,'rows':[]};var _0x5f2129=_['map'](db[_0x6381('0x29')][_0x6381('0x2a')],function(_0x32d67e){return{'name':_0x32d67e[_0x6381('0x2b')],'type':_0x32d67e[_0x6381('0x2c')]['key']};});_0x544e41[_0x6381('0x2d')]=_[_0x6381('0x2e')](_0x5f2129,_0x6381('0x26'));_0x544e41[_0x6381('0x2f')]=_[_0x6381('0x30')](_0x99663f[_0x6381('0x2f')]);_0x544e41[_0x6381('0x31')]=_[_0x6381('0x32')](_0x544e41[_0x6381('0x2d')],_0x544e41[_0x6381('0x2f')]);_0x49e1f8[_0x6381('0x33')]=_[_0x6381('0x32')](_0x544e41[_0x6381('0x2d')],qs['fields'](_0x99663f['query'][_0x6381('0x34')]));_0x49e1f8[_0x6381('0x33')]=_0x49e1f8[_0x6381('0x33')][_0x6381('0x35')]?_0x49e1f8[_0x6381('0x33')]:_0x544e41['model'];if(!_0x99663f[_0x6381('0x2f')]['hasOwnProperty'](_0x6381('0x36'))){_0x49e1f8[_0x6381('0x1d')]=qs[_0x6381('0x1d')](_0x99663f[_0x6381('0x2f')][_0x6381('0x1d')]);_0x49e1f8[_0x6381('0x1b')]=qs[_0x6381('0x1b')](_0x99663f[_0x6381('0x2f')][_0x6381('0x1b')]);}_0x49e1f8[_0x6381('0x37')]=qs[_0x6381('0x38')](_0x99663f['query'][_0x6381('0x38')]);_0x49e1f8['where']=qs[_0x6381('0x31')](_['pick'](_0x99663f[_0x6381('0x2f')],_0x544e41[_0x6381('0x31')]),_0x5f2129);if(_0x99663f['query'][_0x6381('0x39')]){_0x49e1f8[_0x6381('0x3a')]=_[_0x6381('0x3b')](_0x49e1f8[_0x6381('0x3a')],{'$or':_['map'](_0x5f2129,function(_0x4326de){if(_0x4326de[_0x6381('0x2c')]!==_0x6381('0x3c')){var _0x334ae9={};_0x334ae9[_0x4326de[_0x6381('0x26')]]={'$like':'%'+_0x99663f[_0x6381('0x2f')][_0x6381('0x39')]+'%'};return _0x334ae9;}})});}_0x49e1f8=_[_0x6381('0x3b')]({},_0x49e1f8,_0x99663f[_0x6381('0x3d')]);var _0x467464={'where':_0x49e1f8[_0x6381('0x3a')]};return db[_0x6381('0x29')][_0x6381('0x1e')](_0x467464)[_0x6381('0x24')](function(_0x34d93e){_0x407210[_0x6381('0x1e')]=_0x34d93e;if(_0x99663f['query']['includeAll']){_0x49e1f8['include']=[{'all':!![]}];}return db[_0x6381('0x29')]['findAll'](_0x49e1f8);})[_0x6381('0x24')](function(_0x24aa83){_0x407210[_0x6381('0x3e')]=_0x24aa83;return _0x407210;})['then'](respondWithFilteredResult(_0x4db035,_0x49e1f8))[_0x6381('0x3f')](handleError(_0x4db035,null));};exports[_0x6381('0x40')]=function(_0x743255,_0x3d5ab9){var _0x48ca10={'raw':![],'where':{'id':_0x743255[_0x6381('0x41')]['id']}},_0x191099={};_0x191099[_0x6381('0x2d')]=_['keys'](db[_0x6381('0x29')][_0x6381('0x2a')]);_0x191099[_0x6381('0x2f')]=_[_0x6381('0x30')](_0x743255[_0x6381('0x2f')]);_0x191099[_0x6381('0x31')]=_[_0x6381('0x32')](_0x191099[_0x6381('0x2d')],_0x191099[_0x6381('0x2f')]);_0x48ca10[_0x6381('0x33')]=_['intersection'](_0x191099[_0x6381('0x2d')],qs[_0x6381('0x34')](_0x743255[_0x6381('0x2f')][_0x6381('0x34')]));_0x48ca10[_0x6381('0x33')]=_0x48ca10['attributes']['length']?_0x48ca10['attributes']:_0x191099['model'];if(_0x743255[_0x6381('0x2f')][_0x6381('0x42')]){_0x48ca10['include']=[{'all':!![]}];}_0x48ca10=_['merge']({},_0x48ca10,_0x743255[_0x6381('0x3d')]);return db[_0x6381('0x29')][_0x6381('0x43')](_0x48ca10)[_0x6381('0x24')](handleEntityNotFound(_0x3d5ab9,null))[_0x6381('0x24')](respondWithResult(_0x3d5ab9,null))[_0x6381('0x3f')](handleError(_0x3d5ab9,null));};exports[_0x6381('0x44')]=function(_0x1f800c,_0x3330c3){return db['AnalyticFieldReport']['create'](_0x1f800c[_0x6381('0x45')],{})['then'](respondWithResult(_0x3330c3,0xc9))[_0x6381('0x3f')](handleError(_0x3330c3,null));};exports['bulkCreate']=function(_0x381d03,_0x4d7de5){return db[_0x6381('0x29')][_0x6381('0x46')](_0x381d03[_0x6381('0x45')],{'raw':![],'individualHooks':!![]})[_0x6381('0x24')](respondWithResult(_0x4d7de5,0xc9))[_0x6381('0x3f')](handleError(_0x4d7de5,null));};exports[_0x6381('0x47')]=function(_0x162bde,_0x468583){if(_0x162bde['body']['id']){delete _0x162bde['body']['id'];}return db[_0x6381('0x29')][_0x6381('0x43')]({'where':{'id':_0x162bde['params']['id']}})[_0x6381('0x24')](handleEntityNotFound(_0x468583,null))[_0x6381('0x24')](saveUpdates(_0x162bde[_0x6381('0x45')],null))[_0x6381('0x24')](respondWithResult(_0x468583,null))[_0x6381('0x3f')](handleError(_0x468583,null));};exports['destroy']=function(_0x5b796a,_0x1e0a0e){return db[_0x6381('0x29')][_0x6381('0x43')]({'where':{'id':_0x5b796a['params']['id']}})[_0x6381('0x24')](handleEntityNotFound(_0x1e0a0e,null))[_0x6381('0x24')](removeEntity(_0x1e0a0e,null))[_0x6381('0x3f')](handleError(_0x1e0a0e,null));};exports[_0x6381('0x48')]=function(_0x21b8e1,_0x2edbfc){return db[_0x6381('0x29')][_0x6381('0x49')]({'where':{'id':_0x21b8e1[_0x6381('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x6381('0x24')](respondWithResult(_0x2edbfc,0xcc))['catch'](handleError(_0x2edbfc,null));};exports[_0x6381('0x4a')]=function(_0x51aca7,_0x3dcc64,_0x23e2b1){return db[_0x6381('0x4b')][_0x6381('0x4c')]({'where':{'id':_0x51aca7[_0x6381('0x41')]['id']}})[_0x6381('0x24')](handleEntityNotFound(_0x3dcc64,null))[_0x6381('0x24')](function(_0x22077b){if(_0x22077b){return db[_0x6381('0x4d')][_0x6381('0x4e')](function(_0x4bebe7){return db[_0x6381('0x29')]['destroy']({'where':{'CustomReportId':_0x51aca7[_0x6381('0x41')]['id']},'transaction':_0x4bebe7})[_0x6381('0x24')](function(_0x1f6aff){var _0xb3e1e6=_[_0x6381('0x2e')](_0x51aca7[_0x6381('0x45')],function(_0x832d34){delete _0x832d34['id'];_0x832d34['CustomReportId']=_0x51aca7[_0x6381('0x41')]['id'];return _0x832d34;});return db[_0x6381('0x29')][_0x6381('0x46')](_0xb3e1e6,{'transaction':_0x4bebe7});});})[_0x6381('0x24')](function(){return db['AnalyticFieldReport'][_0x6381('0x4f')]({'where':{'CustomReportId':_0x51aca7[_0x6381('0x41')]['id']}});});}})['then'](respondWithResult(_0x3dcc64,null))[_0x6381('0x3f')](handleError(_0x3dcc64,null));};
\ No newline at end of file