Built motion from commit c49361c37b5f784889c8087ac6e0e91b7e6b561a. Version 3.0.0...
[motion-next.git] / server / api / whatsappTransferReport / whatsappTransferReport.controller.js
index c1f5a82..d06808d 100644 (file)
@@ -1 +1 @@
-const a820_0x2bae=['filter','order','where','query','status','then','options','destroy','stack','sendStatus','error','filters','model','end','include','rawAttributes','merge','findAll','type','lodash','create','index','WhatsappTransferReport','intersection','includeAll','fields','keys','update','body','key','json','length','show','../../components/parsers/qs','limit','undefined','catch','nolimit','map','describe','pick','count','name','set','sequelize','params','offset','findOne','../../config/logger','attributes','rows'];(function(_0x382285,_0x2baeb6){const _0x2cf7ce=function(_0x1d60ef){while(--_0x1d60ef){_0x382285['push'](_0x382285['shift']());}};_0x2cf7ce(++_0x2baeb6);}(a820_0x2bae,0x14c));const a820_0x2cf7=function(_0x382285,_0x2baeb6){_0x382285=_0x382285-0x0;let _0x2cf7ce=a820_0x2bae[_0x382285];return _0x2cf7ce;};const _0x205ff9=a820_0x2cf7;'use strict';const _=require(_0x205ff9('0x2c')),qs=require(_0x205ff9('0x7')),logger=require(_0x205ff9('0x16'))('api'),db=require('../../mysqldb')['db'],{Op}=require(_0x205ff9('0x12'));function respondWithResult(_0x1d60ef,_0x5dffa3){return _0x5dffa3=_0x5dffa3||0xc8,function(_0x578d60){const _0x58ebb5=a820_0x2cf7;if(_0x578d60)return _0x1d60ef[_0x58ebb5('0x1d')](_0x5dffa3)[_0x58ebb5('0x4')](_0x578d60);};}function respondWithFilteredResult(_0x5ef20f,_0x1a4ee8){return function(_0x503b8b){const _0x2180cf=a820_0x2cf7;if(_0x503b8b){const _0x5a36e5=_0x503b8b[_0x2180cf('0xf')],_0x1b0d86=_0x1a4ee8['offset'];let _0x20917e=_0x1a4ee8['offset']+_0x1a4ee8[_0x2180cf('0x8')],_0x221dc0;return _0x20917e>=_0x5a36e5?(_0x20917e=_0x5a36e5,_0x221dc0=0xc8):_0x221dc0=0xce,_0x5ef20f[_0x2180cf('0x1d')](_0x221dc0),_0x5ef20f[_0x2180cf('0x11')]('Content-Range',_0x1b0d86+'-'+_0x20917e+'/'+_0x5a36e5)[_0x2180cf('0x4')](_0x503b8b);}return null;};}function saveUpdates(_0x4fe972){return function(_0x4f97e0){const _0x57681c=a820_0x2cf7;if(_0x4f97e0)return _0x4f97e0[_0x57681c('0x1')](_0x4fe972)[_0x57681c('0x1e')](function(_0x5c481d){return _0x5c481d;});return null;};}function removeEntity(_0x239351){return function(_0x41b0b9){const _0x5f28fd=a820_0x2cf7;if(_0x41b0b9)return _0x41b0b9[_0x5f28fd('0x20')]()[_0x5f28fd('0x1e')](function(){const _0x5ab2c6=_0x5f28fd;_0x239351[_0x5ab2c6('0x1d')](0xcc)[_0x5ab2c6('0x26')]();});};}function handleEntityNotFound(_0x4abf48){return function(_0x5e4936){const _0x2a6ccc=a820_0x2cf7;return!_0x5e4936&&_0x4abf48[_0x2a6ccc('0x22')](0x194),_0x5e4936;};}function handleError(_0x2746ed,_0x937ae5){return _0x937ae5=_0x937ae5||0x1f4,function(_0x46583f){const _0x52c11d=a820_0x2cf7;logger[_0x52c11d('0x23')](_0x46583f[_0x52c11d('0x21')]),_0x46583f[_0x52c11d('0x10')]&&delete _0x46583f['name'],_0x2746ed['status'](_0x937ae5)['send'](_0x46583f);};}exports[_0x205ff9('0x2e')]=function(_0x2024d5,_0xecea46){const _0x586006=_0x205ff9;let _0x5a56fa={};const _0x36280d={},_0xfaf2f7={'count':0x0,'rows':[]},_0x44037d=_[_0x586006('0xc')](db[_0x586006('0x2f')][_0x586006('0x28')],function(_0x236e13){const _0x4038a2=_0x586006;return{'name':_0x236e13['fieldName'],'type':_0x236e13[_0x4038a2('0x2b')][_0x4038a2('0x3')]};});_0x36280d['model']=_['map'](_0x44037d,_0x586006('0x10')),_0x36280d['query']=_[_0x586006('0x0')](_0x2024d5[_0x586006('0x1c')]),_0x36280d[_0x586006('0x24')]=_[_0x586006('0x30')](_0x36280d[_0x586006('0x25')],_0x36280d['query']),_0x5a56fa[_0x586006('0x17')]=_[_0x586006('0x30')](_0x36280d[_0x586006('0x25')],qs[_0x586006('0x32')](_0x2024d5[_0x586006('0x1c')][_0x586006('0x32')])),_0x5a56fa[_0x586006('0x17')]=_0x5a56fa[_0x586006('0x17')][_0x586006('0x5')]?_0x5a56fa[_0x586006('0x17')]:_0x36280d['model'];typeof _0x2024d5[_0x586006('0x1c')][_0x586006('0xb')]===_0x586006('0x9')&&(_0x5a56fa[_0x586006('0x8')]=qs[_0x586006('0x8')](_0x2024d5[_0x586006('0x1c')][_0x586006('0x8')]),_0x5a56fa[_0x586006('0x14')]=qs['offset'](_0x2024d5['query'][_0x586006('0x14')]));_0x5a56fa[_0x586006('0x1a')]=qs['sort'](_0x2024d5[_0x586006('0x1c')]['sort']),_0x5a56fa[_0x586006('0x1b')]=qs[_0x586006('0x24')](_[_0x586006('0xe')](_0x2024d5[_0x586006('0x1c')],_0x36280d[_0x586006('0x24')]),_0x44037d);_0x2024d5[_0x586006('0x1c')][_0x586006('0x19')]&&(_0x5a56fa[_0x586006('0x1b')]=_[_0x586006('0x29')](_0x5a56fa[_0x586006('0x1b')],{[Op['or']]:_[_0x586006('0xc')](_0x44037d,function(_0x494a55){const _0x37023b=_0x586006;if(_0x494a55[_0x37023b('0x2b')]!=='VIRTUAL'){const _0x19e305={};return _0x19e305[_0x494a55[_0x37023b('0x10')]]={[Op['like']]:'%'+_0x2024d5['query']['filter']+'%'},_0x19e305;}})}));_0x5a56fa=_[_0x586006('0x29')]({},_0x5a56fa,_0x2024d5[_0x586006('0x1f')]);const _0x19328f={'where':_0x5a56fa[_0x586006('0x1b')]};return db[_0x586006('0x2f')]['count'](_0x19328f)[_0x586006('0x1e')](function(_0x103183){const _0x30a353=_0x586006;return _0xfaf2f7[_0x30a353('0xf')]=_0x103183,_0x2024d5['query']['includeAll']&&(_0x5a56fa[_0x30a353('0x27')]=[{'all':!![]}]),db[_0x30a353('0x2f')][_0x30a353('0x2a')](_0x5a56fa);})['then'](function(_0x500645){const _0x4e4442=_0x586006;return _0xfaf2f7[_0x4e4442('0x18')]=_0x500645,_0xfaf2f7;})[_0x586006('0x1e')](respondWithFilteredResult(_0xecea46,_0x5a56fa))[_0x586006('0xa')](handleError(_0xecea46,null));},exports[_0x205ff9('0x6')]=function(_0x1eec77,_0x23fd44){const _0x55ac97=_0x205ff9;let _0x13082f={'raw':!![],'where':{'id':_0x1eec77[_0x55ac97('0x13')]['id']}};const _0x23046a={};return _0x23046a[_0x55ac97('0x25')]=_[_0x55ac97('0x0')](db[_0x55ac97('0x2f')][_0x55ac97('0x28')]),_0x23046a[_0x55ac97('0x1c')]=_[_0x55ac97('0x0')](_0x1eec77[_0x55ac97('0x1c')]),_0x23046a['filters']=_[_0x55ac97('0x30')](_0x23046a[_0x55ac97('0x25')],_0x23046a[_0x55ac97('0x1c')]),_0x13082f[_0x55ac97('0x17')]=_[_0x55ac97('0x30')](_0x23046a[_0x55ac97('0x25')],qs[_0x55ac97('0x32')](_0x1eec77[_0x55ac97('0x1c')][_0x55ac97('0x32')])),_0x13082f[_0x55ac97('0x17')]=_0x13082f[_0x55ac97('0x17')][_0x55ac97('0x5')]?_0x13082f[_0x55ac97('0x17')]:_0x23046a[_0x55ac97('0x25')],_0x1eec77[_0x55ac97('0x1c')][_0x55ac97('0x31')]&&(_0x13082f[_0x55ac97('0x27')]=[{'all':!![]}]),_0x13082f=_[_0x55ac97('0x29')]({},_0x13082f,_0x1eec77[_0x55ac97('0x1f')]),db[_0x55ac97('0x2f')][_0x55ac97('0x15')](_0x13082f)['then'](handleEntityNotFound(_0x23fd44,null))['then'](respondWithResult(_0x23fd44,null))['catch'](handleError(_0x23fd44,null));},exports[_0x205ff9('0x2d')]=function(_0x21aaab,_0x56eed6){const _0x557c9b=_0x205ff9;return db[_0x557c9b('0x2f')]['create'](_0x21aaab[_0x557c9b('0x2')],{})[_0x557c9b('0x1e')](respondWithResult(_0x56eed6,0xc9))[_0x557c9b('0xa')](handleError(_0x56eed6,null));},exports[_0x205ff9('0x1')]=function(_0x1c83bf,_0x1a5054){const _0x376a80=_0x205ff9;return _0x1c83bf[_0x376a80('0x2')]['id']&&delete _0x1c83bf[_0x376a80('0x2')]['id'],db['WhatsappTransferReport'][_0x376a80('0x15')]({'where':{'id':_0x1c83bf[_0x376a80('0x13')]['id']}})[_0x376a80('0x1e')](handleEntityNotFound(_0x1a5054,null))[_0x376a80('0x1e')](saveUpdates(_0x1c83bf['body'],null))[_0x376a80('0x1e')](respondWithResult(_0x1a5054,null))[_0x376a80('0xa')](handleError(_0x1a5054,null));},exports[_0x205ff9('0x20')]=function(_0x51d5af,_0x34b878){const _0x3af766=_0x205ff9;return db[_0x3af766('0x2f')][_0x3af766('0x15')]({'where':{'id':_0x51d5af[_0x3af766('0x13')]['id']}})[_0x3af766('0x1e')](handleEntityNotFound(_0x34b878,null))[_0x3af766('0x1e')](removeEntity(_0x34b878,null))[_0x3af766('0xa')](handleError(_0x34b878,null));},exports[_0x205ff9('0xd')]=function(_0x5744c6,_0x5bf7ef){const _0x5ae3fc=_0x205ff9;return db['WhatsappTransferReport'][_0x5ae3fc('0xd')]()['then'](respondWithResult(_0x5bf7ef,null))[_0x5ae3fc('0xa')](handleError(_0x5bf7ef,null));};
\ No newline at end of file
+const a820_0x31c7=['body','includeAll','../../config/logger','../../mysqldb','nolimit','params','findOne','options','send','rows','fieldName','sequelize','like','intersection','type','describe','name','../../components/parsers/qs','create','count','end','update','filters','merge','order','key','status','where','sort','then','sendStatus','filter','length','catch','query','show','findAll','map','keys','model','attributes','index','rawAttributes','offset','limit','fields','include','json','WhatsappTransferReport','destroy','undefined'];(function(_0x2ecaf1,_0x31c755){const _0x2df7dc=function(_0x54306f){while(--_0x54306f){_0x2ecaf1['push'](_0x2ecaf1['shift']());}};_0x2df7dc(++_0x31c755);}(a820_0x31c7,0x12d));const a820_0x2df7=function(_0x2ecaf1,_0x31c755){_0x2ecaf1=_0x2ecaf1-0x0;let _0x2df7dc=a820_0x31c7[_0x2ecaf1];return _0x2df7dc;};const _0x433448=a820_0x2df7;'use strict';const _=require('lodash'),qs=require(_0x433448('0x16')),logger=require(_0x433448('0x7'))('api'),db=require(_0x433448('0x8'))['db'],{Op}=require(_0x433448('0x10'));function respondWithResult(_0x54306f,_0x53c29e){return _0x53c29e=_0x53c29e||0xc8,function(_0x27b857){const _0x4c3475=a820_0x2df7;if(_0x27b857)return _0x54306f[_0x4c3475('0x1f')](_0x53c29e)[_0x4c3475('0x1')](_0x27b857);};}function respondWithFilteredResult(_0x56d1cc,_0x305036){return function(_0x53504a){const _0x5221e=a820_0x2df7;if(_0x53504a){const _0x51743c=_0x53504a[_0x5221e('0x18')],_0x4f1faa=_0x305036['offset'];let _0x1edf23=_0x305036[_0x5221e('0x30')]+_0x305036[_0x5221e('0x31')],_0x569057;return _0x1edf23>=_0x51743c?(_0x1edf23=_0x51743c,_0x569057=0xc8):_0x569057=0xce,_0x56d1cc[_0x5221e('0x1f')](_0x569057),_0x56d1cc['set']('Content-Range',_0x4f1faa+'-'+_0x1edf23+'/'+_0x51743c)[_0x5221e('0x1')](_0x53504a);}return null;};}function saveUpdates(_0x4120f4){return function(_0x53cee3){const _0x52da81=a820_0x2df7;if(_0x53cee3)return _0x53cee3[_0x52da81('0x1a')](_0x4120f4)[_0x52da81('0x22')](function(_0x1d71e2){return _0x1d71e2;});return null;};}function removeEntity(_0x3497bf){return function(_0x87ec4e){const _0x493847=a820_0x2df7;if(_0x87ec4e)return _0x87ec4e[_0x493847('0x3')]()[_0x493847('0x22')](function(){const _0xbaa694=_0x493847;_0x3497bf[_0xbaa694('0x1f')](0xcc)[_0xbaa694('0x19')]();});};}function handleEntityNotFound(_0x4d3dc2){return function(_0x5560e6){const _0x5975da=a820_0x2df7;return!_0x5560e6&&_0x4d3dc2[_0x5975da('0x23')](0x194),_0x5560e6;};}function handleError(_0x2c27f6,_0x148727){return _0x148727=_0x148727||0x1f4,function(_0x429c74){const _0x54322d=a820_0x2df7;logger['error'](_0x429c74['stack']),_0x429c74['name']&&delete _0x429c74[_0x54322d('0x15')],_0x2c27f6['status'](_0x148727)[_0x54322d('0xd')](_0x429c74);};}exports[_0x433448('0x2e')]=function(_0xa3f617,_0x553938){const _0x330cda=_0x433448;let _0x106e7c={};const _0x33e5d0={},_0x3dad76={'count':0x0,'rows':[]},_0x516a86=_['map'](db['WhatsappTransferReport'][_0x330cda('0x2f')],function(_0x5a23a1){const _0xb5d298=_0x330cda;return{'name':_0x5a23a1[_0xb5d298('0xf')],'type':_0x5a23a1['type'][_0xb5d298('0x1e')]};});_0x33e5d0[_0x330cda('0x2c')]=_[_0x330cda('0x2a')](_0x516a86,_0x330cda('0x15')),_0x33e5d0['query']=_[_0x330cda('0x2b')](_0xa3f617[_0x330cda('0x27')]),_0x33e5d0['filters']=_['intersection'](_0x33e5d0[_0x330cda('0x2c')],_0x33e5d0[_0x330cda('0x27')]),_0x106e7c[_0x330cda('0x2d')]=_[_0x330cda('0x12')](_0x33e5d0['model'],qs['fields'](_0xa3f617[_0x330cda('0x27')][_0x330cda('0x32')])),_0x106e7c[_0x330cda('0x2d')]=_0x106e7c[_0x330cda('0x2d')][_0x330cda('0x25')]?_0x106e7c[_0x330cda('0x2d')]:_0x33e5d0[_0x330cda('0x2c')];typeof _0xa3f617[_0x330cda('0x27')][_0x330cda('0x9')]===_0x330cda('0x4')&&(_0x106e7c[_0x330cda('0x31')]=qs[_0x330cda('0x31')](_0xa3f617[_0x330cda('0x27')][_0x330cda('0x31')]),_0x106e7c[_0x330cda('0x30')]=qs[_0x330cda('0x30')](_0xa3f617[_0x330cda('0x27')]['offset']));_0x106e7c[_0x330cda('0x1d')]=qs[_0x330cda('0x21')](_0xa3f617[_0x330cda('0x27')]['sort']),_0x106e7c[_0x330cda('0x20')]=qs['filters'](_['pick'](_0xa3f617['query'],_0x33e5d0[_0x330cda('0x1b')]),_0x516a86);_0xa3f617[_0x330cda('0x27')][_0x330cda('0x24')]&&(_0x106e7c[_0x330cda('0x20')]=_[_0x330cda('0x1c')](_0x106e7c[_0x330cda('0x20')],{[Op['or']]:_[_0x330cda('0x2a')](_0x516a86,function(_0x3fc7fb){const _0x4dbf0e=_0x330cda;if(_0x3fc7fb[_0x4dbf0e('0x13')]!=='VIRTUAL'){const _0x15ec28={};return _0x15ec28[_0x3fc7fb[_0x4dbf0e('0x15')]]={[Op[_0x4dbf0e('0x11')]]:'%'+_0xa3f617[_0x4dbf0e('0x27')][_0x4dbf0e('0x24')]+'%'},_0x15ec28;}})}));_0x106e7c=_[_0x330cda('0x1c')]({},_0x106e7c,_0xa3f617[_0x330cda('0xc')]);const _0x1c4e75={'where':_0x106e7c[_0x330cda('0x20')]};return db[_0x330cda('0x2')]['count'](_0x1c4e75)['then'](function(_0x779dc5){const _0x29dd3f=_0x330cda;return _0x3dad76[_0x29dd3f('0x18')]=_0x779dc5,_0xa3f617[_0x29dd3f('0x27')][_0x29dd3f('0x6')]&&(_0x106e7c['include']=[{'all':!![]}]),db['WhatsappTransferReport'][_0x29dd3f('0x29')](_0x106e7c);})[_0x330cda('0x22')](function(_0x1cda02){const _0xe1567d=_0x330cda;return _0x3dad76[_0xe1567d('0xe')]=_0x1cda02,_0x3dad76;})[_0x330cda('0x22')](respondWithFilteredResult(_0x553938,_0x106e7c))[_0x330cda('0x26')](handleError(_0x553938,null));},exports[_0x433448('0x28')]=function(_0x456f46,_0x2e44af){const _0x455a4a=_0x433448;let _0x2d5117={'raw':!![],'where':{'id':_0x456f46[_0x455a4a('0xa')]['id']}};const _0x40b32d={};return _0x40b32d[_0x455a4a('0x2c')]=_[_0x455a4a('0x2b')](db['WhatsappTransferReport'][_0x455a4a('0x2f')]),_0x40b32d[_0x455a4a('0x27')]=_['keys'](_0x456f46[_0x455a4a('0x27')]),_0x40b32d['filters']=_[_0x455a4a('0x12')](_0x40b32d[_0x455a4a('0x2c')],_0x40b32d['query']),_0x2d5117[_0x455a4a('0x2d')]=_[_0x455a4a('0x12')](_0x40b32d['model'],qs[_0x455a4a('0x32')](_0x456f46[_0x455a4a('0x27')]['fields'])),_0x2d5117[_0x455a4a('0x2d')]=_0x2d5117['attributes'][_0x455a4a('0x25')]?_0x2d5117[_0x455a4a('0x2d')]:_0x40b32d[_0x455a4a('0x2c')],_0x456f46[_0x455a4a('0x27')][_0x455a4a('0x6')]&&(_0x2d5117[_0x455a4a('0x0')]=[{'all':!![]}]),_0x2d5117=_[_0x455a4a('0x1c')]({},_0x2d5117,_0x456f46[_0x455a4a('0xc')]),db[_0x455a4a('0x2')][_0x455a4a('0xb')](_0x2d5117)['then'](handleEntityNotFound(_0x2e44af,null))[_0x455a4a('0x22')](respondWithResult(_0x2e44af,null))[_0x455a4a('0x26')](handleError(_0x2e44af,null));},exports['create']=function(_0xe374c2,_0x2229f7){const _0x35ebb6=_0x433448;return db[_0x35ebb6('0x2')][_0x35ebb6('0x17')](_0xe374c2[_0x35ebb6('0x5')],{})[_0x35ebb6('0x22')](respondWithResult(_0x2229f7,0xc9))['catch'](handleError(_0x2229f7,null));},exports['update']=function(_0x26742d,_0xd4ddf8){const _0x1dba18=_0x433448;return _0x26742d[_0x1dba18('0x5')]['id']&&delete _0x26742d[_0x1dba18('0x5')]['id'],db['WhatsappTransferReport'][_0x1dba18('0xb')]({'where':{'id':_0x26742d[_0x1dba18('0xa')]['id']}})[_0x1dba18('0x22')](handleEntityNotFound(_0xd4ddf8,null))['then'](saveUpdates(_0x26742d[_0x1dba18('0x5')],null))[_0x1dba18('0x22')](respondWithResult(_0xd4ddf8,null))['catch'](handleError(_0xd4ddf8,null));},exports[_0x433448('0x3')]=function(_0x5d5ee9,_0x217318){const _0xa32809=_0x433448;return db['WhatsappTransferReport'][_0xa32809('0xb')]({'where':{'id':_0x5d5ee9[_0xa32809('0xa')]['id']}})[_0xa32809('0x22')](handleEntityNotFound(_0x217318,null))[_0xa32809('0x22')](removeEntity(_0x217318,null))['catch'](handleError(_0x217318,null));},exports[_0x433448('0x14')]=function(_0xe9ec54,_0x20dfaf){const _0x44c26=_0x433448;return db[_0x44c26('0x2')][_0x44c26('0x14')]()['then'](respondWithResult(_0x20dfaf,null))[_0x44c26('0x26')](handleError(_0x20dfaf,null));};
\ No newline at end of file