Built motion from commit b517aaa2a6638133380e4d135c64a80893061362. Version 3.0.0...
[motion-next.git] / server / api / chatOfflineMessage / chatOfflineMessage.controller.js
index aa53755..d397f63 100644 (file)
@@ -1 +1 @@
-const a87_0x5b21=['stack','options','body','fields','length','order','destroy','show','../../config/logger','error','name','end','fieldName','send','sendStatus','include','status','map','intersection','attributes','limit','../../components/parsers/qs','lodash','describe','ChatOfflineMessage','findOne','json','type','pick','params','Content-Range','rawAttributes','offset','where','like','keys','create','undefined','findAll','count','update','sort','query','merge','model','key','index','catch','includeAll','rows','filters','then','filter'];(function(_0x11ea96,_0x5b2107){const _0x3669a9=function(_0x3466b0){while(--_0x3466b0){_0x11ea96['push'](_0x11ea96['shift']());}};_0x3669a9(++_0x5b2107);}(a87_0x5b21,0x1c3));const a87_0x3669=function(_0x11ea96,_0x5b2107){_0x11ea96=_0x11ea96-0x0;let _0x3669a9=a87_0x5b21[_0x11ea96];return _0x3669a9;};const _0xd54ab7=a87_0x3669;'use strict';const _=require(_0xd54ab7('0x30')),qs=require(_0xd54ab7('0x2f')),logger=require(_0xd54ab7('0x22'))('api'),db=require('../../mysqldb')['db'],{Op}=require('sequelize');function respondWithResult(_0x3466b0,_0x1227ac){return _0x1227ac=_0x1227ac||0xc8,function(_0x42cbe3){const _0x20a243=a87_0x3669;if(_0x42cbe3)return _0x3466b0[_0x20a243('0x2a')](_0x1227ac)[_0x20a243('0x34')](_0x42cbe3);};}function respondWithFilteredResult(_0x1fa7e9,_0x46fe42){return function(_0x2b8180){const _0x14a1a9=a87_0x3669;if(_0x2b8180){const _0x218278=_0x2b8180[_0x14a1a9('0xc')],_0x4a554a=_0x46fe42[_0x14a1a9('0x5')];let _0x370a39=_0x46fe42[_0x14a1a9('0x5')]+_0x46fe42[_0x14a1a9('0x2e')],_0x17a4c9;return _0x370a39>=_0x218278?(_0x370a39=_0x218278,_0x17a4c9=0xc8):_0x17a4c9=0xce,_0x1fa7e9[_0x14a1a9('0x2a')](_0x17a4c9),_0x1fa7e9['set'](_0x14a1a9('0x3'),_0x4a554a+'-'+_0x370a39+'/'+_0x218278)['json'](_0x2b8180);}return null;};}function saveUpdates(_0x42cfd0){return function(_0x11d610){const _0x3d711d=a87_0x3669;if(_0x11d610)return _0x11d610[_0x3d711d('0xd')](_0x42cfd0)[_0x3d711d('0x18')](function(_0x460b68){return _0x460b68;});return null;};}function removeEntity(_0x1fbe9c){return function(_0x11b4f9){if(_0x11b4f9)return _0x11b4f9['destroy']()['then'](function(){const _0x1e4567=a87_0x3669;_0x1fbe9c[_0x1e4567('0x2a')](0xcc)[_0x1e4567('0x25')]();});};}function handleEntityNotFound(_0x56718f){return function(_0x457176){const _0x13c979=a87_0x3669;return!_0x457176&&_0x56718f[_0x13c979('0x28')](0x194),_0x457176;};}function handleError(_0xebd506,_0x3cb310){return _0x3cb310=_0x3cb310||0x1f4,function(_0x257442){const _0x406efa=a87_0x3669;logger[_0x406efa('0x23')](_0x257442[_0x406efa('0x1a')]),_0x257442[_0x406efa('0x24')]&&delete _0x257442[_0x406efa('0x24')],_0xebd506[_0x406efa('0x2a')](_0x3cb310)[_0x406efa('0x27')](_0x257442);};}exports[_0xd54ab7('0x13')]=function(_0x165a53,_0xdc11ee){const _0x2df92e=_0xd54ab7;let _0x218f33={};const _0x15c982={},_0x3809e8={'count':0x0,'rows':[]},_0x567f37=_[_0x2df92e('0x2b')](db[_0x2df92e('0x32')][_0x2df92e('0x4')],function(_0x46b527){const _0x45965f=_0x2df92e;return{'name':_0x46b527[_0x45965f('0x26')],'type':_0x46b527[_0x45965f('0x0')][_0x45965f('0x12')]};});_0x15c982[_0x2df92e('0x11')]=_['map'](_0x567f37,_0x2df92e('0x24')),_0x15c982[_0x2df92e('0xf')]=_['keys'](_0x165a53[_0x2df92e('0xf')]),_0x15c982[_0x2df92e('0x17')]=_[_0x2df92e('0x2c')](_0x15c982[_0x2df92e('0x11')],_0x15c982['query']),_0x218f33['attributes']=_[_0x2df92e('0x2c')](_0x15c982['model'],qs['fields'](_0x165a53[_0x2df92e('0xf')]['fields'])),_0x218f33[_0x2df92e('0x2d')]=_0x218f33[_0x2df92e('0x2d')][_0x2df92e('0x1e')]?_0x218f33[_0x2df92e('0x2d')]:_0x15c982['model'];typeof _0x165a53[_0x2df92e('0xf')]['nolimit']===_0x2df92e('0xa')&&(_0x218f33['limit']=qs[_0x2df92e('0x2e')](_0x165a53[_0x2df92e('0xf')][_0x2df92e('0x2e')]),_0x218f33['offset']=qs[_0x2df92e('0x5')](_0x165a53[_0x2df92e('0xf')][_0x2df92e('0x5')]));_0x218f33[_0x2df92e('0x1f')]=qs[_0x2df92e('0xe')](_0x165a53['query'][_0x2df92e('0xe')]),_0x218f33[_0x2df92e('0x6')]=qs['filters'](_[_0x2df92e('0x1')](_0x165a53[_0x2df92e('0xf')],_0x15c982['filters']),_0x567f37);_0x165a53[_0x2df92e('0xf')][_0x2df92e('0x19')]&&(_0x218f33['where']=_['merge'](_0x218f33[_0x2df92e('0x6')],{[Op['or']]:_[_0x2df92e('0x2b')](_0x567f37,function(_0x529eb1){const _0x7f20ca=_0x2df92e;if(_0x529eb1[_0x7f20ca('0x0')]!=='VIRTUAL'){const _0x42f988={};return _0x42f988[_0x529eb1[_0x7f20ca('0x24')]]={[Op[_0x7f20ca('0x7')]]:'%'+_0x165a53[_0x7f20ca('0xf')][_0x7f20ca('0x19')]+'%'},_0x42f988;}})}));_0x218f33=_['merge']({},_0x218f33,_0x165a53[_0x2df92e('0x1b')]);const _0x44a793={'where':_0x218f33[_0x2df92e('0x6')]};return db[_0x2df92e('0x32')][_0x2df92e('0xc')](_0x44a793)[_0x2df92e('0x18')](function(_0x197094){const _0x3705d4=_0x2df92e;return _0x3809e8[_0x3705d4('0xc')]=_0x197094,_0x165a53['query']['includeAll']&&(_0x218f33['include']=[{'all':!![]}]),db[_0x3705d4('0x32')][_0x3705d4('0xb')](_0x218f33);})[_0x2df92e('0x18')](function(_0x35c84b){const _0x686fe=_0x2df92e;return _0x3809e8[_0x686fe('0x16')]=_0x35c84b,_0x3809e8;})['then'](respondWithFilteredResult(_0xdc11ee,_0x218f33))[_0x2df92e('0x14')](handleError(_0xdc11ee,null));},exports[_0xd54ab7('0x21')]=function(_0x437ee0,_0x436c25){const _0x1a0c82=_0xd54ab7;let _0x2fd4c8={'raw':!![],'where':{'id':_0x437ee0[_0x1a0c82('0x2')]['id']}};const _0x736ed={};return _0x736ed[_0x1a0c82('0x11')]=_[_0x1a0c82('0x8')](db[_0x1a0c82('0x32')][_0x1a0c82('0x4')]),_0x736ed[_0x1a0c82('0xf')]=_[_0x1a0c82('0x8')](_0x437ee0[_0x1a0c82('0xf')]),_0x736ed[_0x1a0c82('0x17')]=_[_0x1a0c82('0x2c')](_0x736ed[_0x1a0c82('0x11')],_0x736ed[_0x1a0c82('0xf')]),_0x2fd4c8[_0x1a0c82('0x2d')]=_['intersection'](_0x736ed[_0x1a0c82('0x11')],qs[_0x1a0c82('0x1d')](_0x437ee0[_0x1a0c82('0xf')][_0x1a0c82('0x1d')])),_0x2fd4c8[_0x1a0c82('0x2d')]=_0x2fd4c8[_0x1a0c82('0x2d')]['length']?_0x2fd4c8[_0x1a0c82('0x2d')]:_0x736ed[_0x1a0c82('0x11')],_0x437ee0[_0x1a0c82('0xf')][_0x1a0c82('0x15')]&&(_0x2fd4c8[_0x1a0c82('0x29')]=[{'all':!![]}]),_0x2fd4c8=_[_0x1a0c82('0x10')]({},_0x2fd4c8,_0x437ee0[_0x1a0c82('0x1b')]),db['ChatOfflineMessage'][_0x1a0c82('0x33')](_0x2fd4c8)[_0x1a0c82('0x18')](handleEntityNotFound(_0x436c25,null))['then'](respondWithResult(_0x436c25,null))[_0x1a0c82('0x14')](handleError(_0x436c25,null));},exports['create']=function(_0x259e84,_0x4d9df7){const _0x51861e=_0xd54ab7;return db[_0x51861e('0x32')][_0x51861e('0x9')](_0x259e84[_0x51861e('0x1c')],{})[_0x51861e('0x18')](respondWithResult(_0x4d9df7,0xc9))[_0x51861e('0x14')](handleError(_0x4d9df7,null));},exports[_0xd54ab7('0xd')]=function(_0x1abd3d,_0x307b8f){const _0x1e79ab=_0xd54ab7;return _0x1abd3d[_0x1e79ab('0x1c')]['id']&&delete _0x1abd3d[_0x1e79ab('0x1c')]['id'],db[_0x1e79ab('0x32')][_0x1e79ab('0x33')]({'where':{'id':_0x1abd3d[_0x1e79ab('0x2')]['id']}})[_0x1e79ab('0x18')](handleEntityNotFound(_0x307b8f,null))[_0x1e79ab('0x18')](saveUpdates(_0x1abd3d['body'],null))[_0x1e79ab('0x18')](respondWithResult(_0x307b8f,null))['catch'](handleError(_0x307b8f,null));},exports[_0xd54ab7('0x20')]=function(_0x5e7328,_0x38ff19){const _0x1d6d14=_0xd54ab7;return db[_0x1d6d14('0x32')][_0x1d6d14('0x33')]({'where':{'id':_0x5e7328['params']['id']}})[_0x1d6d14('0x18')](handleEntityNotFound(_0x38ff19,null))['then'](removeEntity(_0x38ff19,null))[_0x1d6d14('0x14')](handleError(_0x38ff19,null));},exports[_0xd54ab7('0x31')]=function(_0x37adf8,_0x191ad8){const _0x510c38=_0xd54ab7;return db['ChatOfflineMessage'][_0x510c38('0x31')]()[_0x510c38('0x18')](respondWithResult(_0x191ad8,null))[_0x510c38('0x14')](handleError(_0x191ad8,null));};
\ No newline at end of file
+const a87_0x1f0e=['findOne','includeAll','filter','body','count','name','options','index','catch','destroy','keys','../../mysqldb','pick','type','VIRTUAL','show','ChatOfflineMessage','rows','create','limit','model','length','set','describe','nolimit','map','update','attributes','like','../../components/parsers/qs','fields','status','where','json','merge','offset','api','then','key','query','../../config/logger','send','lodash','intersection','sort','order','rawAttributes','filters','Content-Range','params','undefined'];(function(_0x51bd75,_0x1f0ea3){const _0x466902=function(_0x5cc58e){while(--_0x5cc58e){_0x51bd75['push'](_0x51bd75['shift']());}};_0x466902(++_0x1f0ea3);}(a87_0x1f0e,0xd2));const a87_0x4669=function(_0x51bd75,_0x1f0ea3){_0x51bd75=_0x51bd75-0x0;let _0x466902=a87_0x1f0e[_0x51bd75];return _0x466902;};const _0x5c8fa3=a87_0x4669;'use strict';const _=require(_0x5c8fa3('0x24')),qs=require(_0x5c8fa3('0x17')),logger=require(_0x5c8fa3('0x22'))(_0x5c8fa3('0x1e')),db=require(_0x5c8fa3('0x5'))['db'],{Op}=require('sequelize');function respondWithResult(_0x5cc58e,_0x4017ae){return _0x4017ae=_0x4017ae||0xc8,function(_0x5a4c59){const _0x195711=a87_0x4669;if(_0x5a4c59)return _0x5cc58e[_0x195711('0x19')](_0x4017ae)[_0x195711('0x1b')](_0x5a4c59);};}function respondWithFilteredResult(_0x547f87,_0x229815){return function(_0x524a48){const _0x904504=a87_0x4669;if(_0x524a48){const _0x198007=_0x524a48['count'],_0x539634=_0x229815[_0x904504('0x1d')];let _0x492098=_0x229815[_0x904504('0x1d')]+_0x229815[_0x904504('0xd')],_0xda37eb;return _0x492098>=_0x198007?(_0x492098=_0x198007,_0xda37eb=0xc8):_0xda37eb=0xce,_0x547f87['status'](_0xda37eb),_0x547f87[_0x904504('0x10')](_0x904504('0x2a'),_0x539634+'-'+_0x492098+'/'+_0x198007)['json'](_0x524a48);}return null;};}function saveUpdates(_0x4cd1b5){return function(_0x574ff5){const _0x35230a=a87_0x4669;if(_0x574ff5)return _0x574ff5[_0x35230a('0x14')](_0x4cd1b5)['then'](function(_0x4181bc){return _0x4181bc;});return null;};}function removeEntity(_0x599c7f){return function(_0x5bf5fc){const _0x26ccc5=a87_0x4669;if(_0x5bf5fc)return _0x5bf5fc[_0x26ccc5('0x3')]()[_0x26ccc5('0x1f')](function(){_0x599c7f['status'](0xcc)['end']();});};}function handleEntityNotFound(_0x3ffac8){return function(_0xa6e520){return!_0xa6e520&&_0x3ffac8['sendStatus'](0x194),_0xa6e520;};}function handleError(_0x4dbf1f,_0xc6265b){return _0xc6265b=_0xc6265b||0x1f4,function(_0x2f0f5b){const _0x4321da=a87_0x4669;logger['error'](_0x2f0f5b['stack']),_0x2f0f5b[_0x4321da('0x32')]&&delete _0x2f0f5b[_0x4321da('0x32')],_0x4dbf1f[_0x4321da('0x19')](_0xc6265b)[_0x4321da('0x23')](_0x2f0f5b);};}exports[_0x5c8fa3('0x1')]=function(_0x2232c4,_0x67e7bc){const _0x3028fe=_0x5c8fa3;let _0x37983f={};const _0x15f7f9={},_0xf50496={'count':0x0,'rows':[]},_0x125b51=_[_0x3028fe('0x13')](db[_0x3028fe('0xa')][_0x3028fe('0x28')],function(_0x39fb0a){const _0x528852=_0x3028fe;return{'name':_0x39fb0a['fieldName'],'type':_0x39fb0a[_0x528852('0x7')][_0x528852('0x20')]};});_0x15f7f9[_0x3028fe('0xe')]=_[_0x3028fe('0x13')](_0x125b51,_0x3028fe('0x32')),_0x15f7f9[_0x3028fe('0x21')]=_[_0x3028fe('0x4')](_0x2232c4[_0x3028fe('0x21')]),_0x15f7f9['filters']=_[_0x3028fe('0x25')](_0x15f7f9[_0x3028fe('0xe')],_0x15f7f9[_0x3028fe('0x21')]),_0x37983f[_0x3028fe('0x15')]=_['intersection'](_0x15f7f9[_0x3028fe('0xe')],qs[_0x3028fe('0x18')](_0x2232c4[_0x3028fe('0x21')][_0x3028fe('0x18')])),_0x37983f['attributes']=_0x37983f[_0x3028fe('0x15')][_0x3028fe('0xf')]?_0x37983f[_0x3028fe('0x15')]:_0x15f7f9[_0x3028fe('0xe')];typeof _0x2232c4[_0x3028fe('0x21')][_0x3028fe('0x12')]===_0x3028fe('0x2c')&&(_0x37983f[_0x3028fe('0xd')]=qs[_0x3028fe('0xd')](_0x2232c4['query'][_0x3028fe('0xd')]),_0x37983f[_0x3028fe('0x1d')]=qs[_0x3028fe('0x1d')](_0x2232c4['query'][_0x3028fe('0x1d')]));_0x37983f[_0x3028fe('0x27')]=qs[_0x3028fe('0x26')](_0x2232c4[_0x3028fe('0x21')][_0x3028fe('0x26')]),_0x37983f[_0x3028fe('0x1a')]=qs[_0x3028fe('0x29')](_[_0x3028fe('0x6')](_0x2232c4[_0x3028fe('0x21')],_0x15f7f9[_0x3028fe('0x29')]),_0x125b51);_0x2232c4[_0x3028fe('0x21')][_0x3028fe('0x2f')]&&(_0x37983f[_0x3028fe('0x1a')]=_['merge'](_0x37983f[_0x3028fe('0x1a')],{[Op['or']]:_[_0x3028fe('0x13')](_0x125b51,function(_0x227831){const _0x1e811a=_0x3028fe;if(_0x227831['type']!==_0x1e811a('0x8')){const _0x5b2ee8={};return _0x5b2ee8[_0x227831[_0x1e811a('0x32')]]={[Op[_0x1e811a('0x16')]]:'%'+_0x2232c4['query'][_0x1e811a('0x2f')]+'%'},_0x5b2ee8;}})}));_0x37983f=_[_0x3028fe('0x1c')]({},_0x37983f,_0x2232c4[_0x3028fe('0x0')]);const _0x5c8086={'where':_0x37983f[_0x3028fe('0x1a')]};return db['ChatOfflineMessage']['count'](_0x5c8086)['then'](function(_0x42e3ef){const _0x33c0c5=_0x3028fe;return _0xf50496[_0x33c0c5('0x31')]=_0x42e3ef,_0x2232c4[_0x33c0c5('0x21')][_0x33c0c5('0x2e')]&&(_0x37983f['include']=[{'all':!![]}]),db['ChatOfflineMessage']['findAll'](_0x37983f);})[_0x3028fe('0x1f')](function(_0x53f3a1){const _0x46bff8=_0x3028fe;return _0xf50496[_0x46bff8('0xb')]=_0x53f3a1,_0xf50496;})[_0x3028fe('0x1f')](respondWithFilteredResult(_0x67e7bc,_0x37983f))['catch'](handleError(_0x67e7bc,null));},exports[_0x5c8fa3('0x9')]=function(_0x5c631f,_0x38f160){const _0x3558e9=_0x5c8fa3;let _0x42dcec={'raw':!![],'where':{'id':_0x5c631f[_0x3558e9('0x2b')]['id']}};const _0x4d28d0={};return _0x4d28d0['model']=_[_0x3558e9('0x4')](db[_0x3558e9('0xa')]['rawAttributes']),_0x4d28d0[_0x3558e9('0x21')]=_['keys'](_0x5c631f[_0x3558e9('0x21')]),_0x4d28d0['filters']=_['intersection'](_0x4d28d0[_0x3558e9('0xe')],_0x4d28d0['query']),_0x42dcec[_0x3558e9('0x15')]=_[_0x3558e9('0x25')](_0x4d28d0[_0x3558e9('0xe')],qs[_0x3558e9('0x18')](_0x5c631f[_0x3558e9('0x21')][_0x3558e9('0x18')])),_0x42dcec[_0x3558e9('0x15')]=_0x42dcec[_0x3558e9('0x15')][_0x3558e9('0xf')]?_0x42dcec[_0x3558e9('0x15')]:_0x4d28d0[_0x3558e9('0xe')],_0x5c631f['query'][_0x3558e9('0x2e')]&&(_0x42dcec['include']=[{'all':!![]}]),_0x42dcec=_[_0x3558e9('0x1c')]({},_0x42dcec,_0x5c631f[_0x3558e9('0x0')]),db['ChatOfflineMessage']['findOne'](_0x42dcec)[_0x3558e9('0x1f')](handleEntityNotFound(_0x38f160,null))[_0x3558e9('0x1f')](respondWithResult(_0x38f160,null))[_0x3558e9('0x2')](handleError(_0x38f160,null));},exports[_0x5c8fa3('0xc')]=function(_0x42ec12,_0x27db87){const _0x5eb564=_0x5c8fa3;return db[_0x5eb564('0xa')]['create'](_0x42ec12[_0x5eb564('0x30')],{})['then'](respondWithResult(_0x27db87,0xc9))[_0x5eb564('0x2')](handleError(_0x27db87,null));},exports[_0x5c8fa3('0x14')]=function(_0x37e70f,_0x4999f1){const _0x11ad72=_0x5c8fa3;return _0x37e70f[_0x11ad72('0x30')]['id']&&delete _0x37e70f[_0x11ad72('0x30')]['id'],db[_0x11ad72('0xa')]['findOne']({'where':{'id':_0x37e70f['params']['id']}})['then'](handleEntityNotFound(_0x4999f1,null))['then'](saveUpdates(_0x37e70f[_0x11ad72('0x30')],null))[_0x11ad72('0x1f')](respondWithResult(_0x4999f1,null))[_0x11ad72('0x2')](handleError(_0x4999f1,null));},exports['destroy']=function(_0x504d7c,_0x2e3e2c){const _0x451be0=_0x5c8fa3;return db[_0x451be0('0xa')][_0x451be0('0x2d')]({'where':{'id':_0x504d7c[_0x451be0('0x2b')]['id']}})[_0x451be0('0x1f')](handleEntityNotFound(_0x2e3e2c,null))[_0x451be0('0x1f')](removeEntity(_0x2e3e2c,null))[_0x451be0('0x2')](handleError(_0x2e3e2c,null));},exports['describe']=function(_0x4b603f,_0x140bf4){const _0x340dd4=_0x5c8fa3;return db[_0x340dd4('0xa')][_0x340dd4('0x11')]()[_0x340dd4('0x1f')](respondWithResult(_0x140bf4,null))[_0x340dd4('0x2')](handleError(_0x140bf4,null));};
\ No newline at end of file