Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / chatTransferReport / chatTransferReport.controller.js
index 1628251..a239801 100644 (file)
@@ -1 +1 @@
-const a107_0x159f=['create','include','VIRTUAL','lodash','filters','limit','params','keys','query','stack','undefined','json','send','../../config/logger','rows','options','includeAll','status','like','describe','update','count','rawAttributes','merge','show','offset','then','name','where','key','type','model','sequelize','length','findAll','attributes','ChatTransferReport','body','fields','findOne','map','intersection','error','filter','index','sendStatus','set','destroy','pick','sort','../../components/parsers/qs','../../mysqldb','nolimit','catch'];(function(_0x52c4bb,_0x159f90){const _0x534c4c=function(_0x596e9b){while(--_0x596e9b){_0x52c4bb['push'](_0x52c4bb['shift']());}};_0x534c4c(++_0x159f90);}(a107_0x159f,0x116));const a107_0x534c=function(_0x52c4bb,_0x159f90){_0x52c4bb=_0x52c4bb-0x0;let _0x534c4c=a107_0x159f[_0x52c4bb];return _0x534c4c;};const _0x3fe284=a107_0x534c;'use strict';const _=require(_0x3fe284('0x31')),qs=require(_0x3fe284('0x2a')),logger=require(_0x3fe284('0x5'))('api'),db=require(_0x3fe284('0x2b'))['db'],{Op}=require(_0x3fe284('0x18'));function respondWithResult(_0x596e9b,_0x1146a7){return _0x1146a7=_0x1146a7||0xc8,function(_0x33e204){const _0x22b711=a107_0x534c;if(_0x33e204)return _0x596e9b[_0x22b711('0x9')](_0x1146a7)[_0x22b711('0x3')](_0x33e204);};}function respondWithFilteredResult(_0x32bfc6,_0x19997f){return function(_0x30d7be){const _0x29d3aa=a107_0x534c;if(_0x30d7be){const _0x262cff=_0x30d7be[_0x29d3aa('0xd')],_0x2b2f2f=_0x19997f[_0x29d3aa('0x11')];let _0x2b78fa=_0x19997f[_0x29d3aa('0x11')]+_0x19997f[_0x29d3aa('0x33')],_0x51922f;return _0x2b78fa>=_0x262cff?(_0x2b78fa=_0x262cff,_0x51922f=0xc8):_0x51922f=0xce,_0x32bfc6['status'](_0x51922f),_0x32bfc6[_0x29d3aa('0x26')]('Content-Range',_0x2b2f2f+'-'+_0x2b78fa+'/'+_0x262cff)[_0x29d3aa('0x3')](_0x30d7be);}return null;};}function saveUpdates(_0x11f92c){return function(_0x24abc5){if(_0x24abc5)return _0x24abc5['update'](_0x11f92c)['then'](function(_0x49427b){return _0x49427b;});return null;};}function removeEntity(_0x502b1d){return function(_0x50b636){const _0x5c060e=a107_0x534c;if(_0x50b636)return _0x50b636['destroy']()[_0x5c060e('0x12')](function(){const _0x1d8742=_0x5c060e;_0x502b1d[_0x1d8742('0x9')](0xcc)['end']();});};}function handleEntityNotFound(_0x877e91){return function(_0x9aae11){const _0x9682d5=a107_0x534c;return!_0x9aae11&&_0x877e91[_0x9682d5('0x25')](0x194),_0x9aae11;};}function handleError(_0x4cd96c,_0x32ffbb){return _0x32ffbb=_0x32ffbb||0x1f4,function(_0x20e1dc){const _0xbc56a4=a107_0x534c;logger[_0xbc56a4('0x22')](_0x20e1dc[_0xbc56a4('0x1')]),_0x20e1dc[_0xbc56a4('0x13')]&&delete _0x20e1dc[_0xbc56a4('0x13')],_0x4cd96c[_0xbc56a4('0x9')](_0x32ffbb)[_0xbc56a4('0x4')](_0x20e1dc);};}exports[_0x3fe284('0x24')]=function(_0x299148,_0xb95b0c){const _0x2505c7=_0x3fe284;let _0x49fa11={};const _0x4af8af={},_0x1c4147={'count':0x0,'rows':[]},_0x1e5611=_[_0x2505c7('0x20')](db[_0x2505c7('0x1c')][_0x2505c7('0xe')],function(_0x20e094){const _0x5932ab=_0x2505c7;return{'name':_0x20e094['fieldName'],'type':_0x20e094[_0x5932ab('0x16')][_0x5932ab('0x15')]};});_0x4af8af[_0x2505c7('0x17')]=_[_0x2505c7('0x20')](_0x1e5611,'name'),_0x4af8af[_0x2505c7('0x0')]=_[_0x2505c7('0x35')](_0x299148[_0x2505c7('0x0')]),_0x4af8af[_0x2505c7('0x32')]=_['intersection'](_0x4af8af[_0x2505c7('0x17')],_0x4af8af['query']),_0x49fa11[_0x2505c7('0x1b')]=_[_0x2505c7('0x21')](_0x4af8af['model'],qs['fields'](_0x299148[_0x2505c7('0x0')][_0x2505c7('0x1e')])),_0x49fa11['attributes']=_0x49fa11['attributes'][_0x2505c7('0x19')]?_0x49fa11[_0x2505c7('0x1b')]:_0x4af8af[_0x2505c7('0x17')];typeof _0x299148[_0x2505c7('0x0')][_0x2505c7('0x2c')]===_0x2505c7('0x2')&&(_0x49fa11[_0x2505c7('0x33')]=qs[_0x2505c7('0x33')](_0x299148['query'][_0x2505c7('0x33')]),_0x49fa11[_0x2505c7('0x11')]=qs['offset'](_0x299148['query']['offset']));_0x49fa11['order']=qs[_0x2505c7('0x29')](_0x299148[_0x2505c7('0x0')]['sort']),_0x49fa11[_0x2505c7('0x14')]=qs['filters'](_[_0x2505c7('0x28')](_0x299148[_0x2505c7('0x0')],_0x4af8af[_0x2505c7('0x32')]),_0x1e5611);_0x299148['query']['filter']&&(_0x49fa11[_0x2505c7('0x14')]=_[_0x2505c7('0xf')](_0x49fa11[_0x2505c7('0x14')],{[Op['or']]:_[_0x2505c7('0x20')](_0x1e5611,function(_0x3e0328){const _0x273183=_0x2505c7;if(_0x3e0328[_0x273183('0x16')]!==_0x273183('0x30')){const _0x1c9f41={};return _0x1c9f41[_0x3e0328[_0x273183('0x13')]]={[Op[_0x273183('0xa')]]:'%'+_0x299148[_0x273183('0x0')][_0x273183('0x23')]+'%'},_0x1c9f41;}})}));_0x49fa11=_['merge']({},_0x49fa11,_0x299148[_0x2505c7('0x7')]);const _0x1c072b={'where':_0x49fa11[_0x2505c7('0x14')]};return db[_0x2505c7('0x1c')][_0x2505c7('0xd')](_0x1c072b)[_0x2505c7('0x12')](function(_0x489c2c){const _0x158d56=_0x2505c7;return _0x1c4147[_0x158d56('0xd')]=_0x489c2c,_0x299148[_0x158d56('0x0')][_0x158d56('0x8')]&&(_0x49fa11[_0x158d56('0x2f')]=[{'all':!![]}]),db[_0x158d56('0x1c')][_0x158d56('0x1a')](_0x49fa11);})[_0x2505c7('0x12')](function(_0x158ee1){const _0x2d1358=_0x2505c7;return _0x1c4147[_0x2d1358('0x6')]=_0x158ee1,_0x1c4147;})[_0x2505c7('0x12')](respondWithFilteredResult(_0xb95b0c,_0x49fa11))[_0x2505c7('0x2d')](handleError(_0xb95b0c,null));},exports[_0x3fe284('0x10')]=function(_0x1af604,_0x2b1376){const _0x245a95=_0x3fe284;let _0x5643b6={'raw':!![],'where':{'id':_0x1af604['params']['id']}};const _0x40a0ac={};return _0x40a0ac['model']=_[_0x245a95('0x35')](db[_0x245a95('0x1c')][_0x245a95('0xe')]),_0x40a0ac[_0x245a95('0x0')]=_[_0x245a95('0x35')](_0x1af604['query']),_0x40a0ac[_0x245a95('0x32')]=_[_0x245a95('0x21')](_0x40a0ac[_0x245a95('0x17')],_0x40a0ac['query']),_0x5643b6[_0x245a95('0x1b')]=_['intersection'](_0x40a0ac['model'],qs['fields'](_0x1af604[_0x245a95('0x0')][_0x245a95('0x1e')])),_0x5643b6[_0x245a95('0x1b')]=_0x5643b6[_0x245a95('0x1b')][_0x245a95('0x19')]?_0x5643b6['attributes']:_0x40a0ac['model'],_0x1af604[_0x245a95('0x0')][_0x245a95('0x8')]&&(_0x5643b6[_0x245a95('0x2f')]=[{'all':!![]}]),_0x5643b6=_[_0x245a95('0xf')]({},_0x5643b6,_0x1af604[_0x245a95('0x7')]),db[_0x245a95('0x1c')][_0x245a95('0x1f')](_0x5643b6)[_0x245a95('0x12')](handleEntityNotFound(_0x2b1376,null))[_0x245a95('0x12')](respondWithResult(_0x2b1376,null))[_0x245a95('0x2d')](handleError(_0x2b1376,null));},exports['create']=function(_0x1c8500,_0x59c515){const _0x4b790e=_0x3fe284;return db[_0x4b790e('0x1c')][_0x4b790e('0x2e')](_0x1c8500['body'],{})[_0x4b790e('0x12')](respondWithResult(_0x59c515,0xc9))['catch'](handleError(_0x59c515,null));},exports[_0x3fe284('0xc')]=function(_0x3bad02,_0x2c1d82){const _0x17ed60=_0x3fe284;return _0x3bad02[_0x17ed60('0x1d')]['id']&&delete _0x3bad02[_0x17ed60('0x1d')]['id'],db[_0x17ed60('0x1c')]['findOne']({'where':{'id':_0x3bad02[_0x17ed60('0x34')]['id']}})[_0x17ed60('0x12')](handleEntityNotFound(_0x2c1d82,null))[_0x17ed60('0x12')](saveUpdates(_0x3bad02[_0x17ed60('0x1d')],null))[_0x17ed60('0x12')](respondWithResult(_0x2c1d82,null))[_0x17ed60('0x2d')](handleError(_0x2c1d82,null));},exports[_0x3fe284('0x27')]=function(_0x227c7c,_0x394b6b){const _0x23f931=_0x3fe284;return db[_0x23f931('0x1c')][_0x23f931('0x1f')]({'where':{'id':_0x227c7c[_0x23f931('0x34')]['id']}})['then'](handleEntityNotFound(_0x394b6b,null))[_0x23f931('0x12')](removeEntity(_0x394b6b,null))[_0x23f931('0x2d')](handleError(_0x394b6b,null));},exports[_0x3fe284('0xb')]=function(_0x5bec6f,_0x29a75a){const _0x1b0b9b=_0x3fe284;return db[_0x1b0b9b('0x1c')][_0x1b0b9b('0xb')]()['then'](respondWithResult(_0x29a75a,null))['catch'](handleError(_0x29a75a,null));};
\ No newline at end of file
+const a107_0x25c0=['query','../../mysqldb','lodash','count','filters','fields','name','findAll','body','model','keys','attributes','then','includeAll','params','sort','limit','merge','describe','json','include','update','length','VIRTUAL','undefined','order','offset','rawAttributes','end','error','where','../../config/logger','create','api','catch','intersection','destroy','type','show','like','status','filter','Content-Range','map','set','ChatTransferReport','pick','findOne','stack','nolimit','options'];(function(_0x578dac,_0x25c090){const _0x9bad40=function(_0x20892e){while(--_0x20892e){_0x578dac['push'](_0x578dac['shift']());}};_0x9bad40(++_0x25c090);}(a107_0x25c0,0x11b));const a107_0x9bad=function(_0x578dac,_0x25c090){_0x578dac=_0x578dac-0x0;let _0x9bad40=a107_0x25c0[_0x578dac];return _0x9bad40;};const _0x4d5969=a107_0x9bad;'use strict';const _=require(_0x4d5969('0x19')),qs=require('../../components/parsers/qs'),logger=require(_0x4d5969('0x3'))(_0x4d5969('0x5')),db=require(_0x4d5969('0x18'))['db'],{Op}=require('sequelize');function respondWithResult(_0x20892e,_0x654298){return _0x654298=_0x654298||0xc8,function(_0x45fcea){const _0xde2203=a107_0x9bad;if(_0x45fcea)return _0x20892e['status'](_0x654298)[_0xde2203('0x2a')](_0x45fcea);};}function respondWithFilteredResult(_0x2982b7,_0x2d8f77){return function(_0x3f063d){const _0x6869a2=a107_0x9bad;if(_0x3f063d){const _0x3df953=_0x3f063d[_0x6869a2('0x1a')],_0x26fa2d=_0x2d8f77[_0x6869a2('0x31')];let _0x259941=_0x2d8f77[_0x6869a2('0x31')]+_0x2d8f77['limit'],_0x10cff8;return _0x259941>=_0x3df953?(_0x259941=_0x3df953,_0x10cff8=0xc8):_0x10cff8=0xce,_0x2982b7[_0x6869a2('0xc')](_0x10cff8),_0x2982b7[_0x6869a2('0x10')](_0x6869a2('0xe'),_0x26fa2d+'-'+_0x259941+'/'+_0x3df953)[_0x6869a2('0x2a')](_0x3f063d);}return null;};}function saveUpdates(_0x2e99da){return function(_0x5d2263){const _0x2cd84f=a107_0x9bad;if(_0x5d2263)return _0x5d2263[_0x2cd84f('0x2c')](_0x2e99da)['then'](function(_0x2000f6){return _0x2000f6;});return null;};}function removeEntity(_0x42734e){return function(_0x36654e){const _0x495099=a107_0x9bad;if(_0x36654e)return _0x36654e[_0x495099('0x8')]()[_0x495099('0x23')](function(){const _0x2b7067=_0x495099;_0x42734e['status'](0xcc)[_0x2b7067('0x0')]();});};}function handleEntityNotFound(_0x3d0c07){return function(_0xd3da0a){return!_0xd3da0a&&_0x3d0c07['sendStatus'](0x194),_0xd3da0a;};}function handleError(_0x922ec9,_0x5981c4){return _0x5981c4=_0x5981c4||0x1f4,function(_0x39121e){const _0x31182d=a107_0x9bad;logger[_0x31182d('0x1')](_0x39121e[_0x31182d('0x14')]),_0x39121e[_0x31182d('0x1d')]&&delete _0x39121e['name'],_0x922ec9['status'](_0x5981c4)['send'](_0x39121e);};}exports['index']=function(_0x974fa5,_0x50b8e3){const _0x34edd0=_0x4d5969;let _0x1a824c={};const _0x405d71={},_0x15dfe0={'count':0x0,'rows':[]},_0x2f88cb=_[_0x34edd0('0xf')](db['ChatTransferReport'][_0x34edd0('0x32')],function(_0x5c6fd3){return{'name':_0x5c6fd3['fieldName'],'type':_0x5c6fd3['type']['key']};});_0x405d71[_0x34edd0('0x20')]=_[_0x34edd0('0xf')](_0x2f88cb,_0x34edd0('0x1d')),_0x405d71[_0x34edd0('0x17')]=_[_0x34edd0('0x21')](_0x974fa5[_0x34edd0('0x17')]),_0x405d71['filters']=_[_0x34edd0('0x7')](_0x405d71[_0x34edd0('0x20')],_0x405d71['query']),_0x1a824c[_0x34edd0('0x22')]=_[_0x34edd0('0x7')](_0x405d71[_0x34edd0('0x20')],qs['fields'](_0x974fa5[_0x34edd0('0x17')]['fields'])),_0x1a824c[_0x34edd0('0x22')]=_0x1a824c['attributes'][_0x34edd0('0x2d')]?_0x1a824c[_0x34edd0('0x22')]:_0x405d71[_0x34edd0('0x20')];typeof _0x974fa5[_0x34edd0('0x17')][_0x34edd0('0x15')]===_0x34edd0('0x2f')&&(_0x1a824c['limit']=qs[_0x34edd0('0x27')](_0x974fa5['query'][_0x34edd0('0x27')]),_0x1a824c[_0x34edd0('0x31')]=qs[_0x34edd0('0x31')](_0x974fa5[_0x34edd0('0x17')][_0x34edd0('0x31')]));_0x1a824c[_0x34edd0('0x30')]=qs[_0x34edd0('0x26')](_0x974fa5[_0x34edd0('0x17')]['sort']),_0x1a824c['where']=qs[_0x34edd0('0x1b')](_[_0x34edd0('0x12')](_0x974fa5['query'],_0x405d71[_0x34edd0('0x1b')]),_0x2f88cb);_0x974fa5[_0x34edd0('0x17')][_0x34edd0('0xd')]&&(_0x1a824c[_0x34edd0('0x2')]=_[_0x34edd0('0x28')](_0x1a824c[_0x34edd0('0x2')],{[Op['or']]:_[_0x34edd0('0xf')](_0x2f88cb,function(_0x1600bd){const _0x346828=_0x34edd0;if(_0x1600bd[_0x346828('0x9')]!==_0x346828('0x2e')){const _0x3bdae0={};return _0x3bdae0[_0x1600bd[_0x346828('0x1d')]]={[Op[_0x346828('0xb')]]:'%'+_0x974fa5['query'][_0x346828('0xd')]+'%'},_0x3bdae0;}})}));_0x1a824c=_['merge']({},_0x1a824c,_0x974fa5[_0x34edd0('0x16')]);const _0x4635d6={'where':_0x1a824c[_0x34edd0('0x2')]};return db[_0x34edd0('0x11')]['count'](_0x4635d6)[_0x34edd0('0x23')](function(_0x2e23f0){const _0x66f010=_0x34edd0;return _0x15dfe0[_0x66f010('0x1a')]=_0x2e23f0,_0x974fa5['query'][_0x66f010('0x24')]&&(_0x1a824c[_0x66f010('0x2b')]=[{'all':!![]}]),db['ChatTransferReport'][_0x66f010('0x1e')](_0x1a824c);})[_0x34edd0('0x23')](function(_0x1274c1){return _0x15dfe0['rows']=_0x1274c1,_0x15dfe0;})[_0x34edd0('0x23')](respondWithFilteredResult(_0x50b8e3,_0x1a824c))[_0x34edd0('0x6')](handleError(_0x50b8e3,null));},exports[_0x4d5969('0xa')]=function(_0x2a7b82,_0x107a81){const _0x2fc72b=_0x4d5969;let _0x4626be={'raw':!![],'where':{'id':_0x2a7b82['params']['id']}};const _0x152154={};return _0x152154[_0x2fc72b('0x20')]=_[_0x2fc72b('0x21')](db[_0x2fc72b('0x11')][_0x2fc72b('0x32')]),_0x152154[_0x2fc72b('0x17')]=_[_0x2fc72b('0x21')](_0x2a7b82[_0x2fc72b('0x17')]),_0x152154[_0x2fc72b('0x1b')]=_[_0x2fc72b('0x7')](_0x152154[_0x2fc72b('0x20')],_0x152154[_0x2fc72b('0x17')]),_0x4626be[_0x2fc72b('0x22')]=_[_0x2fc72b('0x7')](_0x152154['model'],qs[_0x2fc72b('0x1c')](_0x2a7b82[_0x2fc72b('0x17')][_0x2fc72b('0x1c')])),_0x4626be[_0x2fc72b('0x22')]=_0x4626be[_0x2fc72b('0x22')][_0x2fc72b('0x2d')]?_0x4626be[_0x2fc72b('0x22')]:_0x152154[_0x2fc72b('0x20')],_0x2a7b82[_0x2fc72b('0x17')]['includeAll']&&(_0x4626be[_0x2fc72b('0x2b')]=[{'all':!![]}]),_0x4626be=_[_0x2fc72b('0x28')]({},_0x4626be,_0x2a7b82[_0x2fc72b('0x16')]),db[_0x2fc72b('0x11')][_0x2fc72b('0x13')](_0x4626be)[_0x2fc72b('0x23')](handleEntityNotFound(_0x107a81,null))['then'](respondWithResult(_0x107a81,null))[_0x2fc72b('0x6')](handleError(_0x107a81,null));},exports['create']=function(_0x3592a8,_0x308443){const _0x33e0fc=_0x4d5969;return db['ChatTransferReport'][_0x33e0fc('0x4')](_0x3592a8[_0x33e0fc('0x1f')],{})[_0x33e0fc('0x23')](respondWithResult(_0x308443,0xc9))[_0x33e0fc('0x6')](handleError(_0x308443,null));},exports[_0x4d5969('0x2c')]=function(_0x2961ab,_0x1f2105){const _0x33ba4c=_0x4d5969;return _0x2961ab['body']['id']&&delete _0x2961ab[_0x33ba4c('0x1f')]['id'],db['ChatTransferReport'][_0x33ba4c('0x13')]({'where':{'id':_0x2961ab[_0x33ba4c('0x25')]['id']}})[_0x33ba4c('0x23')](handleEntityNotFound(_0x1f2105,null))[_0x33ba4c('0x23')](saveUpdates(_0x2961ab['body'],null))[_0x33ba4c('0x23')](respondWithResult(_0x1f2105,null))['catch'](handleError(_0x1f2105,null));},exports[_0x4d5969('0x8')]=function(_0x6bfb8a,_0x59c1c4){const _0x22a0fd=_0x4d5969;return db[_0x22a0fd('0x11')][_0x22a0fd('0x13')]({'where':{'id':_0x6bfb8a[_0x22a0fd('0x25')]['id']}})[_0x22a0fd('0x23')](handleEntityNotFound(_0x59c1c4,null))[_0x22a0fd('0x23')](removeEntity(_0x59c1c4,null))[_0x22a0fd('0x6')](handleError(_0x59c1c4,null));},exports[_0x4d5969('0x29')]=function(_0x308420,_0xc19a0){const _0x288a81=_0x4d5969;return db[_0x288a81('0x11')][_0x288a81('0x29')]()[_0x288a81('0x23')](respondWithResult(_0xc19a0,null))[_0x288a81('0x6')](handleError(_0xc19a0,null));};
\ No newline at end of file