Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / chatTransferReport / chatTransferReport.controller.js
index c215593..0be58d3 100644 (file)
@@ -1 +1 @@
-const a128_0x8e17=['update','filter','model','../../mysqldb','limit','fields','intersection','stack','VIRTUAL','destroy','api','send','end','../../config/logger','keys','sort','name','ChatTransferReport','body','map','catch','filters','describe','count','nolimit','sendStatus','includeAll','json','create','error','length','query','set','show','where','pick','../../components/parsers/qs','include','then','status','attributes','index','key','offset','options','params','merge','findOne','rawAttributes','sequelize','order'];(function(_0x361838,_0x4fad0b){const _0x8e173b=function(_0x30c30c){while(--_0x30c30c){_0x361838['push'](_0x361838['shift']());}};_0x8e173b(++_0x4fad0b);}(a128_0x8e17,0xe9));const a128_0x30c3=function(_0x361838,_0x4fad0b){_0x361838=_0x361838-0x8c;let _0x8e173b=a128_0x8e17[_0x361838];return _0x8e173b;};const a128_0x15a7bc=a128_0x30c3;'use strict';const _=require('lodash'),qs=require(a128_0x15a7bc(0x93)),logger=require(a128_0x15a7bc(0xaf))(a128_0x15a7bc(0xac)),{db}=require(a128_0x15a7bc(0xa5)),{Op}=require(a128_0x15a7bc(0xa0));function respondWithResult(_0x4cdd8a,_0x571864){return _0x571864=_0x571864||0xc8,function(_0x4649e9){const _0x531f88=a128_0x30c3;if(_0x4649e9)return _0x4cdd8a[_0x531f88(0x96)](_0x571864)['json'](_0x4649e9);};}function respondWithFilteredResult(_0x4ac5b8,_0x1422b8){return function(_0x591164){const _0x35f03b=a128_0x30c3;if(_0x591164){const _0x79b19d=_0x591164[_0x35f03b(0xb9)],_0x5e581c=_0x1422b8['offset'];let _0x3754b0=_0x1422b8['offset']+_0x1422b8[_0x35f03b(0xa6)],_0x1e19d7;return _0x3754b0>=_0x79b19d?(_0x3754b0=_0x79b19d,_0x1e19d7=0xc8):_0x1e19d7=0xce,_0x4ac5b8[_0x35f03b(0x96)](_0x1e19d7),_0x4ac5b8[_0x35f03b(0x8f)]('Content-Range',_0x5e581c+'-'+_0x3754b0+'/'+_0x79b19d)[_0x35f03b(0xbd)](_0x591164);}return null;};}function saveUpdates(_0x5407b6){return function(_0x2ca921){const _0x43e925=a128_0x30c3;if(_0x2ca921)return _0x2ca921[_0x43e925(0xa2)](_0x5407b6)[_0x43e925(0x95)](function(_0x2a0561){return _0x2a0561;});return null;};}function removeEntity(_0x5a8f60){return function(_0x446630){const _0x2f1156=a128_0x30c3;if(_0x446630)return _0x446630[_0x2f1156(0xab)]()['then'](function(){const _0x1272f6=_0x2f1156;_0x5a8f60['status'](0xcc)[_0x1272f6(0xae)]();});};}function handleEntityNotFound(_0x17573d){return function(_0xa6e82a){const _0x3bf03c=a128_0x30c3;return!_0xa6e82a&&_0x17573d[_0x3bf03c(0xbb)](0x194),_0xa6e82a;};}function handleError(_0x2f4692,_0x12f1ec){return _0x12f1ec=_0x12f1ec||0x1f4,function(_0x4bc55d){const _0x544b00=a128_0x30c3;logger[_0x544b00(0x8c)](_0x4bc55d[_0x544b00(0xa9)]),_0x4bc55d[_0x544b00(0xb2)]&&delete _0x4bc55d[_0x544b00(0xb2)],_0x2f4692[_0x544b00(0x96)](_0x12f1ec)[_0x544b00(0xad)](_0x4bc55d);};}exports[a128_0x15a7bc(0x98)]=function(_0x5c87d0,_0x3d8619){const _0x194057=a128_0x15a7bc;let _0x30711e={};const _0x214ef4={},_0x5705a8={'count':0x0,'rows':[]},_0x5cef88=_[_0x194057(0xb5)](db[_0x194057(0xb3)][_0x194057(0x9f)],function(_0x583b8c){const _0x38a313=_0x194057;return{'name':_0x583b8c['fieldName'],'type':_0x583b8c['type'][_0x38a313(0x99)]};});_0x214ef4[_0x194057(0xa4)]=_[_0x194057(0xb5)](_0x5cef88,'name'),_0x214ef4[_0x194057(0x8e)]=_[_0x194057(0xb0)](_0x5c87d0['query']),_0x214ef4[_0x194057(0xb7)]=_[_0x194057(0xa8)](_0x214ef4[_0x194057(0xa4)],_0x214ef4[_0x194057(0x8e)]),_0x30711e['attributes']=_[_0x194057(0xa8)](_0x214ef4[_0x194057(0xa4)],qs['fields'](_0x5c87d0['query']['fields'])),_0x30711e[_0x194057(0x97)]=_0x30711e[_0x194057(0x97)]['length']?_0x30711e[_0x194057(0x97)]:_0x214ef4['model'];typeof _0x5c87d0['query'][_0x194057(0xba)]==='undefined'&&(_0x30711e['limit']=qs[_0x194057(0xa6)](_0x5c87d0[_0x194057(0x8e)][_0x194057(0xa6)]),_0x30711e['offset']=qs[_0x194057(0x9a)](_0x5c87d0['query'][_0x194057(0x9a)]));_0x30711e[_0x194057(0xa1)]=qs[_0x194057(0xb1)](_0x5c87d0[_0x194057(0x8e)]['sort']),_0x30711e[_0x194057(0x91)]=qs[_0x194057(0xb7)](_[_0x194057(0x92)](_0x5c87d0['query'],_0x214ef4[_0x194057(0xb7)]),_0x5cef88);_0x5c87d0[_0x194057(0x8e)][_0x194057(0xa3)]&&(_0x30711e[_0x194057(0x91)]=_['merge'](_0x30711e[_0x194057(0x91)],{[Op['or']]:_[_0x194057(0xb5)](_0x5cef88,function(_0xadd69a){const _0x19506d=_0x194057;if(_0xadd69a['type']!==_0x19506d(0xaa)){const _0x1826c6={};return _0x1826c6[_0xadd69a[_0x19506d(0xb2)]]={[Op['like']]:'%'+_0x5c87d0[_0x19506d(0x8e)][_0x19506d(0xa3)]+'%'},_0x1826c6;}})}));_0x30711e=_[_0x194057(0x9d)]({},_0x30711e,_0x5c87d0[_0x194057(0x9b)]);const _0x3142d3={'where':_0x30711e[_0x194057(0x91)]};return db[_0x194057(0xb3)][_0x194057(0xb9)](_0x3142d3)[_0x194057(0x95)](function(_0x432e3f){const _0x5dc035=_0x194057;return _0x5705a8[_0x5dc035(0xb9)]=_0x432e3f,_0x5c87d0[_0x5dc035(0x8e)][_0x5dc035(0xbc)]&&(_0x30711e[_0x5dc035(0x94)]=[{'all':!![]}]),db[_0x5dc035(0xb3)]['findAll'](_0x30711e);})[_0x194057(0x95)](function(_0x51a6dd){return _0x5705a8['rows']=_0x51a6dd,_0x5705a8;})[_0x194057(0x95)](respondWithFilteredResult(_0x3d8619,_0x30711e))[_0x194057(0xb6)](handleError(_0x3d8619,null));},exports[a128_0x15a7bc(0x90)]=function(_0x7bde26,_0xdf27a7){const _0x2abae7=a128_0x15a7bc;let _0x5941ca={'raw':!![],'where':{'id':_0x7bde26[_0x2abae7(0x9c)]['id']}};const _0x399ac0={};return _0x399ac0['model']=_[_0x2abae7(0xb0)](db[_0x2abae7(0xb3)]['rawAttributes']),_0x399ac0[_0x2abae7(0x8e)]=_[_0x2abae7(0xb0)](_0x7bde26[_0x2abae7(0x8e)]),_0x399ac0['filters']=_[_0x2abae7(0xa8)](_0x399ac0[_0x2abae7(0xa4)],_0x399ac0['query']),_0x5941ca[_0x2abae7(0x97)]=_[_0x2abae7(0xa8)](_0x399ac0[_0x2abae7(0xa4)],qs[_0x2abae7(0xa7)](_0x7bde26[_0x2abae7(0x8e)][_0x2abae7(0xa7)])),_0x5941ca[_0x2abae7(0x97)]=_0x5941ca['attributes'][_0x2abae7(0x8d)]?_0x5941ca[_0x2abae7(0x97)]:_0x399ac0['model'],_0x7bde26[_0x2abae7(0x8e)][_0x2abae7(0xbc)]&&(_0x5941ca[_0x2abae7(0x94)]=[{'all':!![]}]),_0x5941ca=_[_0x2abae7(0x9d)]({},_0x5941ca,_0x7bde26[_0x2abae7(0x9b)]),db[_0x2abae7(0xb3)][_0x2abae7(0x9e)](_0x5941ca)['then'](handleEntityNotFound(_0xdf27a7,null))[_0x2abae7(0x95)](respondWithResult(_0xdf27a7,null))['catch'](handleError(_0xdf27a7,null));},exports[a128_0x15a7bc(0xbe)]=function(_0x29178f,_0x3be5ab){const _0x3e5e42=a128_0x15a7bc;return db[_0x3e5e42(0xb3)][_0x3e5e42(0xbe)](_0x29178f[_0x3e5e42(0xb4)],{})[_0x3e5e42(0x95)](respondWithResult(_0x3be5ab,0xc9))[_0x3e5e42(0xb6)](handleError(_0x3be5ab,null));},exports[a128_0x15a7bc(0xa2)]=function(_0x80b61b,_0x51a157){const _0x5e7813=a128_0x15a7bc;return _0x80b61b[_0x5e7813(0xb4)]['id']&&delete _0x80b61b[_0x5e7813(0xb4)]['id'],db[_0x5e7813(0xb3)][_0x5e7813(0x9e)]({'where':{'id':_0x80b61b[_0x5e7813(0x9c)]['id']}})[_0x5e7813(0x95)](handleEntityNotFound(_0x51a157,null))[_0x5e7813(0x95)](saveUpdates(_0x80b61b[_0x5e7813(0xb4)],null))[_0x5e7813(0x95)](respondWithResult(_0x51a157,null))[_0x5e7813(0xb6)](handleError(_0x51a157,null));},exports[a128_0x15a7bc(0xab)]=function(_0x24d0d9,_0x54ccdd){const _0xf2b6b3=a128_0x15a7bc;return db[_0xf2b6b3(0xb3)][_0xf2b6b3(0x9e)]({'where':{'id':_0x24d0d9[_0xf2b6b3(0x9c)]['id']}})[_0xf2b6b3(0x95)](handleEntityNotFound(_0x54ccdd,null))[_0xf2b6b3(0x95)](removeEntity(_0x54ccdd,null))[_0xf2b6b3(0xb6)](handleError(_0x54ccdd,null));},exports['describe']=function(_0xf3ed99,_0x4be469){const _0x44cdd2=a128_0x15a7bc;return db[_0x44cdd2(0xb3)][_0x44cdd2(0xb8)]()[_0x44cdd2(0x95)](respondWithResult(_0x4be469,null))[_0x44cdd2(0xb6)](handleError(_0x4be469,null));};
\ No newline at end of file
+const a128_0x58e7=['catch','VIRTUAL','../../components/parsers/qs','then','describe','offset','query','limit','attributes','length','create','filter','like','name','map','set','type','intersection','filters','ChatTransferReport','params','error','options','sort','pick','Content-Range','model','merge','count','where','destroy','key','body','fields','send','status','update','rawAttributes','show'];(function(_0x127a17,_0x50e075){const _0x58e77c=function(_0x55c234){while(--_0x55c234){_0x127a17['push'](_0x127a17['shift']());}};_0x58e77c(++_0x50e075);}(a128_0x58e7,0x1d8));const a128_0x55c2=function(_0x127a17,_0x50e075){_0x127a17=_0x127a17-0x111;let _0x58e77c=a128_0x58e7[_0x127a17];return _0x58e77c;};const a128_0x2b60d3=a128_0x55c2;'use strict';const _=require('lodash'),qs=require(a128_0x2b60d3(0x136)),logger=require('../../config/logger')('api'),{db}=require('../../mysqldb'),{Op}=require('sequelize');function respondWithResult(_0x10f134,_0x123e24){return _0x123e24=_0x123e24||0xc8,function(_0x1bd421){const _0x329d9b=a128_0x55c2;if(_0x1bd421)return _0x10f134[_0x329d9b(0x130)](_0x123e24)['json'](_0x1bd421);};}function respondWithFilteredResult(_0x378ee9,_0x1d2cad){return function(_0x4e6e32){const _0x2a8b91=a128_0x55c2;if(_0x4e6e32){const _0x3f6da5=_0x4e6e32[_0x2a8b91(0x129)],_0x3affb8=_0x1d2cad[_0x2a8b91(0x112)];let _0x1d1608=_0x1d2cad['offset']+_0x1d2cad['limit'],_0x3abaa0;return _0x1d1608>=_0x3f6da5?(_0x1d1608=_0x3f6da5,_0x3abaa0=0xc8):_0x3abaa0=0xce,_0x378ee9[_0x2a8b91(0x130)](_0x3abaa0),_0x378ee9[_0x2a8b91(0x11c)](_0x2a8b91(0x126),_0x3affb8+'-'+_0x1d1608+'/'+_0x3f6da5)['json'](_0x4e6e32);}return null;};}function saveUpdates(_0x30d306){return function(_0x293c02){const _0x728630=a128_0x55c2;if(_0x293c02)return _0x293c02[_0x728630(0x131)](_0x30d306)[_0x728630(0x137)](function(_0x23989c){return _0x23989c;});return null;};}function removeEntity(_0x353d38){return function(_0x2364a7){const _0x1144be=a128_0x55c2;if(_0x2364a7)return _0x2364a7[_0x1144be(0x12b)]()[_0x1144be(0x137)](function(){const _0x43fc77=_0x1144be;_0x353d38[_0x43fc77(0x130)](0xcc)['end']();});};}function handleEntityNotFound(_0x4204c4){return function(_0x5c0448){return!_0x5c0448&&_0x4204c4['sendStatus'](0x194),_0x5c0448;};}function handleError(_0x473bb5,_0x7baf4c){return _0x7baf4c=_0x7baf4c||0x1f4,function(_0x293d97){const _0x4ca2c9=a128_0x55c2;logger[_0x4ca2c9(0x122)](_0x293d97['stack']),_0x293d97[_0x4ca2c9(0x11a)]&&delete _0x293d97[_0x4ca2c9(0x11a)],_0x473bb5['status'](_0x7baf4c)[_0x4ca2c9(0x12f)](_0x293d97);};}exports['index']=function(_0x481e38,_0x202394){const _0x250ec1=a128_0x2b60d3;let _0x2231f7={};const _0x48ccf4={},_0x1fbecc={'count':0x0,'rows':[]},_0xd1ec3c=_[_0x250ec1(0x11b)](db[_0x250ec1(0x120)][_0x250ec1(0x132)],function(_0x3e377f){const _0x1d1348=_0x250ec1;return{'name':_0x3e377f['fieldName'],'type':_0x3e377f[_0x1d1348(0x11d)][_0x1d1348(0x12c)]};});_0x48ccf4[_0x250ec1(0x127)]=_['map'](_0xd1ec3c,_0x250ec1(0x11a)),_0x48ccf4[_0x250ec1(0x113)]=_['keys'](_0x481e38['query']),_0x48ccf4[_0x250ec1(0x11f)]=_[_0x250ec1(0x11e)](_0x48ccf4[_0x250ec1(0x127)],_0x48ccf4[_0x250ec1(0x113)]),_0x2231f7['attributes']=_[_0x250ec1(0x11e)](_0x48ccf4['model'],qs[_0x250ec1(0x12e)](_0x481e38[_0x250ec1(0x113)][_0x250ec1(0x12e)])),_0x2231f7['attributes']=_0x2231f7['attributes'][_0x250ec1(0x116)]?_0x2231f7['attributes']:_0x48ccf4[_0x250ec1(0x127)];typeof _0x481e38[_0x250ec1(0x113)]['nolimit']==='undefined'&&(_0x2231f7[_0x250ec1(0x114)]=qs['limit'](_0x481e38[_0x250ec1(0x113)][_0x250ec1(0x114)]),_0x2231f7[_0x250ec1(0x112)]=qs['offset'](_0x481e38[_0x250ec1(0x113)][_0x250ec1(0x112)]));_0x2231f7['order']=qs[_0x250ec1(0x124)](_0x481e38[_0x250ec1(0x113)][_0x250ec1(0x124)]),_0x2231f7[_0x250ec1(0x12a)]=qs[_0x250ec1(0x11f)](_[_0x250ec1(0x125)](_0x481e38[_0x250ec1(0x113)],_0x48ccf4[_0x250ec1(0x11f)]),_0xd1ec3c);_0x481e38[_0x250ec1(0x113)]['filter']&&(_0x2231f7[_0x250ec1(0x12a)]=_[_0x250ec1(0x128)](_0x2231f7[_0x250ec1(0x12a)],{[Op['or']]:_[_0x250ec1(0x11b)](_0xd1ec3c,function(_0x5f2777){const _0xec4a5a=_0x250ec1;if(_0x5f2777['type']!==_0xec4a5a(0x135)){const _0x2f0ed5={};return _0x2f0ed5[_0x5f2777['name']]={[Op[_0xec4a5a(0x119)]]:'%'+_0x481e38[_0xec4a5a(0x113)][_0xec4a5a(0x118)]+'%'},_0x2f0ed5;}})}));_0x2231f7=_[_0x250ec1(0x128)]({},_0x2231f7,_0x481e38[_0x250ec1(0x123)]);const _0x43ba29={'where':_0x2231f7[_0x250ec1(0x12a)]};return db['ChatTransferReport'][_0x250ec1(0x129)](_0x43ba29)[_0x250ec1(0x137)](function(_0x5874ae){const _0x2f2c79=_0x250ec1;return _0x1fbecc['count']=_0x5874ae,_0x481e38[_0x2f2c79(0x113)]['includeAll']&&(_0x2231f7['include']=[{'all':!![]}]),db[_0x2f2c79(0x120)]['findAll'](_0x2231f7);})[_0x250ec1(0x137)](function(_0x14f12b){return _0x1fbecc['rows']=_0x14f12b,_0x1fbecc;})['then'](respondWithFilteredResult(_0x202394,_0x2231f7))['catch'](handleError(_0x202394,null));},exports[a128_0x2b60d3(0x133)]=function(_0x53918f,_0x14090a){const _0x4b4579=a128_0x2b60d3;let _0x2fe940={'raw':!![],'where':{'id':_0x53918f[_0x4b4579(0x121)]['id']}};const _0x409803={};return _0x409803[_0x4b4579(0x127)]=_['keys'](db[_0x4b4579(0x120)][_0x4b4579(0x132)]),_0x409803['query']=_['keys'](_0x53918f[_0x4b4579(0x113)]),_0x409803[_0x4b4579(0x11f)]=_[_0x4b4579(0x11e)](_0x409803[_0x4b4579(0x127)],_0x409803[_0x4b4579(0x113)]),_0x2fe940[_0x4b4579(0x115)]=_[_0x4b4579(0x11e)](_0x409803[_0x4b4579(0x127)],qs[_0x4b4579(0x12e)](_0x53918f[_0x4b4579(0x113)]['fields'])),_0x2fe940[_0x4b4579(0x115)]=_0x2fe940['attributes']['length']?_0x2fe940[_0x4b4579(0x115)]:_0x409803[_0x4b4579(0x127)],_0x53918f[_0x4b4579(0x113)]['includeAll']&&(_0x2fe940['include']=[{'all':!![]}]),_0x2fe940=_['merge']({},_0x2fe940,_0x53918f[_0x4b4579(0x123)]),db['ChatTransferReport']['findOne'](_0x2fe940)['then'](handleEntityNotFound(_0x14090a,null))['then'](respondWithResult(_0x14090a,null))[_0x4b4579(0x134)](handleError(_0x14090a,null));},exports[a128_0x2b60d3(0x117)]=function(_0xdef4bd,_0xde4ada){const _0x35c12a=a128_0x2b60d3;return db[_0x35c12a(0x120)][_0x35c12a(0x117)](_0xdef4bd[_0x35c12a(0x12d)],{})['then'](respondWithResult(_0xde4ada,0xc9))[_0x35c12a(0x134)](handleError(_0xde4ada,null));},exports[a128_0x2b60d3(0x131)]=function(_0xcf26b4,_0x34231b){const _0x5e443b=a128_0x2b60d3;return _0xcf26b4['body']['id']&&delete _0xcf26b4[_0x5e443b(0x12d)]['id'],db[_0x5e443b(0x120)]['findOne']({'where':{'id':_0xcf26b4[_0x5e443b(0x121)]['id']}})['then'](handleEntityNotFound(_0x34231b,null))[_0x5e443b(0x137)](saveUpdates(_0xcf26b4[_0x5e443b(0x12d)],null))[_0x5e443b(0x137)](respondWithResult(_0x34231b,null))[_0x5e443b(0x134)](handleError(_0x34231b,null));},exports[a128_0x2b60d3(0x12b)]=function(_0x4411d7,_0x364b66){const _0x3940a1=a128_0x2b60d3;return db[_0x3940a1(0x120)]['findOne']({'where':{'id':_0x4411d7[_0x3940a1(0x121)]['id']}})[_0x3940a1(0x137)](handleEntityNotFound(_0x364b66,null))[_0x3940a1(0x137)](removeEntity(_0x364b66,null))[_0x3940a1(0x134)](handleError(_0x364b66,null));},exports[a128_0x2b60d3(0x111)]=function(_0x560d55,_0x523cc8){const _0x708a15=a128_0x2b60d3;return db[_0x708a15(0x120)]['describe']()[_0x708a15(0x137)](respondWithResult(_0x523cc8,null))['catch'](handleError(_0x523cc8,null));};
\ No newline at end of file