Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / chatOfflineMessage / chatOfflineMessage.controller.js
index 56d5d83..30cbb93 100644 (file)
@@ -1 +1 @@
-const a104_0x1ea4=['show','sequelize','filters','../../components/parsers/qs','index','key','filter','create','destroy','api','merge','end','like','name','fields','nolimit','limit','then','lodash','set','model','intersection','params','sort','keys','../../config/logger','body','query','ChatOfflineMessage','findOne','update','catch','error','order','../../mysqldb','where','fieldName','findAll','map','status','rows','pick','offset','json','attributes','options','send','length','stack','include','describe','count','type','rawAttributes'];(function(_0x3b43f0,_0x1df8f4){const _0x1ea4cb=function(_0x5c217e){while(--_0x5c217e){_0x3b43f0['push'](_0x3b43f0['shift']());}};_0x1ea4cb(++_0x1df8f4);}(a104_0x1ea4,0x18f));const a104_0x5c21=function(_0x3b43f0,_0x1df8f4){_0x3b43f0=_0x3b43f0-0xd8;let _0x1ea4cb=a104_0x1ea4[_0x3b43f0];return _0x1ea4cb;};const a104_0x28f26c=a104_0x5c21;'use strict';const _=require(a104_0x28f26c(0x10b)),qs=require(a104_0x28f26c(0xfc)),logger=require(a104_0x28f26c(0xdc))(a104_0x28f26c(0x102)),{db}=require(a104_0x28f26c(0xe5)),{Op}=require(a104_0x28f26c(0xfa));function respondWithResult(_0x20b840,_0x171832){return _0x171832=_0x171832||0xc8,function(_0x167816){const _0x293575=a104_0x5c21;if(_0x167816)return _0x20b840['status'](_0x171832)[_0x293575(0xee)](_0x167816);};}function respondWithFilteredResult(_0x5225b2,_0x3dc058){return function(_0x39f464){const _0x761575=a104_0x5c21;if(_0x39f464){const _0x421096=_0x39f464[_0x761575(0xf6)],_0x180e0d=_0x3dc058[_0x761575(0xed)];let _0xf8ac86=_0x3dc058[_0x761575(0xed)]+_0x3dc058[_0x761575(0x109)],_0x297628;return _0xf8ac86>=_0x421096?(_0xf8ac86=_0x421096,_0x297628=0xc8):_0x297628=0xce,_0x5225b2['status'](_0x297628),_0x5225b2[_0x761575(0x10c)]('Content-Range',_0x180e0d+'-'+_0xf8ac86+'/'+_0x421096)['json'](_0x39f464);}return null;};}function saveUpdates(_0x50ff1f){return function(_0x2bdd98){const _0x263c56=a104_0x5c21;if(_0x2bdd98)return _0x2bdd98[_0x263c56(0xe1)](_0x50ff1f)['then'](function(_0x3aa03a){return _0x3aa03a;});return null;};}function removeEntity(_0x2b040e){return function(_0x27198a){const _0x18506a=a104_0x5c21;if(_0x27198a)return _0x27198a['destroy']()[_0x18506a(0x10a)](function(){const _0x4df2a4=_0x18506a;_0x2b040e[_0x4df2a4(0xea)](0xcc)[_0x4df2a4(0x104)]();});};}function handleEntityNotFound(_0x5402aa){return function(_0x4f99fe){return!_0x4f99fe&&_0x5402aa['sendStatus'](0x194),_0x4f99fe;};}function handleError(_0x410889,_0x337be8){return _0x337be8=_0x337be8||0x1f4,function(_0x153e5c){const _0x299cdd=a104_0x5c21;logger[_0x299cdd(0xe3)](_0x153e5c[_0x299cdd(0xf3)]),_0x153e5c[_0x299cdd(0x106)]&&delete _0x153e5c[_0x299cdd(0x106)],_0x410889[_0x299cdd(0xea)](_0x337be8)[_0x299cdd(0xf1)](_0x153e5c);};}exports[a104_0x28f26c(0xfd)]=function(_0x26f7d7,_0x224efc){const _0xde3407=a104_0x28f26c;let _0x571e06={};const _0x3b473e={},_0x1328c5={'count':0x0,'rows':[]},_0x3a69b9=_[_0xde3407(0xe9)](db[_0xde3407(0xdf)][_0xde3407(0xf8)],function(_0xb00b27){const _0x1d023a=_0xde3407;return{'name':_0xb00b27[_0x1d023a(0xe7)],'type':_0xb00b27['type'][_0x1d023a(0xfe)]};});_0x3b473e['model']=_[_0xde3407(0xe9)](_0x3a69b9,'name'),_0x3b473e['query']=_[_0xde3407(0xdb)](_0x26f7d7[_0xde3407(0xde)]),_0x3b473e[_0xde3407(0xfb)]=_[_0xde3407(0xd8)](_0x3b473e[_0xde3407(0x10d)],_0x3b473e[_0xde3407(0xde)]),_0x571e06[_0xde3407(0xef)]=_[_0xde3407(0xd8)](_0x3b473e[_0xde3407(0x10d)],qs[_0xde3407(0x107)](_0x26f7d7[_0xde3407(0xde)][_0xde3407(0x107)])),_0x571e06['attributes']=_0x571e06[_0xde3407(0xef)][_0xde3407(0xf2)]?_0x571e06['attributes']:_0x3b473e[_0xde3407(0x10d)];typeof _0x26f7d7['query'][_0xde3407(0x108)]==='undefined'&&(_0x571e06[_0xde3407(0x109)]=qs[_0xde3407(0x109)](_0x26f7d7[_0xde3407(0xde)][_0xde3407(0x109)]),_0x571e06[_0xde3407(0xed)]=qs[_0xde3407(0xed)](_0x26f7d7['query'][_0xde3407(0xed)]));_0x571e06[_0xde3407(0xe4)]=qs[_0xde3407(0xda)](_0x26f7d7[_0xde3407(0xde)]['sort']),_0x571e06[_0xde3407(0xe6)]=qs[_0xde3407(0xfb)](_[_0xde3407(0xec)](_0x26f7d7[_0xde3407(0xde)],_0x3b473e[_0xde3407(0xfb)]),_0x3a69b9);_0x26f7d7['query'][_0xde3407(0xff)]&&(_0x571e06['where']=_[_0xde3407(0x103)](_0x571e06[_0xde3407(0xe6)],{[Op['or']]:_[_0xde3407(0xe9)](_0x3a69b9,function(_0x3b5fc3){const _0x263abb=_0xde3407;if(_0x3b5fc3[_0x263abb(0xf7)]!=='VIRTUAL'){const _0x3a0061={};return _0x3a0061[_0x3b5fc3[_0x263abb(0x106)]]={[Op[_0x263abb(0x105)]]:'%'+_0x26f7d7['query']['filter']+'%'},_0x3a0061;}})}));_0x571e06=_[_0xde3407(0x103)]({},_0x571e06,_0x26f7d7['options']);const _0x5e141a={'where':_0x571e06['where']};return db[_0xde3407(0xdf)][_0xde3407(0xf6)](_0x5e141a)[_0xde3407(0x10a)](function(_0x251d78){const _0x4de581=_0xde3407;return _0x1328c5[_0x4de581(0xf6)]=_0x251d78,_0x26f7d7['query']['includeAll']&&(_0x571e06[_0x4de581(0xf4)]=[{'all':!![]}]),db[_0x4de581(0xdf)][_0x4de581(0xe8)](_0x571e06);})[_0xde3407(0x10a)](function(_0x26f1ca){const _0x5880d8=_0xde3407;return _0x1328c5[_0x5880d8(0xeb)]=_0x26f1ca,_0x1328c5;})[_0xde3407(0x10a)](respondWithFilteredResult(_0x224efc,_0x571e06))[_0xde3407(0xe2)](handleError(_0x224efc,null));},exports[a104_0x28f26c(0xf9)]=function(_0x5d1e2d,_0x4f6840){const _0x162d0a=a104_0x28f26c;let _0x3c59fd={'raw':!![],'where':{'id':_0x5d1e2d['params']['id']}};const _0x2367f2={};return _0x2367f2[_0x162d0a(0x10d)]=_[_0x162d0a(0xdb)](db[_0x162d0a(0xdf)]['rawAttributes']),_0x2367f2['query']=_[_0x162d0a(0xdb)](_0x5d1e2d[_0x162d0a(0xde)]),_0x2367f2['filters']=_[_0x162d0a(0xd8)](_0x2367f2[_0x162d0a(0x10d)],_0x2367f2['query']),_0x3c59fd[_0x162d0a(0xef)]=_['intersection'](_0x2367f2['model'],qs[_0x162d0a(0x107)](_0x5d1e2d[_0x162d0a(0xde)][_0x162d0a(0x107)])),_0x3c59fd[_0x162d0a(0xef)]=_0x3c59fd[_0x162d0a(0xef)][_0x162d0a(0xf2)]?_0x3c59fd[_0x162d0a(0xef)]:_0x2367f2[_0x162d0a(0x10d)],_0x5d1e2d[_0x162d0a(0xde)]['includeAll']&&(_0x3c59fd[_0x162d0a(0xf4)]=[{'all':!![]}]),_0x3c59fd=_['merge']({},_0x3c59fd,_0x5d1e2d[_0x162d0a(0xf0)]),db[_0x162d0a(0xdf)]['findOne'](_0x3c59fd)[_0x162d0a(0x10a)](handleEntityNotFound(_0x4f6840,null))[_0x162d0a(0x10a)](respondWithResult(_0x4f6840,null))['catch'](handleError(_0x4f6840,null));},exports[a104_0x28f26c(0x100)]=function(_0x476210,_0x2873e6){const _0xc08099=a104_0x28f26c;return db[_0xc08099(0xdf)]['create'](_0x476210[_0xc08099(0xdd)],{})['then'](respondWithResult(_0x2873e6,0xc9))[_0xc08099(0xe2)](handleError(_0x2873e6,null));},exports['update']=function(_0x2c1022,_0x3c5b3d){const _0x539a69=a104_0x28f26c;return _0x2c1022[_0x539a69(0xdd)]['id']&&delete _0x2c1022[_0x539a69(0xdd)]['id'],db[_0x539a69(0xdf)][_0x539a69(0xe0)]({'where':{'id':_0x2c1022['params']['id']}})[_0x539a69(0x10a)](handleEntityNotFound(_0x3c5b3d,null))['then'](saveUpdates(_0x2c1022['body'],null))['then'](respondWithResult(_0x3c5b3d,null))[_0x539a69(0xe2)](handleError(_0x3c5b3d,null));},exports[a104_0x28f26c(0x101)]=function(_0x18699f,_0x19b109){const _0x51baa3=a104_0x28f26c;return db[_0x51baa3(0xdf)]['findOne']({'where':{'id':_0x18699f[_0x51baa3(0xd9)]['id']}})[_0x51baa3(0x10a)](handleEntityNotFound(_0x19b109,null))['then'](removeEntity(_0x19b109,null))[_0x51baa3(0xe2)](handleError(_0x19b109,null));},exports[a104_0x28f26c(0xf5)]=function(_0x5c16da,_0x3eddf4){const _0x213ba2=a104_0x28f26c;return db[_0x213ba2(0xdf)][_0x213ba2(0xf5)]()[_0x213ba2(0x10a)](respondWithResult(_0x3eddf4,null))[_0x213ba2(0xe2)](handleError(_0x3eddf4,null));};
\ No newline at end of file
+const a104_0x28a9=['count','sendStatus','body','keys','send','end','intersection','fields','show','includeAll','stack','options','rows','include','../../components/parsers/qs','offset','attributes','where','order','json','../../config/logger','Content-Range','map','key','sequelize','ChatOfflineMessage','update','destroy','then','catch','status','length','fieldName','index','set','create','api','limit','error','findOne','query','like','params','sort','filter','rawAttributes','../../mysqldb','name','model','VIRTUAL','type','filters','undefined'];(function(_0x3d2586,_0x3b6719){const _0x28a963=function(_0x4b7445){while(--_0x4b7445){_0x3d2586['push'](_0x3d2586['shift']());}};_0x28a963(++_0x3b6719);}(a104_0x28a9,0x17e));const a104_0x4b74=function(_0x3d2586,_0x3b6719){_0x3d2586=_0x3d2586-0x1a7;let _0x28a963=a104_0x28a9[_0x3d2586];return _0x28a963;};const a104_0x5eb67d=a104_0x4b74;'use strict';const _=require('lodash'),qs=require(a104_0x5eb67d(0x1aa)),logger=require(a104_0x5eb67d(0x1b0))(a104_0x5eb67d(0x1c0)),{db}=require(a104_0x5eb67d(0x1ca)),{Op}=require(a104_0x5eb67d(0x1b4));function respondWithResult(_0x37555f,_0x3a28ec){return _0x3a28ec=_0x3a28ec||0xc8,function(_0x2672df){const _0x36fd03=a104_0x4b74;if(_0x2672df)return _0x37555f[_0x36fd03(0x1ba)](_0x3a28ec)[_0x36fd03(0x1af)](_0x2672df);};}function respondWithFilteredResult(_0x4499d6,_0x44c93a){return function(_0x31184a){const _0x7ca5d=a104_0x4b74;if(_0x31184a){const _0x5aee58=_0x31184a['count'],_0x429d71=_0x44c93a[_0x7ca5d(0x1ab)];let _0x2eac5c=_0x44c93a[_0x7ca5d(0x1ab)]+_0x44c93a[_0x7ca5d(0x1c1)],_0x1f00c6;return _0x2eac5c>=_0x5aee58?(_0x2eac5c=_0x5aee58,_0x1f00c6=0xc8):_0x1f00c6=0xce,_0x4499d6[_0x7ca5d(0x1ba)](_0x1f00c6),_0x4499d6[_0x7ca5d(0x1be)](_0x7ca5d(0x1b1),_0x429d71+'-'+_0x2eac5c+'/'+_0x5aee58)[_0x7ca5d(0x1af)](_0x31184a);}return null;};}function saveUpdates(_0x400bee){return function(_0x5beb8e){const _0x48e70f=a104_0x4b74;if(_0x5beb8e)return _0x5beb8e[_0x48e70f(0x1b6)](_0x400bee)['then'](function(_0xd82e5a){return _0xd82e5a;});return null;};}function removeEntity(_0x42549a){return function(_0x45e97f){const _0x50862b=a104_0x4b74;if(_0x45e97f)return _0x45e97f[_0x50862b(0x1b7)]()[_0x50862b(0x1b8)](function(){const _0x1f7441=_0x50862b;_0x42549a[_0x1f7441(0x1ba)](0xcc)[_0x1f7441(0x1d6)]();});};}function handleEntityNotFound(_0x3a447a){return function(_0x1189fb){const _0x4521a2=a104_0x4b74;return!_0x1189fb&&_0x3a447a[_0x4521a2(0x1d2)](0x194),_0x1189fb;};}function handleError(_0x102fd9,_0x2ed1e7){return _0x2ed1e7=_0x2ed1e7||0x1f4,function(_0x516758){const _0x5d7e47=a104_0x4b74;logger[_0x5d7e47(0x1c2)](_0x516758[_0x5d7e47(0x1db)]),_0x516758[_0x5d7e47(0x1cb)]&&delete _0x516758[_0x5d7e47(0x1cb)],_0x102fd9['status'](_0x2ed1e7)[_0x5d7e47(0x1d5)](_0x516758);};}exports[a104_0x5eb67d(0x1bd)]=function(_0x3f7e3a,_0x5c5f9b){const _0x2b7cb3=a104_0x5eb67d;let _0x135266={};const _0x30cc85={},_0x5cac43={'count':0x0,'rows':[]},_0x5c8394=_[_0x2b7cb3(0x1b2)](db[_0x2b7cb3(0x1b5)][_0x2b7cb3(0x1c9)],function(_0x4d1514){const _0x35a2d5=_0x2b7cb3;return{'name':_0x4d1514[_0x35a2d5(0x1bc)],'type':_0x4d1514[_0x35a2d5(0x1ce)][_0x35a2d5(0x1b3)]};});_0x30cc85[_0x2b7cb3(0x1cc)]=_['map'](_0x5c8394,_0x2b7cb3(0x1cb)),_0x30cc85['query']=_[_0x2b7cb3(0x1d4)](_0x3f7e3a[_0x2b7cb3(0x1c4)]),_0x30cc85['filters']=_['intersection'](_0x30cc85['model'],_0x30cc85[_0x2b7cb3(0x1c4)]),_0x135266[_0x2b7cb3(0x1ac)]=_['intersection'](_0x30cc85[_0x2b7cb3(0x1cc)],qs[_0x2b7cb3(0x1d8)](_0x3f7e3a['query'][_0x2b7cb3(0x1d8)])),_0x135266[_0x2b7cb3(0x1ac)]=_0x135266['attributes'][_0x2b7cb3(0x1bb)]?_0x135266['attributes']:_0x30cc85['model'];typeof _0x3f7e3a['query']['nolimit']===_0x2b7cb3(0x1d0)&&(_0x135266[_0x2b7cb3(0x1c1)]=qs[_0x2b7cb3(0x1c1)](_0x3f7e3a['query']['limit']),_0x135266['offset']=qs[_0x2b7cb3(0x1ab)](_0x3f7e3a[_0x2b7cb3(0x1c4)][_0x2b7cb3(0x1ab)]));_0x135266[_0x2b7cb3(0x1ae)]=qs['sort'](_0x3f7e3a[_0x2b7cb3(0x1c4)][_0x2b7cb3(0x1c7)]),_0x135266[_0x2b7cb3(0x1ad)]=qs[_0x2b7cb3(0x1cf)](_['pick'](_0x3f7e3a['query'],_0x30cc85['filters']),_0x5c8394);_0x3f7e3a[_0x2b7cb3(0x1c4)][_0x2b7cb3(0x1c8)]&&(_0x135266[_0x2b7cb3(0x1ad)]=_['merge'](_0x135266[_0x2b7cb3(0x1ad)],{[Op['or']]:_[_0x2b7cb3(0x1b2)](_0x5c8394,function(_0x2e450d){const _0x7c9c8d=_0x2b7cb3;if(_0x2e450d[_0x7c9c8d(0x1ce)]!==_0x7c9c8d(0x1cd)){const _0x42351f={};return _0x42351f[_0x2e450d[_0x7c9c8d(0x1cb)]]={[Op[_0x7c9c8d(0x1c5)]]:'%'+_0x3f7e3a[_0x7c9c8d(0x1c4)][_0x7c9c8d(0x1c8)]+'%'},_0x42351f;}})}));_0x135266=_['merge']({},_0x135266,_0x3f7e3a['options']);const _0x467621={'where':_0x135266[_0x2b7cb3(0x1ad)]};return db[_0x2b7cb3(0x1b5)][_0x2b7cb3(0x1d1)](_0x467621)[_0x2b7cb3(0x1b8)](function(_0x17feff){const _0x1f660d=_0x2b7cb3;return _0x5cac43['count']=_0x17feff,_0x3f7e3a[_0x1f660d(0x1c4)][_0x1f660d(0x1da)]&&(_0x135266[_0x1f660d(0x1a9)]=[{'all':!![]}]),db[_0x1f660d(0x1b5)]['findAll'](_0x135266);})[_0x2b7cb3(0x1b8)](function(_0x4137bb){const _0x26c694=_0x2b7cb3;return _0x5cac43[_0x26c694(0x1a8)]=_0x4137bb,_0x5cac43;})[_0x2b7cb3(0x1b8)](respondWithFilteredResult(_0x5c5f9b,_0x135266))[_0x2b7cb3(0x1b9)](handleError(_0x5c5f9b,null));},exports[a104_0x5eb67d(0x1d9)]=function(_0x2c16ea,_0x2dcc66){const _0x2367ef=a104_0x5eb67d;let _0x1abab2={'raw':!![],'where':{'id':_0x2c16ea[_0x2367ef(0x1c6)]['id']}};const _0x4e90ce={};return _0x4e90ce[_0x2367ef(0x1cc)]=_[_0x2367ef(0x1d4)](db['ChatOfflineMessage'][_0x2367ef(0x1c9)]),_0x4e90ce[_0x2367ef(0x1c4)]=_[_0x2367ef(0x1d4)](_0x2c16ea[_0x2367ef(0x1c4)]),_0x4e90ce['filters']=_['intersection'](_0x4e90ce[_0x2367ef(0x1cc)],_0x4e90ce[_0x2367ef(0x1c4)]),_0x1abab2[_0x2367ef(0x1ac)]=_[_0x2367ef(0x1d7)](_0x4e90ce['model'],qs[_0x2367ef(0x1d8)](_0x2c16ea[_0x2367ef(0x1c4)][_0x2367ef(0x1d8)])),_0x1abab2[_0x2367ef(0x1ac)]=_0x1abab2['attributes'][_0x2367ef(0x1bb)]?_0x1abab2[_0x2367ef(0x1ac)]:_0x4e90ce[_0x2367ef(0x1cc)],_0x2c16ea['query'][_0x2367ef(0x1da)]&&(_0x1abab2[_0x2367ef(0x1a9)]=[{'all':!![]}]),_0x1abab2=_['merge']({},_0x1abab2,_0x2c16ea[_0x2367ef(0x1a7)]),db[_0x2367ef(0x1b5)][_0x2367ef(0x1c3)](_0x1abab2)[_0x2367ef(0x1b8)](handleEntityNotFound(_0x2dcc66,null))['then'](respondWithResult(_0x2dcc66,null))['catch'](handleError(_0x2dcc66,null));},exports[a104_0x5eb67d(0x1bf)]=function(_0x5c8f16,_0x279945){const _0x29f683=a104_0x5eb67d;return db['ChatOfflineMessage'][_0x29f683(0x1bf)](_0x5c8f16['body'],{})[_0x29f683(0x1b8)](respondWithResult(_0x279945,0xc9))[_0x29f683(0x1b9)](handleError(_0x279945,null));},exports[a104_0x5eb67d(0x1b6)]=function(_0x52f54c,_0x4ca4a6){const _0x46dbd5=a104_0x5eb67d;return _0x52f54c['body']['id']&&delete _0x52f54c[_0x46dbd5(0x1d3)]['id'],db[_0x46dbd5(0x1b5)]['findOne']({'where':{'id':_0x52f54c[_0x46dbd5(0x1c6)]['id']}})[_0x46dbd5(0x1b8)](handleEntityNotFound(_0x4ca4a6,null))[_0x46dbd5(0x1b8)](saveUpdates(_0x52f54c[_0x46dbd5(0x1d3)],null))['then'](respondWithResult(_0x4ca4a6,null))[_0x46dbd5(0x1b9)](handleError(_0x4ca4a6,null));},exports[a104_0x5eb67d(0x1b7)]=function(_0x4afc78,_0x338101){const _0x12fe7a=a104_0x5eb67d;return db[_0x12fe7a(0x1b5)][_0x12fe7a(0x1c3)]({'where':{'id':_0x4afc78['params']['id']}})[_0x12fe7a(0x1b8)](handleEntityNotFound(_0x338101,null))[_0x12fe7a(0x1b8)](removeEntity(_0x338101,null))[_0x12fe7a(0x1b9)](handleError(_0x338101,null));},exports['describe']=function(_0x39ebfd,_0x521c59){const _0x992339=a104_0x5eb67d;return db[_0x992339(0x1b5)]['describe']()[_0x992339(0x1b8)](respondWithResult(_0x521c59,null))[_0x992339(0x1b9)](handleError(_0x521c59,null));};
\ No newline at end of file