Built motion from commit 973e3e332e1c8e2f84c4b0cd2e5af794131724f5. Version 3.0.0...
[motion-next.git] / server / api / whatsappTransferReport / whatsappTransferReport.controller.js
index 4b514e0..421744a 100644 (file)
@@ -1 +1 @@
-const a820_0x5ec8=['where','body','undefined','attributes','rows','fields','order','limit','send','index','nolimit','../../components/parsers/qs','params','sort','type','then','Content-Range','show','filters','merge','offset','findOne','like','fieldName','describe','set','options','name','create','intersection','update','WhatsappTransferReport','query','rawAttributes','error','status','filter','map','model','json','lodash','length','key','keys','destroy','catch','include','pick','end','api','findAll','count'];(function(_0xafe6fa,_0x5ec81a){const _0xfd0f54=function(_0x3e5db3){while(--_0x3e5db3){_0xafe6fa['push'](_0xafe6fa['shift']());}};_0xfd0f54(++_0x5ec81a);}(a820_0x5ec8,0x17e));const a820_0xfd0f=function(_0xafe6fa,_0x5ec81a){_0xafe6fa=_0xafe6fa-0x0;let _0xfd0f54=a820_0x5ec8[_0xafe6fa];return _0xfd0f54;};const _0x5b9fe7=a820_0xfd0f;'use strict';const _=require(_0x5b9fe7('0x16')),qs=require(_0x5b9fe7('0x2d')),logger=require('../../config/logger')(_0x5b9fe7('0x1f')),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithResult(_0x3e5db3,_0x531baf){return _0x531baf=_0x531baf||0xc8,function(_0x1006f1){const _0x1132f3=a820_0xfd0f;if(_0x1006f1)return _0x3e5db3[_0x1132f3('0x11')](_0x531baf)[_0x1132f3('0x15')](_0x1006f1);};}function respondWithFilteredResult(_0x3f68cf,_0x279dd3){return function(_0x3e2524){const _0x20d56e=a820_0xfd0f;if(_0x3e2524){const _0x5224f8=_0x3e2524['count'],_0x1073d0=_0x279dd3[_0x20d56e('0x2')];let _0x128894=_0x279dd3[_0x20d56e('0x2')]+_0x279dd3[_0x20d56e('0x29')],_0x16c1f6;return _0x128894>=_0x5224f8?(_0x128894=_0x5224f8,_0x16c1f6=0xc8):_0x16c1f6=0xce,_0x3f68cf[_0x20d56e('0x11')](_0x16c1f6),_0x3f68cf[_0x20d56e('0x7')](_0x20d56e('0x32'),_0x1073d0+'-'+_0x128894+'/'+_0x5224f8)[_0x20d56e('0x15')](_0x3e2524);}return null;};}function saveUpdates(_0x198a0d){return function(_0x20184f){const _0x56c379=a820_0xfd0f;if(_0x20184f)return _0x20184f[_0x56c379('0xc')](_0x198a0d)[_0x56c379('0x31')](function(_0x13f3ab){return _0x13f3ab;});return null;};}function removeEntity(_0x50a78f){return function(_0x31f999){const _0x15d924=a820_0xfd0f;if(_0x31f999)return _0x31f999[_0x15d924('0x1a')]()[_0x15d924('0x31')](function(){const _0x53edd1=_0x15d924;_0x50a78f[_0x53edd1('0x11')](0xcc)[_0x53edd1('0x1e')]();});};}function handleEntityNotFound(_0xef5083){return function(_0x5963ac){return!_0x5963ac&&_0xef5083['sendStatus'](0x194),_0x5963ac;};}function handleError(_0x3291a9,_0x7843c7){return _0x7843c7=_0x7843c7||0x1f4,function(_0x11bb7b){const _0xc61600=a820_0xfd0f;logger[_0xc61600('0x10')](_0x11bb7b['stack']),_0x11bb7b[_0xc61600('0x9')]&&delete _0x11bb7b[_0xc61600('0x9')],_0x3291a9[_0xc61600('0x11')](_0x7843c7)[_0xc61600('0x2a')](_0x11bb7b);};}exports[_0x5b9fe7('0x2b')]=function(_0x4a04c0,_0x87e40c){const _0x28639e=_0x5b9fe7;let _0x451a50={};const _0x2995ec={},_0x2dafe5={'count':0x0,'rows':[]},_0x2831d1=_[_0x28639e('0x13')](db[_0x28639e('0xd')][_0x28639e('0xf')],function(_0x4fa698){const _0x1d4589=_0x28639e;return{'name':_0x4fa698[_0x1d4589('0x5')],'type':_0x4fa698['type'][_0x1d4589('0x18')]};});_0x2995ec[_0x28639e('0x14')]=_[_0x28639e('0x13')](_0x2831d1,_0x28639e('0x9')),_0x2995ec['query']=_[_0x28639e('0x19')](_0x4a04c0[_0x28639e('0xe')]),_0x2995ec[_0x28639e('0x0')]=_[_0x28639e('0xb')](_0x2995ec[_0x28639e('0x14')],_0x2995ec[_0x28639e('0xe')]),_0x451a50[_0x28639e('0x25')]=_[_0x28639e('0xb')](_0x2995ec['model'],qs[_0x28639e('0x27')](_0x4a04c0[_0x28639e('0xe')][_0x28639e('0x27')])),_0x451a50[_0x28639e('0x25')]=_0x451a50[_0x28639e('0x25')][_0x28639e('0x17')]?_0x451a50[_0x28639e('0x25')]:_0x2995ec[_0x28639e('0x14')];typeof _0x4a04c0[_0x28639e('0xe')][_0x28639e('0x2c')]===_0x28639e('0x24')&&(_0x451a50[_0x28639e('0x29')]=qs['limit'](_0x4a04c0[_0x28639e('0xe')][_0x28639e('0x29')]),_0x451a50['offset']=qs[_0x28639e('0x2')](_0x4a04c0['query'][_0x28639e('0x2')]));_0x451a50[_0x28639e('0x28')]=qs[_0x28639e('0x2f')](_0x4a04c0[_0x28639e('0xe')]['sort']),_0x451a50[_0x28639e('0x22')]=qs['filters'](_[_0x28639e('0x1d')](_0x4a04c0['query'],_0x2995ec[_0x28639e('0x0')]),_0x2831d1);_0x4a04c0[_0x28639e('0xe')][_0x28639e('0x12')]&&(_0x451a50['where']=_[_0x28639e('0x1')](_0x451a50[_0x28639e('0x22')],{[Op['or']]:_['map'](_0x2831d1,function(_0x1d7ff3){const _0x29bca4=_0x28639e;if(_0x1d7ff3[_0x29bca4('0x30')]!=='VIRTUAL'){const _0x52d336={};return _0x52d336[_0x1d7ff3[_0x29bca4('0x9')]]={[Op[_0x29bca4('0x4')]]:'%'+_0x4a04c0[_0x29bca4('0xe')][_0x29bca4('0x12')]+'%'},_0x52d336;}})}));_0x451a50=_[_0x28639e('0x1')]({},_0x451a50,_0x4a04c0[_0x28639e('0x8')]);const _0x581dfb={'where':_0x451a50[_0x28639e('0x22')]};return db[_0x28639e('0xd')][_0x28639e('0x21')](_0x581dfb)[_0x28639e('0x31')](function(_0x566ef4){const _0x4bcde6=_0x28639e;return _0x2dafe5['count']=_0x566ef4,_0x4a04c0[_0x4bcde6('0xe')]['includeAll']&&(_0x451a50[_0x4bcde6('0x1c')]=[{'all':!![]}]),db[_0x4bcde6('0xd')][_0x4bcde6('0x20')](_0x451a50);})[_0x28639e('0x31')](function(_0xd0d1e5){const _0x72ac5=_0x28639e;return _0x2dafe5[_0x72ac5('0x26')]=_0xd0d1e5,_0x2dafe5;})[_0x28639e('0x31')](respondWithFilteredResult(_0x87e40c,_0x451a50))[_0x28639e('0x1b')](handleError(_0x87e40c,null));},exports[_0x5b9fe7('0x33')]=function(_0x21f4d4,_0xdcde11){const _0x369263=_0x5b9fe7;let _0x12ee21={'raw':!![],'where':{'id':_0x21f4d4[_0x369263('0x2e')]['id']}};const _0x5643a0={};return _0x5643a0['model']=_['keys'](db[_0x369263('0xd')][_0x369263('0xf')]),_0x5643a0['query']=_[_0x369263('0x19')](_0x21f4d4['query']),_0x5643a0[_0x369263('0x0')]=_[_0x369263('0xb')](_0x5643a0[_0x369263('0x14')],_0x5643a0[_0x369263('0xe')]),_0x12ee21[_0x369263('0x25')]=_[_0x369263('0xb')](_0x5643a0[_0x369263('0x14')],qs['fields'](_0x21f4d4[_0x369263('0xe')][_0x369263('0x27')])),_0x12ee21[_0x369263('0x25')]=_0x12ee21['attributes'][_0x369263('0x17')]?_0x12ee21['attributes']:_0x5643a0['model'],_0x21f4d4[_0x369263('0xe')]['includeAll']&&(_0x12ee21['include']=[{'all':!![]}]),_0x12ee21=_['merge']({},_0x12ee21,_0x21f4d4['options']),db[_0x369263('0xd')][_0x369263('0x3')](_0x12ee21)['then'](handleEntityNotFound(_0xdcde11,null))[_0x369263('0x31')](respondWithResult(_0xdcde11,null))['catch'](handleError(_0xdcde11,null));},exports[_0x5b9fe7('0xa')]=function(_0x30a349,_0x1a0c68){const _0x34df7e=_0x5b9fe7;return db[_0x34df7e('0xd')][_0x34df7e('0xa')](_0x30a349[_0x34df7e('0x23')],{})['then'](respondWithResult(_0x1a0c68,0xc9))[_0x34df7e('0x1b')](handleError(_0x1a0c68,null));},exports[_0x5b9fe7('0xc')]=function(_0x3a824c,_0x2fa1e6){const _0x17f1d4=_0x5b9fe7;return _0x3a824c['body']['id']&&delete _0x3a824c[_0x17f1d4('0x23')]['id'],db[_0x17f1d4('0xd')][_0x17f1d4('0x3')]({'where':{'id':_0x3a824c[_0x17f1d4('0x2e')]['id']}})[_0x17f1d4('0x31')](handleEntityNotFound(_0x2fa1e6,null))[_0x17f1d4('0x31')](saveUpdates(_0x3a824c[_0x17f1d4('0x23')],null))[_0x17f1d4('0x31')](respondWithResult(_0x2fa1e6,null))['catch'](handleError(_0x2fa1e6,null));},exports['destroy']=function(_0x455064,_0x4ecb4c){const _0xe314c9=_0x5b9fe7;return db[_0xe314c9('0xd')][_0xe314c9('0x3')]({'where':{'id':_0x455064[_0xe314c9('0x2e')]['id']}})[_0xe314c9('0x31')](handleEntityNotFound(_0x4ecb4c,null))['then'](removeEntity(_0x4ecb4c,null))['catch'](handleError(_0x4ecb4c,null));},exports[_0x5b9fe7('0x6')]=function(_0x214bea,_0x1791e4){const _0x3fb154=_0x5b9fe7;return db['WhatsappTransferReport'][_0x3fb154('0x6')]()[_0x3fb154('0x31')](respondWithResult(_0x1791e4,null))[_0x3fb154('0x1b')](handleError(_0x1791e4,null));};
\ No newline at end of file
+const a820_0x47e2=['name','stack','key','type','describe','map','attributes','../../components/parsers/qs','fieldName','offset','filters','like','then','index','update','nolimit','show','filter','json','set','pick','sendStatus','Content-Range','../../mysqldb','where','keys','undefined','count','WhatsappTransferReport','fields','query','intersection','merge','sequelize','rawAttributes','params','status','model','findOne','catch','sort','../../config/logger','VIRTUAL','limit','error','include','includeAll','destroy','order','body','length','create'];(function(_0x18dc1f,_0x47e264){const _0x3c5b77=function(_0x6abf2a){while(--_0x6abf2a){_0x18dc1f['push'](_0x18dc1f['shift']());}};_0x3c5b77(++_0x47e264);}(a820_0x47e2,0x1c9));const a820_0x3c5b=function(_0x18dc1f,_0x47e264){_0x18dc1f=_0x18dc1f-0x0;let _0x3c5b77=a820_0x47e2[_0x18dc1f];return _0x3c5b77;};const _0xe391d6=a820_0x3c5b;'use strict';const _=require('lodash'),qs=require(_0xe391d6('0x12')),logger=require(_0xe391d6('0x0'))('api'),db=require(_0xe391d6('0x22'))['db'],{Op}=require(_0xe391d6('0x2c'));function respondWithResult(_0x6abf2a,_0x59d659){return _0x59d659=_0x59d659||0xc8,function(_0x1e2e67){const _0x43a390=a820_0x3c5b;if(_0x1e2e67)return _0x6abf2a[_0x43a390('0x2f')](_0x59d659)[_0x43a390('0x1d')](_0x1e2e67);};}function respondWithFilteredResult(_0x284899,_0x1758ba){return function(_0x3c5275){const _0x1003ce=a820_0x3c5b;if(_0x3c5275){const _0x49c166=_0x3c5275[_0x1003ce('0x26')],_0x3a7f1e=_0x1758ba[_0x1003ce('0x14')];let _0xdb4fb1=_0x1758ba['offset']+_0x1758ba['limit'],_0x191a21;return _0xdb4fb1>=_0x49c166?(_0xdb4fb1=_0x49c166,_0x191a21=0xc8):_0x191a21=0xce,_0x284899[_0x1003ce('0x2f')](_0x191a21),_0x284899[_0x1003ce('0x1e')](_0x1003ce('0x21'),_0x3a7f1e+'-'+_0xdb4fb1+'/'+_0x49c166)[_0x1003ce('0x1d')](_0x3c5275);}return null;};}function saveUpdates(_0x5dc303){return function(_0x278612){const _0x3dd179=a820_0x3c5b;if(_0x278612)return _0x278612[_0x3dd179('0x19')](_0x5dc303)[_0x3dd179('0x17')](function(_0x4fc53f){return _0x4fc53f;});return null;};}function removeEntity(_0x3bb517){return function(_0x348ef0){const _0x1f8b74=a820_0x3c5b;if(_0x348ef0)return _0x348ef0[_0x1f8b74('0x6')]()['then'](function(){const _0x4864ef=_0x1f8b74;_0x3bb517[_0x4864ef('0x2f')](0xcc)['end']();});};}function handleEntityNotFound(_0x3251bd){return function(_0x9d6311){const _0x5164f0=a820_0x3c5b;return!_0x9d6311&&_0x3251bd[_0x5164f0('0x20')](0x194),_0x9d6311;};}function handleError(_0x1a71e1,_0x4d1c9a){return _0x4d1c9a=_0x4d1c9a||0x1f4,function(_0x31455f){const _0x140c06=a820_0x3c5b;logger[_0x140c06('0x3')](_0x31455f[_0x140c06('0xc')]),_0x31455f[_0x140c06('0xb')]&&delete _0x31455f[_0x140c06('0xb')],_0x1a71e1[_0x140c06('0x2f')](_0x4d1c9a)['send'](_0x31455f);};}exports[_0xe391d6('0x18')]=function(_0x1d7b36,_0x14721f){const _0x80a8cf=_0xe391d6;let _0x246851={};const _0x32ea2f={},_0x13f05c={'count':0x0,'rows':[]},_0x1de343=_[_0x80a8cf('0x10')](db['WhatsappTransferReport']['rawAttributes'],function(_0x20d104){const _0x1d6200=_0x80a8cf;return{'name':_0x20d104[_0x1d6200('0x13')],'type':_0x20d104[_0x1d6200('0xe')][_0x1d6200('0xd')]};});_0x32ea2f['model']=_[_0x80a8cf('0x10')](_0x1de343,_0x80a8cf('0xb')),_0x32ea2f['query']=_[_0x80a8cf('0x24')](_0x1d7b36[_0x80a8cf('0x29')]),_0x32ea2f[_0x80a8cf('0x15')]=_[_0x80a8cf('0x2a')](_0x32ea2f[_0x80a8cf('0x30')],_0x32ea2f[_0x80a8cf('0x29')]),_0x246851[_0x80a8cf('0x11')]=_['intersection'](_0x32ea2f[_0x80a8cf('0x30')],qs['fields'](_0x1d7b36[_0x80a8cf('0x29')][_0x80a8cf('0x28')])),_0x246851['attributes']=_0x246851[_0x80a8cf('0x11')][_0x80a8cf('0x9')]?_0x246851[_0x80a8cf('0x11')]:_0x32ea2f[_0x80a8cf('0x30')];typeof _0x1d7b36[_0x80a8cf('0x29')][_0x80a8cf('0x1a')]===_0x80a8cf('0x25')&&(_0x246851[_0x80a8cf('0x2')]=qs[_0x80a8cf('0x2')](_0x1d7b36[_0x80a8cf('0x29')][_0x80a8cf('0x2')]),_0x246851[_0x80a8cf('0x14')]=qs['offset'](_0x1d7b36[_0x80a8cf('0x29')][_0x80a8cf('0x14')]));_0x246851[_0x80a8cf('0x7')]=qs['sort'](_0x1d7b36[_0x80a8cf('0x29')][_0x80a8cf('0x33')]),_0x246851[_0x80a8cf('0x23')]=qs[_0x80a8cf('0x15')](_[_0x80a8cf('0x1f')](_0x1d7b36['query'],_0x32ea2f[_0x80a8cf('0x15')]),_0x1de343);_0x1d7b36[_0x80a8cf('0x29')][_0x80a8cf('0x1c')]&&(_0x246851[_0x80a8cf('0x23')]=_['merge'](_0x246851[_0x80a8cf('0x23')],{[Op['or']]:_[_0x80a8cf('0x10')](_0x1de343,function(_0xad1e24){const _0x41d931=_0x80a8cf;if(_0xad1e24['type']!==_0x41d931('0x1')){const _0x311c62={};return _0x311c62[_0xad1e24[_0x41d931('0xb')]]={[Op[_0x41d931('0x16')]]:'%'+_0x1d7b36[_0x41d931('0x29')][_0x41d931('0x1c')]+'%'},_0x311c62;}})}));_0x246851=_[_0x80a8cf('0x2b')]({},_0x246851,_0x1d7b36['options']);const _0x45a5cb={'where':_0x246851[_0x80a8cf('0x23')]};return db[_0x80a8cf('0x27')][_0x80a8cf('0x26')](_0x45a5cb)[_0x80a8cf('0x17')](function(_0x41b1ad){const _0x2b3322=_0x80a8cf;return _0x13f05c[_0x2b3322('0x26')]=_0x41b1ad,_0x1d7b36[_0x2b3322('0x29')]['includeAll']&&(_0x246851['include']=[{'all':!![]}]),db[_0x2b3322('0x27')]['findAll'](_0x246851);})[_0x80a8cf('0x17')](function(_0x272558){return _0x13f05c['rows']=_0x272558,_0x13f05c;})[_0x80a8cf('0x17')](respondWithFilteredResult(_0x14721f,_0x246851))[_0x80a8cf('0x32')](handleError(_0x14721f,null));},exports[_0xe391d6('0x1b')]=function(_0x300eae,_0x4fd10d){const _0x1e6cff=_0xe391d6;let _0xba4ec4={'raw':!![],'where':{'id':_0x300eae[_0x1e6cff('0x2e')]['id']}};const _0x289412={};return _0x289412[_0x1e6cff('0x30')]=_[_0x1e6cff('0x24')](db[_0x1e6cff('0x27')][_0x1e6cff('0x2d')]),_0x289412['query']=_[_0x1e6cff('0x24')](_0x300eae[_0x1e6cff('0x29')]),_0x289412['filters']=_['intersection'](_0x289412[_0x1e6cff('0x30')],_0x289412[_0x1e6cff('0x29')]),_0xba4ec4['attributes']=_[_0x1e6cff('0x2a')](_0x289412[_0x1e6cff('0x30')],qs[_0x1e6cff('0x28')](_0x300eae[_0x1e6cff('0x29')][_0x1e6cff('0x28')])),_0xba4ec4[_0x1e6cff('0x11')]=_0xba4ec4[_0x1e6cff('0x11')][_0x1e6cff('0x9')]?_0xba4ec4[_0x1e6cff('0x11')]:_0x289412['model'],_0x300eae[_0x1e6cff('0x29')][_0x1e6cff('0x5')]&&(_0xba4ec4[_0x1e6cff('0x4')]=[{'all':!![]}]),_0xba4ec4=_[_0x1e6cff('0x2b')]({},_0xba4ec4,_0x300eae['options']),db[_0x1e6cff('0x27')]['findOne'](_0xba4ec4)[_0x1e6cff('0x17')](handleEntityNotFound(_0x4fd10d,null))[_0x1e6cff('0x17')](respondWithResult(_0x4fd10d,null))['catch'](handleError(_0x4fd10d,null));},exports[_0xe391d6('0xa')]=function(_0x1c120f,_0xc37d04){const _0x1a0b15=_0xe391d6;return db[_0x1a0b15('0x27')]['create'](_0x1c120f[_0x1a0b15('0x8')],{})[_0x1a0b15('0x17')](respondWithResult(_0xc37d04,0xc9))[_0x1a0b15('0x32')](handleError(_0xc37d04,null));},exports[_0xe391d6('0x19')]=function(_0x4f96c9,_0x1dd5a){const _0x45f6c3=_0xe391d6;return _0x4f96c9[_0x45f6c3('0x8')]['id']&&delete _0x4f96c9[_0x45f6c3('0x8')]['id'],db[_0x45f6c3('0x27')][_0x45f6c3('0x31')]({'where':{'id':_0x4f96c9[_0x45f6c3('0x2e')]['id']}})[_0x45f6c3('0x17')](handleEntityNotFound(_0x1dd5a,null))['then'](saveUpdates(_0x4f96c9[_0x45f6c3('0x8')],null))['then'](respondWithResult(_0x1dd5a,null))[_0x45f6c3('0x32')](handleError(_0x1dd5a,null));},exports['destroy']=function(_0x825ab9,_0x1dee95){const _0x204d2e=_0xe391d6;return db[_0x204d2e('0x27')][_0x204d2e('0x31')]({'where':{'id':_0x825ab9[_0x204d2e('0x2e')]['id']}})[_0x204d2e('0x17')](handleEntityNotFound(_0x1dee95,null))[_0x204d2e('0x17')](removeEntity(_0x1dee95,null))[_0x204d2e('0x32')](handleError(_0x1dee95,null));},exports[_0xe391d6('0xf')]=function(_0x43a8fb,_0xfb59ac){const _0x56d422=_0xe391d6;return db[_0x56d422('0x27')]['describe']()[_0x56d422('0x17')](respondWithResult(_0xfb59ac,null))[_0x56d422('0x32')](handleError(_0xfb59ac,null));};
\ No newline at end of file