Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / whatsappTransferReport / whatsappTransferReport.controller.js
index 59ab3d9..9de7aba 100644 (file)
@@ -1 +1 @@
-const a981_0x4e3e=['map','params','catch','findOne','keys','nolimit','set','lodash','show','include','includeAll','merge','body','offset','destroy','stack','then','sendStatus','../../components/parsers/qs','where','../../config/logger','limit','findAll','describe','WhatsappTransferReport','json','count','type','sequelize','create','fieldName','options','like','attributes','error','update','query','filters','VIRTUAL','end','Content-Range','filter','order','key','rawAttributes','pick','length','name','api','fields','model','status','intersection','sort'];(function(_0x18d319,_0x4bf201){const _0x4e3e8a=function(_0x4e8234){while(--_0x4e8234){_0x18d319['push'](_0x18d319['shift']());}};_0x4e3e8a(++_0x4bf201);}(a981_0x4e3e,0x1c3));const a981_0x4e82=function(_0x18d319,_0x4bf201){_0x18d319=_0x18d319-0xf2;let _0x4e3e8a=a981_0x4e3e[_0x18d319];return _0x4e3e8a;};const a981_0x1baf96=a981_0x4e82;'use strict';const _=require(a981_0x1baf96(0x11c)),qs=require(a981_0x1baf96(0x127)),logger=require(a981_0x1baf96(0xf3))(a981_0x1baf96(0x10f)),{db}=require('../../mysqldb'),{Op}=require(a981_0x1baf96(0xfb));function respondWithResult(_0x27181a,_0xf619e){return _0xf619e=_0xf619e||0xc8,function(_0x3c5dbf){const _0x4833e9=a981_0x4e82;if(_0x3c5dbf)return _0x27181a['status'](_0xf619e)[_0x4833e9(0xf8)](_0x3c5dbf);};}function respondWithFilteredResult(_0x49f42a,_0x597fd9){return function(_0x36444f){const _0x4f0731=a981_0x4e82;if(_0x36444f){const _0x3f8c01=_0x36444f[_0x4f0731(0xf9)],_0x5378b8=_0x597fd9[_0x4f0731(0x122)];let _0x38ec7f=_0x597fd9[_0x4f0731(0x122)]+_0x597fd9[_0x4f0731(0xf4)],_0x5e0bf4;return _0x38ec7f>=_0x3f8c01?(_0x38ec7f=_0x3f8c01,_0x5e0bf4=0xc8):_0x5e0bf4=0xce,_0x49f42a[_0x4f0731(0x112)](_0x5e0bf4),_0x49f42a[_0x4f0731(0x11b)](_0x4f0731(0x107),_0x5378b8+'-'+_0x38ec7f+'/'+_0x3f8c01)[_0x4f0731(0xf8)](_0x36444f);}return null;};}function saveUpdates(_0x468a38){return function(_0x2d016a){const _0x30d925=a981_0x4e82;if(_0x2d016a)return _0x2d016a['update'](_0x468a38)[_0x30d925(0x125)](function(_0x39e02f){return _0x39e02f;});return null;};}function removeEntity(_0x2e209c){return function(_0x9012ae){const _0x3f6e8c=a981_0x4e82;if(_0x9012ae)return _0x9012ae[_0x3f6e8c(0x123)]()[_0x3f6e8c(0x125)](function(){const _0x43ae69=_0x3f6e8c;_0x2e209c[_0x43ae69(0x112)](0xcc)[_0x43ae69(0x106)]();});};}function handleEntityNotFound(_0x535233){return function(_0x6b487b){const _0x507c72=a981_0x4e82;return!_0x6b487b&&_0x535233[_0x507c72(0x126)](0x194),_0x6b487b;};}function handleError(_0x3a4671,_0x378c9c){return _0x378c9c=_0x378c9c||0x1f4,function(_0x292543){const _0x6925fb=a981_0x4e82;logger[_0x6925fb(0x101)](_0x292543[_0x6925fb(0x124)]),_0x292543[_0x6925fb(0x10e)]&&delete _0x292543[_0x6925fb(0x10e)],_0x3a4671[_0x6925fb(0x112)](_0x378c9c)['send'](_0x292543);};}exports['index']=function(_0x340238,_0x42e84b){const _0x117407=a981_0x1baf96;let _0x500ad3={};const _0x25629b={},_0x36875d={'count':0x0,'rows':[]},_0x55453d=_[_0x117407(0x115)](db[_0x117407(0xf7)][_0x117407(0x10b)],function(_0x49bc87){const _0x37181f=_0x117407;return{'name':_0x49bc87[_0x37181f(0xfd)],'type':_0x49bc87[_0x37181f(0xfa)][_0x37181f(0x10a)]};});_0x25629b[_0x117407(0x111)]=_[_0x117407(0x115)](_0x55453d,_0x117407(0x10e)),_0x25629b['query']=_[_0x117407(0x119)](_0x340238[_0x117407(0x103)]),_0x25629b[_0x117407(0x104)]=_[_0x117407(0x113)](_0x25629b[_0x117407(0x111)],_0x25629b[_0x117407(0x103)]),_0x500ad3[_0x117407(0x100)]=_['intersection'](_0x25629b[_0x117407(0x111)],qs[_0x117407(0x110)](_0x340238[_0x117407(0x103)][_0x117407(0x110)])),_0x500ad3['attributes']=_0x500ad3[_0x117407(0x100)][_0x117407(0x10d)]?_0x500ad3['attributes']:_0x25629b[_0x117407(0x111)];typeof _0x340238[_0x117407(0x103)][_0x117407(0x11a)]==='undefined'&&(_0x500ad3[_0x117407(0xf4)]=qs[_0x117407(0xf4)](_0x340238['query']['limit']),_0x500ad3[_0x117407(0x122)]=qs[_0x117407(0x122)](_0x340238[_0x117407(0x103)]['offset']));_0x500ad3[_0x117407(0x109)]=qs[_0x117407(0x114)](_0x340238[_0x117407(0x103)][_0x117407(0x114)]),_0x500ad3[_0x117407(0xf2)]=qs[_0x117407(0x104)](_[_0x117407(0x10c)](_0x340238[_0x117407(0x103)],_0x25629b['filters']),_0x55453d);_0x340238[_0x117407(0x103)][_0x117407(0x108)]&&(_0x500ad3['where']=_[_0x117407(0x120)](_0x500ad3[_0x117407(0xf2)],{[Op['or']]:_[_0x117407(0x115)](_0x55453d,function(_0x5447f0){const _0x34a76a=_0x117407;if(_0x5447f0[_0x34a76a(0xfa)]!==_0x34a76a(0x105)){const _0x3dafcf={};return _0x3dafcf[_0x5447f0[_0x34a76a(0x10e)]]={[Op[_0x34a76a(0xff)]]:'%'+_0x340238[_0x34a76a(0x103)]['filter']+'%'},_0x3dafcf;}})}));_0x500ad3=_[_0x117407(0x120)]({},_0x500ad3,_0x340238[_0x117407(0xfe)]);const _0x2c2cb5={'where':_0x500ad3[_0x117407(0xf2)]};return db[_0x117407(0xf7)][_0x117407(0xf9)](_0x2c2cb5)['then'](function(_0x381afb){const _0x4c89cd=_0x117407;return _0x36875d[_0x4c89cd(0xf9)]=_0x381afb,_0x340238[_0x4c89cd(0x103)]['includeAll']&&(_0x500ad3[_0x4c89cd(0x11e)]=[{'all':!![]}]),db[_0x4c89cd(0xf7)][_0x4c89cd(0xf5)](_0x500ad3);})[_0x117407(0x125)](function(_0x3b11d6){return _0x36875d['rows']=_0x3b11d6,_0x36875d;})[_0x117407(0x125)](respondWithFilteredResult(_0x42e84b,_0x500ad3))['catch'](handleError(_0x42e84b,null));},exports[a981_0x1baf96(0x11d)]=function(_0x2a5053,_0x18028b){const _0x5acc9f=a981_0x1baf96;let _0x346136={'raw':!![],'where':{'id':_0x2a5053[_0x5acc9f(0x116)]['id']}};const _0xf65a15={};return _0xf65a15['model']=_[_0x5acc9f(0x119)](db[_0x5acc9f(0xf7)][_0x5acc9f(0x10b)]),_0xf65a15[_0x5acc9f(0x103)]=_[_0x5acc9f(0x119)](_0x2a5053[_0x5acc9f(0x103)]),_0xf65a15[_0x5acc9f(0x104)]=_[_0x5acc9f(0x113)](_0xf65a15[_0x5acc9f(0x111)],_0xf65a15[_0x5acc9f(0x103)]),_0x346136[_0x5acc9f(0x100)]=_['intersection'](_0xf65a15[_0x5acc9f(0x111)],qs[_0x5acc9f(0x110)](_0x2a5053['query'][_0x5acc9f(0x110)])),_0x346136[_0x5acc9f(0x100)]=_0x346136['attributes']['length']?_0x346136[_0x5acc9f(0x100)]:_0xf65a15['model'],_0x2a5053[_0x5acc9f(0x103)][_0x5acc9f(0x11f)]&&(_0x346136[_0x5acc9f(0x11e)]=[{'all':!![]}]),_0x346136=_[_0x5acc9f(0x120)]({},_0x346136,_0x2a5053[_0x5acc9f(0xfe)]),db[_0x5acc9f(0xf7)][_0x5acc9f(0x118)](_0x346136)[_0x5acc9f(0x125)](handleEntityNotFound(_0x18028b,null))[_0x5acc9f(0x125)](respondWithResult(_0x18028b,null))[_0x5acc9f(0x117)](handleError(_0x18028b,null));},exports[a981_0x1baf96(0xfc)]=function(_0x5792fb,_0x2fdfe3){const _0x386ae1=a981_0x1baf96;return db[_0x386ae1(0xf7)]['create'](_0x5792fb[_0x386ae1(0x121)],{})[_0x386ae1(0x125)](respondWithResult(_0x2fdfe3,0xc9))[_0x386ae1(0x117)](handleError(_0x2fdfe3,null));},exports[a981_0x1baf96(0x102)]=function(_0x157933,_0x3204f8){const _0x231c60=a981_0x1baf96;return _0x157933[_0x231c60(0x121)]['id']&&delete _0x157933[_0x231c60(0x121)]['id'],db[_0x231c60(0xf7)][_0x231c60(0x118)]({'where':{'id':_0x157933['params']['id']}})[_0x231c60(0x125)](handleEntityNotFound(_0x3204f8,null))[_0x231c60(0x125)](saveUpdates(_0x157933[_0x231c60(0x121)],null))[_0x231c60(0x125)](respondWithResult(_0x3204f8,null))[_0x231c60(0x117)](handleError(_0x3204f8,null));},exports['destroy']=function(_0x167c6b,_0x11051d){const _0x3f11d9=a981_0x1baf96;return db[_0x3f11d9(0xf7)]['findOne']({'where':{'id':_0x167c6b['params']['id']}})['then'](handleEntityNotFound(_0x11051d,null))[_0x3f11d9(0x125)](removeEntity(_0x11051d,null))[_0x3f11d9(0x117)](handleError(_0x11051d,null));},exports[a981_0x1baf96(0xf6)]=function(_0x50628c,_0x172bab){const _0x3c950a=a981_0x1baf96;return db[_0x3c950a(0xf7)][_0x3c950a(0xf6)]()['then'](respondWithResult(_0x172bab,null))[_0x3c950a(0x117)](handleError(_0x172bab,null));};
\ No newline at end of file
+const a981_0xede8=['count','name','params','findOne','create','length','catch','nolimit','sort','map','rows','like','sendStatus','WhatsappTransferReport','attributes','keys','filters','include','then','options','body','intersection','order','query','findAll','where','error','status','Content-Range','update','filter','lodash','rawAttributes','offset','limit','undefined','describe','destroy','../../mysqldb','api','model','sequelize','../../config/logger','key','fields','includeAll','show','merge','json','end','VIRTUAL'];(function(_0x11ea5c,_0x1fd6cf){const _0xede858=function(_0x5b2141){while(--_0x5b2141){_0x11ea5c['push'](_0x11ea5c['shift']());}};_0xede858(++_0x1fd6cf);}(a981_0xede8,0xcf));const a981_0x5b21=function(_0x11ea5c,_0x1fd6cf){_0x11ea5c=_0x11ea5c-0x165;let _0xede858=a981_0xede8[_0x11ea5c];return _0xede858;};const a981_0x22c12f=a981_0x5b21;'use strict';const _=require(a981_0x22c12f(0x181)),qs=require('../../components/parsers/qs'),logger=require(a981_0x22c12f(0x18c))(a981_0x22c12f(0x189)),{db}=require(a981_0x22c12f(0x188)),{Op}=require(a981_0x22c12f(0x18b));function respondWithResult(_0x1d46b1,_0x4cfdd4){return _0x4cfdd4=_0x4cfdd4||0xc8,function(_0x331fce){if(_0x331fce)return _0x1d46b1['status'](_0x4cfdd4)['json'](_0x331fce);};}function respondWithFilteredResult(_0x34c03b,_0x38d33d){return function(_0x566ec3){const _0x32cb49=a981_0x5b21;if(_0x566ec3){const _0x113fdf=_0x566ec3[_0x32cb49(0x195)],_0x481657=_0x38d33d[_0x32cb49(0x183)];let _0x701c68=_0x38d33d[_0x32cb49(0x183)]+_0x38d33d[_0x32cb49(0x184)],_0x57f4e7;return _0x701c68>=_0x113fdf?(_0x701c68=_0x113fdf,_0x57f4e7=0xc8):_0x57f4e7=0xce,_0x34c03b[_0x32cb49(0x17d)](_0x57f4e7),_0x34c03b['set'](_0x32cb49(0x17e),_0x481657+'-'+_0x701c68+'/'+_0x113fdf)[_0x32cb49(0x192)](_0x566ec3);}return null;};}function saveUpdates(_0x375c74){return function(_0x18eaff){const _0xe65ee2=a981_0x5b21;if(_0x18eaff)return _0x18eaff['update'](_0x375c74)[_0xe65ee2(0x174)](function(_0x332f6f){return _0x332f6f;});return null;};}function removeEntity(_0x4bef6b){return function(_0x66d228){const _0x13a224=a981_0x5b21;if(_0x66d228)return _0x66d228[_0x13a224(0x187)]()[_0x13a224(0x174)](function(){const _0x27fffa=_0x13a224;_0x4bef6b[_0x27fffa(0x17d)](0xcc)[_0x27fffa(0x193)]();});};}function handleEntityNotFound(_0x4fc51f){return function(_0x39569a){const _0x43ade4=a981_0x5b21;return!_0x39569a&&_0x4fc51f[_0x43ade4(0x16e)](0x194),_0x39569a;};}function handleError(_0x2540e9,_0x526d60){return _0x526d60=_0x526d60||0x1f4,function(_0xae47cf){const _0x5d31b3=a981_0x5b21;logger[_0x5d31b3(0x17c)](_0xae47cf['stack']),_0xae47cf[_0x5d31b3(0x196)]&&delete _0xae47cf[_0x5d31b3(0x196)],_0x2540e9[_0x5d31b3(0x17d)](_0x526d60)['send'](_0xae47cf);};}exports['index']=function(_0x37dd9b,_0x42d296){const _0x57fe83=a981_0x22c12f;let _0x40c5f7={};const _0x3405bc={},_0x25f997={'count':0x0,'rows':[]},_0x2868a9=_[_0x57fe83(0x16b)](db[_0x57fe83(0x16f)][_0x57fe83(0x182)],function(_0x2173d7){const _0x14e41d=_0x57fe83;return{'name':_0x2173d7['fieldName'],'type':_0x2173d7['type'][_0x14e41d(0x18d)]};});_0x3405bc[_0x57fe83(0x18a)]=_['map'](_0x2868a9,_0x57fe83(0x196)),_0x3405bc[_0x57fe83(0x179)]=_[_0x57fe83(0x171)](_0x37dd9b[_0x57fe83(0x179)]),_0x3405bc[_0x57fe83(0x172)]=_[_0x57fe83(0x177)](_0x3405bc[_0x57fe83(0x18a)],_0x3405bc[_0x57fe83(0x179)]),_0x40c5f7['attributes']=_['intersection'](_0x3405bc[_0x57fe83(0x18a)],qs[_0x57fe83(0x18e)](_0x37dd9b[_0x57fe83(0x179)][_0x57fe83(0x18e)])),_0x40c5f7[_0x57fe83(0x170)]=_0x40c5f7[_0x57fe83(0x170)][_0x57fe83(0x167)]?_0x40c5f7['attributes']:_0x3405bc[_0x57fe83(0x18a)];typeof _0x37dd9b['query'][_0x57fe83(0x169)]===_0x57fe83(0x185)&&(_0x40c5f7[_0x57fe83(0x184)]=qs[_0x57fe83(0x184)](_0x37dd9b[_0x57fe83(0x179)]['limit']),_0x40c5f7[_0x57fe83(0x183)]=qs[_0x57fe83(0x183)](_0x37dd9b[_0x57fe83(0x179)][_0x57fe83(0x183)]));_0x40c5f7[_0x57fe83(0x178)]=qs[_0x57fe83(0x16a)](_0x37dd9b[_0x57fe83(0x179)][_0x57fe83(0x16a)]),_0x40c5f7[_0x57fe83(0x17b)]=qs[_0x57fe83(0x172)](_['pick'](_0x37dd9b[_0x57fe83(0x179)],_0x3405bc['filters']),_0x2868a9);_0x37dd9b[_0x57fe83(0x179)][_0x57fe83(0x180)]&&(_0x40c5f7[_0x57fe83(0x17b)]=_[_0x57fe83(0x191)](_0x40c5f7[_0x57fe83(0x17b)],{[Op['or']]:_['map'](_0x2868a9,function(_0xfa08c6){const _0x357848=_0x57fe83;if(_0xfa08c6['type']!==_0x357848(0x194)){const _0x5e67ab={};return _0x5e67ab[_0xfa08c6[_0x357848(0x196)]]={[Op[_0x357848(0x16d)]]:'%'+_0x37dd9b[_0x357848(0x179)][_0x357848(0x180)]+'%'},_0x5e67ab;}})}));_0x40c5f7=_[_0x57fe83(0x191)]({},_0x40c5f7,_0x37dd9b[_0x57fe83(0x175)]);const _0x5ae61d={'where':_0x40c5f7[_0x57fe83(0x17b)]};return db[_0x57fe83(0x16f)]['count'](_0x5ae61d)[_0x57fe83(0x174)](function(_0x4a6840){const _0x80ee91=_0x57fe83;return _0x25f997[_0x80ee91(0x195)]=_0x4a6840,_0x37dd9b[_0x80ee91(0x179)]['includeAll']&&(_0x40c5f7[_0x80ee91(0x173)]=[{'all':!![]}]),db[_0x80ee91(0x16f)][_0x80ee91(0x17a)](_0x40c5f7);})['then'](function(_0x2166c4){const _0x16d0a0=_0x57fe83;return _0x25f997[_0x16d0a0(0x16c)]=_0x2166c4,_0x25f997;})[_0x57fe83(0x174)](respondWithFilteredResult(_0x42d296,_0x40c5f7))[_0x57fe83(0x168)](handleError(_0x42d296,null));},exports[a981_0x22c12f(0x190)]=function(_0x3844bb,_0xb61a43){const _0x3aecd3=a981_0x22c12f;let _0x1dea1b={'raw':!![],'where':{'id':_0x3844bb[_0x3aecd3(0x197)]['id']}};const _0x4bf1bf={};return _0x4bf1bf[_0x3aecd3(0x18a)]=_[_0x3aecd3(0x171)](db[_0x3aecd3(0x16f)][_0x3aecd3(0x182)]),_0x4bf1bf[_0x3aecd3(0x179)]=_[_0x3aecd3(0x171)](_0x3844bb[_0x3aecd3(0x179)]),_0x4bf1bf['filters']=_['intersection'](_0x4bf1bf['model'],_0x4bf1bf[_0x3aecd3(0x179)]),_0x1dea1b['attributes']=_[_0x3aecd3(0x177)](_0x4bf1bf[_0x3aecd3(0x18a)],qs[_0x3aecd3(0x18e)](_0x3844bb[_0x3aecd3(0x179)][_0x3aecd3(0x18e)])),_0x1dea1b[_0x3aecd3(0x170)]=_0x1dea1b['attributes'][_0x3aecd3(0x167)]?_0x1dea1b[_0x3aecd3(0x170)]:_0x4bf1bf['model'],_0x3844bb['query'][_0x3aecd3(0x18f)]&&(_0x1dea1b['include']=[{'all':!![]}]),_0x1dea1b=_[_0x3aecd3(0x191)]({},_0x1dea1b,_0x3844bb[_0x3aecd3(0x175)]),db[_0x3aecd3(0x16f)][_0x3aecd3(0x165)](_0x1dea1b)[_0x3aecd3(0x174)](handleEntityNotFound(_0xb61a43,null))[_0x3aecd3(0x174)](respondWithResult(_0xb61a43,null))[_0x3aecd3(0x168)](handleError(_0xb61a43,null));},exports['create']=function(_0x171ea7,_0x29cf4f){const _0x84c976=a981_0x22c12f;return db[_0x84c976(0x16f)][_0x84c976(0x166)](_0x171ea7[_0x84c976(0x176)],{})[_0x84c976(0x174)](respondWithResult(_0x29cf4f,0xc9))['catch'](handleError(_0x29cf4f,null));},exports[a981_0x22c12f(0x17f)]=function(_0x5adaf2,_0x421dc3){const _0x596eb3=a981_0x22c12f;return _0x5adaf2[_0x596eb3(0x176)]['id']&&delete _0x5adaf2[_0x596eb3(0x176)]['id'],db['WhatsappTransferReport'][_0x596eb3(0x165)]({'where':{'id':_0x5adaf2[_0x596eb3(0x197)]['id']}})['then'](handleEntityNotFound(_0x421dc3,null))[_0x596eb3(0x174)](saveUpdates(_0x5adaf2[_0x596eb3(0x176)],null))[_0x596eb3(0x174)](respondWithResult(_0x421dc3,null))[_0x596eb3(0x168)](handleError(_0x421dc3,null));},exports['destroy']=function(_0x32e548,_0x24e7e4){const _0x4919ca=a981_0x22c12f;return db[_0x4919ca(0x16f)][_0x4919ca(0x165)]({'where':{'id':_0x32e548[_0x4919ca(0x197)]['id']}})['then'](handleEntityNotFound(_0x24e7e4,null))[_0x4919ca(0x174)](removeEntity(_0x24e7e4,null))[_0x4919ca(0x168)](handleError(_0x24e7e4,null));},exports[a981_0x22c12f(0x186)]=function(_0xd89780,_0x262e9c){const _0x13be06=a981_0x22c12f;return db[_0x13be06(0x16f)][_0x13be06(0x186)]()[_0x13be06(0x174)](respondWithResult(_0x262e9c,null))[_0x13be06(0x168)](handleError(_0x262e9c,null));};
\ No newline at end of file