Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / api / chatOfflineMessage / chatOfflineMessage.controller.js
index e50e4c2..2d1e8b6 100644 (file)
@@ -1 +1 @@
-const a87_0x17e4=['include','where','lodash','options','length','send','sort','offset','sendStatus','pick','filters','fieldName','model','merge','show','catch','keys','like','rawAttributes','nolimit','../../components/parsers/qs','then','findOne','status','api','index','name','map','../../mysqldb','rows','limit','fields','VIRTUAL','end','filter','count','error','json','ChatOfflineMessage','type','intersection','attributes','key','describe','query','destroy','params','body','create','sequelize','update','includeAll'];(function(_0x307cef,_0x17e473){const _0x1ce22a=function(_0x1a0326){while(--_0x1a0326){_0x307cef['push'](_0x307cef['shift']());}};_0x1ce22a(++_0x17e473);}(a87_0x17e4,0x169));const a87_0x1ce2=function(_0x307cef,_0x17e473){_0x307cef=_0x307cef-0x0;let _0x1ce22a=a87_0x17e4[_0x307cef];return _0x1ce22a;};const _0x49c701=a87_0x1ce2;'use strict';const _=require(_0x49c701('0x5')),qs=require(_0x49c701('0x17')),logger=require('../../config/logger')(_0x49c701('0x1b')),db=require(_0x49c701('0x1f'))['db'],{Op}=require(_0x49c701('0x0'));function respondWithResult(_0x1a0326,_0x247527){return _0x247527=_0x247527||0xc8,function(_0x2ff5cb){const _0x3721b9=a87_0x1ce2;if(_0x2ff5cb)return _0x1a0326[_0x3721b9('0x1a')](_0x247527)[_0x3721b9('0x28')](_0x2ff5cb);};}function respondWithFilteredResult(_0x4f93b8,_0x57d6b5){return function(_0x7e2862){const _0x3c2f12=a87_0x1ce2;if(_0x7e2862){const _0x17e700=_0x7e2862[_0x3c2f12('0x26')],_0x2d6cc6=_0x57d6b5[_0x3c2f12('0xa')];let _0x31c287=_0x57d6b5[_0x3c2f12('0xa')]+_0x57d6b5[_0x3c2f12('0x21')],_0x461e0e;return _0x31c287>=_0x17e700?(_0x31c287=_0x17e700,_0x461e0e=0xc8):_0x461e0e=0xce,_0x4f93b8['status'](_0x461e0e),_0x4f93b8['set']('Content-Range',_0x2d6cc6+'-'+_0x31c287+'/'+_0x17e700)['json'](_0x7e2862);}return null;};}function saveUpdates(_0x4c11ce){return function(_0x557927){const _0x1d93b6=a87_0x1ce2;if(_0x557927)return _0x557927['update'](_0x4c11ce)[_0x1d93b6('0x18')](function(_0x47a79b){return _0x47a79b;});return null;};}function removeEntity(_0x2e147a){return function(_0x5a3b92){const _0x1795df=a87_0x1ce2;if(_0x5a3b92)return _0x5a3b92[_0x1795df('0x30')]()['then'](function(){const _0x9d754=_0x1795df;_0x2e147a['status'](0xcc)[_0x9d754('0x24')]();});};}function handleEntityNotFound(_0x40b4eb){return function(_0x2ba962){const _0x99157c=a87_0x1ce2;return!_0x2ba962&&_0x40b4eb[_0x99157c('0xb')](0x194),_0x2ba962;};}function handleError(_0x55145d,_0xb59e66){return _0xb59e66=_0xb59e66||0x1f4,function(_0x134c66){const _0x48e692=a87_0x1ce2;logger[_0x48e692('0x27')](_0x134c66['stack']),_0x134c66['name']&&delete _0x134c66[_0x48e692('0x1d')],_0x55145d['status'](_0xb59e66)[_0x48e692('0x8')](_0x134c66);};}exports[_0x49c701('0x1c')]=function(_0x2483a5,_0x59a480){const _0x530798=_0x49c701;let _0x37fde2={};const _0x1264fd={},_0x2f08b6={'count':0x0,'rows':[]},_0x5a586a=_['map'](db[_0x530798('0x29')][_0x530798('0x15')],function(_0x4ee3eb){const _0x4e6085=_0x530798;return{'name':_0x4ee3eb[_0x4e6085('0xe')],'type':_0x4ee3eb[_0x4e6085('0x2a')][_0x4e6085('0x2d')]};});_0x1264fd[_0x530798('0xf')]=_[_0x530798('0x1e')](_0x5a586a,'name'),_0x1264fd['query']=_[_0x530798('0x13')](_0x2483a5[_0x530798('0x2f')]),_0x1264fd[_0x530798('0xd')]=_[_0x530798('0x2b')](_0x1264fd[_0x530798('0xf')],_0x1264fd['query']),_0x37fde2[_0x530798('0x2c')]=_[_0x530798('0x2b')](_0x1264fd['model'],qs['fields'](_0x2483a5[_0x530798('0x2f')]['fields'])),_0x37fde2[_0x530798('0x2c')]=_0x37fde2[_0x530798('0x2c')][_0x530798('0x7')]?_0x37fde2[_0x530798('0x2c')]:_0x1264fd[_0x530798('0xf')];typeof _0x2483a5[_0x530798('0x2f')][_0x530798('0x16')]==='undefined'&&(_0x37fde2[_0x530798('0x21')]=qs[_0x530798('0x21')](_0x2483a5['query'][_0x530798('0x21')]),_0x37fde2[_0x530798('0xa')]=qs[_0x530798('0xa')](_0x2483a5[_0x530798('0x2f')]['offset']));_0x37fde2['order']=qs[_0x530798('0x9')](_0x2483a5['query']['sort']),_0x37fde2[_0x530798('0x4')]=qs['filters'](_[_0x530798('0xc')](_0x2483a5[_0x530798('0x2f')],_0x1264fd[_0x530798('0xd')]),_0x5a586a);_0x2483a5['query'][_0x530798('0x25')]&&(_0x37fde2[_0x530798('0x4')]=_['merge'](_0x37fde2[_0x530798('0x4')],{[Op['or']]:_[_0x530798('0x1e')](_0x5a586a,function(_0x5c54f2){const _0x28e3e7=_0x530798;if(_0x5c54f2[_0x28e3e7('0x2a')]!==_0x28e3e7('0x23')){const _0x41492a={};return _0x41492a[_0x5c54f2['name']]={[Op[_0x28e3e7('0x14')]]:'%'+_0x2483a5[_0x28e3e7('0x2f')][_0x28e3e7('0x25')]+'%'},_0x41492a;}})}));_0x37fde2=_[_0x530798('0x10')]({},_0x37fde2,_0x2483a5[_0x530798('0x6')]);const _0x7c16a9={'where':_0x37fde2[_0x530798('0x4')]};return db[_0x530798('0x29')]['count'](_0x7c16a9)[_0x530798('0x18')](function(_0x5f3d10){const _0x218973=_0x530798;return _0x2f08b6['count']=_0x5f3d10,_0x2483a5[_0x218973('0x2f')][_0x218973('0x2')]&&(_0x37fde2[_0x218973('0x3')]=[{'all':!![]}]),db[_0x218973('0x29')]['findAll'](_0x37fde2);})[_0x530798('0x18')](function(_0x3fd063){const _0x2bbeda=_0x530798;return _0x2f08b6[_0x2bbeda('0x20')]=_0x3fd063,_0x2f08b6;})['then'](respondWithFilteredResult(_0x59a480,_0x37fde2))[_0x530798('0x12')](handleError(_0x59a480,null));},exports[_0x49c701('0x11')]=function(_0x398aea,_0x5fd646){const _0x52f7cd=_0x49c701;let _0x417ab9={'raw':!![],'where':{'id':_0x398aea[_0x52f7cd('0x31')]['id']}};const _0x459dd5={};return _0x459dd5[_0x52f7cd('0xf')]=_[_0x52f7cd('0x13')](db[_0x52f7cd('0x29')][_0x52f7cd('0x15')]),_0x459dd5[_0x52f7cd('0x2f')]=_['keys'](_0x398aea[_0x52f7cd('0x2f')]),_0x459dd5[_0x52f7cd('0xd')]=_[_0x52f7cd('0x2b')](_0x459dd5['model'],_0x459dd5[_0x52f7cd('0x2f')]),_0x417ab9[_0x52f7cd('0x2c')]=_[_0x52f7cd('0x2b')](_0x459dd5[_0x52f7cd('0xf')],qs[_0x52f7cd('0x22')](_0x398aea[_0x52f7cd('0x2f')][_0x52f7cd('0x22')])),_0x417ab9[_0x52f7cd('0x2c')]=_0x417ab9['attributes'][_0x52f7cd('0x7')]?_0x417ab9[_0x52f7cd('0x2c')]:_0x459dd5[_0x52f7cd('0xf')],_0x398aea[_0x52f7cd('0x2f')][_0x52f7cd('0x2')]&&(_0x417ab9[_0x52f7cd('0x3')]=[{'all':!![]}]),_0x417ab9=_[_0x52f7cd('0x10')]({},_0x417ab9,_0x398aea[_0x52f7cd('0x6')]),db[_0x52f7cd('0x29')][_0x52f7cd('0x19')](_0x417ab9)[_0x52f7cd('0x18')](handleEntityNotFound(_0x5fd646,null))[_0x52f7cd('0x18')](respondWithResult(_0x5fd646,null))[_0x52f7cd('0x12')](handleError(_0x5fd646,null));},exports[_0x49c701('0x33')]=function(_0x4cc294,_0x2b256f){const _0x4151ba=_0x49c701;return db['ChatOfflineMessage'][_0x4151ba('0x33')](_0x4cc294[_0x4151ba('0x32')],{})[_0x4151ba('0x18')](respondWithResult(_0x2b256f,0xc9))['catch'](handleError(_0x2b256f,null));},exports[_0x49c701('0x1')]=function(_0x38f761,_0x141e3c){const _0x32d671=_0x49c701;return _0x38f761['body']['id']&&delete _0x38f761[_0x32d671('0x32')]['id'],db['ChatOfflineMessage']['findOne']({'where':{'id':_0x38f761['params']['id']}})['then'](handleEntityNotFound(_0x141e3c,null))[_0x32d671('0x18')](saveUpdates(_0x38f761[_0x32d671('0x32')],null))[_0x32d671('0x18')](respondWithResult(_0x141e3c,null))[_0x32d671('0x12')](handleError(_0x141e3c,null));},exports[_0x49c701('0x30')]=function(_0x4cee55,_0xc339de){const _0x535f17=_0x49c701;return db[_0x535f17('0x29')]['findOne']({'where':{'id':_0x4cee55[_0x535f17('0x31')]['id']}})[_0x535f17('0x18')](handleEntityNotFound(_0xc339de,null))[_0x535f17('0x18')](removeEntity(_0xc339de,null))['catch'](handleError(_0xc339de,null));},exports['describe']=function(_0x5d6c41,_0x2f7892){const _0x2aec88=_0x49c701;return db[_0x2aec88('0x29')][_0x2aec88('0x2e')]()[_0x2aec88('0x18')](respondWithResult(_0x2f7892,null))[_0x2aec88('0x12')](handleError(_0x2f7892,null));};
\ No newline at end of file
+const a87_0x5cd5=['json','error','map','status','VIRTUAL','stack','ChatOfflineMessage','offset','pick','attributes','update','include','../../mysqldb','sequelize','send','create','includeAll','Content-Range','filters','show','intersection','set','keys','end','undefined','name','../../components/parsers/qs','api','query','describe','sort','destroy','then','findOne','length','rawAttributes','options','filter','count','params','key','type','rows','fields','like','fieldName','body','merge','model','findAll','catch','where','limit'];(function(_0x1c3352,_0x5cd5dd){const _0x5c100f=function(_0x514591){while(--_0x514591){_0x1c3352['push'](_0x1c3352['shift']());}};_0x5c100f(++_0x5cd5dd);}(a87_0x5cd5,0xad));const a87_0x5c10=function(_0x1c3352,_0x5cd5dd){_0x1c3352=_0x1c3352-0x0;let _0x5c100f=a87_0x5cd5[_0x1c3352];return _0x5c100f;};const _0x50726c=a87_0x5c10;'use strict';const _=require('lodash'),qs=require(_0x50726c('0xc')),logger=require('../../config/logger')(_0x50726c('0xd')),db=require(_0x50726c('0x33'))['db'],{Op}=require(_0x50726c('0x34'));function respondWithResult(_0x514591,_0x55cb30){return _0x55cb30=_0x55cb30||0xc8,function(_0x4a154f){const _0x331eec=a87_0x5c10;if(_0x4a154f)return _0x514591['status'](_0x55cb30)[_0x331eec('0x27')](_0x4a154f);};}function respondWithFilteredResult(_0x466325,_0x28bf39){return function(_0x1f37ba){const _0x5a62b3=a87_0x5c10;if(_0x1f37ba){const _0x2e7fea=_0x1f37ba[_0x5a62b3('0x18')],_0x4758e5=_0x28bf39[_0x5a62b3('0x2e')];let _0x16ba37=_0x28bf39[_0x5a62b3('0x2e')]+_0x28bf39['limit'],_0x4d83ef;return _0x16ba37>=_0x2e7fea?(_0x16ba37=_0x2e7fea,_0x4d83ef=0xc8):_0x4d83ef=0xce,_0x466325[_0x5a62b3('0x2a')](_0x4d83ef),_0x466325[_0x5a62b3('0x7')](_0x5a62b3('0x3'),_0x4758e5+'-'+_0x16ba37+'/'+_0x2e7fea)['json'](_0x1f37ba);}return null;};}function saveUpdates(_0x54a5e3){return function(_0x1d9e45){const _0x4a9aaf=a87_0x5c10;if(_0x1d9e45)return _0x1d9e45[_0x4a9aaf('0x31')](_0x54a5e3)[_0x4a9aaf('0x12')](function(_0x4df4e7){return _0x4df4e7;});return null;};}function removeEntity(_0x4ba3ce){return function(_0x202027){const _0x2855e8=a87_0x5c10;if(_0x202027)return _0x202027[_0x2855e8('0x11')]()[_0x2855e8('0x12')](function(){const _0x57b262=_0x2855e8;_0x4ba3ce[_0x57b262('0x2a')](0xcc)[_0x57b262('0x9')]();});};}function handleEntityNotFound(_0x11d8ee){return function(_0xb2f224){return!_0xb2f224&&_0x11d8ee['sendStatus'](0x194),_0xb2f224;};}function handleError(_0xd8595b,_0x497497){return _0x497497=_0x497497||0x1f4,function(_0x25c4b0){const _0x4020ea=a87_0x5c10;logger[_0x4020ea('0x28')](_0x25c4b0[_0x4020ea('0x2c')]),_0x25c4b0[_0x4020ea('0xb')]&&delete _0x25c4b0[_0x4020ea('0xb')],_0xd8595b[_0x4020ea('0x2a')](_0x497497)[_0x4020ea('0x0')](_0x25c4b0);};}exports['index']=function(_0x9c42bc,_0x4c2a3c){const _0x5373aa=_0x50726c;let _0x376b35={};const _0x21679e={},_0x135542={'count':0x0,'rows':[]},_0x3c6bb3=_['map'](db['ChatOfflineMessage'][_0x5373aa('0x15')],function(_0x2b3a1a){const _0x1024eb=_0x5373aa;return{'name':_0x2b3a1a[_0x1024eb('0x1f')],'type':_0x2b3a1a[_0x1024eb('0x1b')][_0x1024eb('0x1a')]};});_0x21679e[_0x5373aa('0x22')]=_[_0x5373aa('0x29')](_0x3c6bb3,'name'),_0x21679e[_0x5373aa('0xe')]=_['keys'](_0x9c42bc[_0x5373aa('0xe')]),_0x21679e[_0x5373aa('0x4')]=_['intersection'](_0x21679e[_0x5373aa('0x22')],_0x21679e[_0x5373aa('0xe')]),_0x376b35[_0x5373aa('0x30')]=_['intersection'](_0x21679e[_0x5373aa('0x22')],qs['fields'](_0x9c42bc[_0x5373aa('0xe')][_0x5373aa('0x1d')])),_0x376b35[_0x5373aa('0x30')]=_0x376b35[_0x5373aa('0x30')]['length']?_0x376b35[_0x5373aa('0x30')]:_0x21679e[_0x5373aa('0x22')];typeof _0x9c42bc[_0x5373aa('0xe')]['nolimit']===_0x5373aa('0xa')&&(_0x376b35[_0x5373aa('0x26')]=qs[_0x5373aa('0x26')](_0x9c42bc[_0x5373aa('0xe')][_0x5373aa('0x26')]),_0x376b35[_0x5373aa('0x2e')]=qs['offset'](_0x9c42bc[_0x5373aa('0xe')][_0x5373aa('0x2e')]));_0x376b35['order']=qs[_0x5373aa('0x10')](_0x9c42bc[_0x5373aa('0xe')]['sort']),_0x376b35['where']=qs[_0x5373aa('0x4')](_[_0x5373aa('0x2f')](_0x9c42bc['query'],_0x21679e[_0x5373aa('0x4')]),_0x3c6bb3);_0x9c42bc['query']['filter']&&(_0x376b35['where']=_[_0x5373aa('0x21')](_0x376b35[_0x5373aa('0x25')],{[Op['or']]:_[_0x5373aa('0x29')](_0x3c6bb3,function(_0x20fd8f){const _0xc144fe=_0x5373aa;if(_0x20fd8f[_0xc144fe('0x1b')]!==_0xc144fe('0x2b')){const _0x43b755={};return _0x43b755[_0x20fd8f['name']]={[Op[_0xc144fe('0x1e')]]:'%'+_0x9c42bc[_0xc144fe('0xe')][_0xc144fe('0x17')]+'%'},_0x43b755;}})}));_0x376b35=_[_0x5373aa('0x21')]({},_0x376b35,_0x9c42bc[_0x5373aa('0x16')]);const _0x3afce6={'where':_0x376b35['where']};return db[_0x5373aa('0x2d')][_0x5373aa('0x18')](_0x3afce6)[_0x5373aa('0x12')](function(_0x383a95){const _0x30e1da=_0x5373aa;return _0x135542[_0x30e1da('0x18')]=_0x383a95,_0x9c42bc[_0x30e1da('0xe')][_0x30e1da('0x2')]&&(_0x376b35[_0x30e1da('0x32')]=[{'all':!![]}]),db[_0x30e1da('0x2d')][_0x30e1da('0x23')](_0x376b35);})[_0x5373aa('0x12')](function(_0x110911){const _0x2cd93a=_0x5373aa;return _0x135542[_0x2cd93a('0x1c')]=_0x110911,_0x135542;})[_0x5373aa('0x12')](respondWithFilteredResult(_0x4c2a3c,_0x376b35))[_0x5373aa('0x24')](handleError(_0x4c2a3c,null));},exports[_0x50726c('0x5')]=function(_0x21cc90,_0x31a72d){const _0x134030=_0x50726c;let _0x30d798={'raw':!![],'where':{'id':_0x21cc90[_0x134030('0x19')]['id']}};const _0x35c598={};return _0x35c598[_0x134030('0x22')]=_[_0x134030('0x8')](db['ChatOfflineMessage'][_0x134030('0x15')]),_0x35c598[_0x134030('0xe')]=_[_0x134030('0x8')](_0x21cc90['query']),_0x35c598[_0x134030('0x4')]=_[_0x134030('0x6')](_0x35c598['model'],_0x35c598[_0x134030('0xe')]),_0x30d798[_0x134030('0x30')]=_['intersection'](_0x35c598[_0x134030('0x22')],qs[_0x134030('0x1d')](_0x21cc90[_0x134030('0xe')]['fields'])),_0x30d798[_0x134030('0x30')]=_0x30d798['attributes'][_0x134030('0x14')]?_0x30d798[_0x134030('0x30')]:_0x35c598[_0x134030('0x22')],_0x21cc90[_0x134030('0xe')][_0x134030('0x2')]&&(_0x30d798['include']=[{'all':!![]}]),_0x30d798=_[_0x134030('0x21')]({},_0x30d798,_0x21cc90[_0x134030('0x16')]),db['ChatOfflineMessage'][_0x134030('0x13')](_0x30d798)['then'](handleEntityNotFound(_0x31a72d,null))[_0x134030('0x12')](respondWithResult(_0x31a72d,null))[_0x134030('0x24')](handleError(_0x31a72d,null));},exports[_0x50726c('0x1')]=function(_0x3adf2c,_0x14d5e6){const _0x57f52b=_0x50726c;return db[_0x57f52b('0x2d')]['create'](_0x3adf2c[_0x57f52b('0x20')],{})[_0x57f52b('0x12')](respondWithResult(_0x14d5e6,0xc9))[_0x57f52b('0x24')](handleError(_0x14d5e6,null));},exports[_0x50726c('0x31')]=function(_0x1f1374,_0x40f528){const _0x27bc25=_0x50726c;return _0x1f1374['body']['id']&&delete _0x1f1374[_0x27bc25('0x20')]['id'],db[_0x27bc25('0x2d')][_0x27bc25('0x13')]({'where':{'id':_0x1f1374['params']['id']}})[_0x27bc25('0x12')](handleEntityNotFound(_0x40f528,null))[_0x27bc25('0x12')](saveUpdates(_0x1f1374['body'],null))['then'](respondWithResult(_0x40f528,null))[_0x27bc25('0x24')](handleError(_0x40f528,null));},exports[_0x50726c('0x11')]=function(_0x5d03e2,_0x476447){const _0x7fb10e=_0x50726c;return db[_0x7fb10e('0x2d')]['findOne']({'where':{'id':_0x5d03e2[_0x7fb10e('0x19')]['id']}})[_0x7fb10e('0x12')](handleEntityNotFound(_0x476447,null))[_0x7fb10e('0x12')](removeEntity(_0x476447,null))[_0x7fb10e('0x24')](handleError(_0x476447,null));},exports[_0x50726c('0xf')]=function(_0x26fb99,_0x570d8a){const _0x46eb58=_0x50726c;return db[_0x46eb58('0x2d')][_0x46eb58('0xf')]()['then'](respondWithResult(_0x570d8a,null))['catch'](handleError(_0x570d8a,null));};
\ No newline at end of file