Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / chatQueue / chatQueue.rpc.js
index 91722df..877e062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d0=['util','moment','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','where','limit','map','include','model','attributes','info','catch','find','ShowChatQueue','debug','lodash'];(function(_0x508445,_0xb1889){var _0x27a00d=function(_0x215668){while(--_0x215668){_0x508445['push'](_0x508445['shift']());}};_0x27a00d(++_0xb1889);}(_0x87d0,0xbd));var _0x087d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x87d0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x087d('0x0'));var util=require(_0x087d('0x1'));var moment=require(_0x087d('0x2'));var BPromise=require('bluebird');var rs=require(_0x087d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x087d('0x4'))['db'];var utils=require(_0x087d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x087d('0x6'));var client=jayson[_0x087d('0x7')][_0x087d('0x8')]({'port':0x232a});config[_0x087d('0x9')]=_['defaults'](config[_0x087d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x087d('0xa'))(new Redis(config['redis']));require(_0x087d('0xb'))[_0x087d('0xc')](socket);function respondWithRpcPromise(_0xf992e1,_0x2b76f1,_0x43be8e){return new BPromise(function(_0x3d86bb,_0x14ba24){return client[_0x087d('0xd')](_0xf992e1,_0x43be8e)[_0x087d('0xe')](function(_0x2f4f50){logger['info'](_0x087d('0xf'),_0x2b76f1,_0x087d('0x10'));logger['debug'](_0x087d('0x11'),_0x2b76f1,'request\x20sent',JSON[_0x087d('0x12')](_0x2f4f50));if(_0x2f4f50[_0x087d('0x13')]){if(_0x2f4f50[_0x087d('0x13')][_0x087d('0x14')]===0x1f4){logger[_0x087d('0x13')](_0x087d('0xf'),_0x2b76f1,_0x2f4f50['error']['message']);return _0x14ba24(_0x2f4f50[_0x087d('0x13')][_0x087d('0x15')]);}logger[_0x087d('0x13')](_0x087d('0xf'),_0x2b76f1,_0x2f4f50[_0x087d('0x13')]['message']);return _0x3d86bb(_0x2f4f50[_0x087d('0x13')][_0x087d('0x15')]);}else{logger['info'](_0x087d('0xf'),_0x2b76f1,_0x087d('0x10'));_0x3d86bb(_0x2f4f50[_0x087d('0x16')]['message']);}})['catch'](function(_0x27e309){logger['error'](_0x087d('0xf'),_0x2b76f1,_0x27e309);_0x14ba24(_0x27e309);});});}exports[_0x087d('0x17')]=function(_0x49dbf5){var _0x10b124=this;return new Promise(function(_0x14bbbb,_0x5d34ea){return db[_0x087d('0x18')][_0x087d('0x19')]({'raw':_0x49dbf5[_0x087d('0x1a')]?_0x49dbf5['options']['raw']===undefined?!![]:![]:!![],'where':_0x49dbf5[_0x087d('0x1a')]?_0x49dbf5[_0x087d('0x1a')][_0x087d('0x1b')]||null:null,'attributes':_0x49dbf5[_0x087d('0x1a')]?_0x49dbf5[_0x087d('0x1a')]['attributes']||null:null,'limit':_0x49dbf5[_0x087d('0x1a')]?_0x49dbf5[_0x087d('0x1a')][_0x087d('0x1c')]||null:null,'include':_0x49dbf5[_0x087d('0x1a')]?_0x49dbf5[_0x087d('0x1a')]['include']?_[_0x087d('0x1d')](_0x49dbf5['options'][_0x087d('0x1e')],function(_0x1b04c1){return{'model':db[_0x1b04c1[_0x087d('0x1f')]],'as':_0x1b04c1['as'],'attributes':_0x1b04c1[_0x087d('0x20')],'include':_0x1b04c1[_0x087d('0x1e')]?_[_0x087d('0x1d')](_0x1b04c1[_0x087d('0x1e')],function(_0x44c054){return{'model':db[_0x44c054['model']],'as':_0x44c054['as'],'attributes':_0x44c054['attributes'],'include':_0x44c054[_0x087d('0x1e')]?_['map'](_0x44c054[_0x087d('0x1e')],function(_0x53d479){return{'model':db[_0x53d479[_0x087d('0x1f')]],'as':_0x53d479['as'],'attributes':_0x53d479[_0x087d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x087d('0xe')](function(_0x124a10){logger[_0x087d('0x21')](_0x087d('0x17'),_0x49dbf5);logger['debug'](_0x087d('0x17'),_0x49dbf5,JSON[_0x087d('0x12')](_0x124a10));_0x14bbbb(_0x124a10);})[_0x087d('0x22')](function(_0x179313){logger[_0x087d('0x13')]('GetChatQueue',_0x179313['message'],_0x49dbf5);_0x5d34ea(_0x10b124[_0x087d('0x13')](0x1f4,_0x179313[_0x087d('0x15')]));});});};exports['ShowChatQueue']=function(_0x462daa){var _0x3dce70=this;return new Promise(function(_0x4196ea,_0x434bbc){return db[_0x087d('0x18')][_0x087d('0x23')]({'raw':_0x462daa[_0x087d('0x1a')]?_0x462daa[_0x087d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x462daa['options']?_0x462daa[_0x087d('0x1a')][_0x087d('0x1b')]||null:null,'attributes':_0x462daa['options']?_0x462daa[_0x087d('0x1a')][_0x087d('0x20')]||null:null,'include':_0x462daa['options']?_0x462daa[_0x087d('0x1a')][_0x087d('0x1e')]?_['map'](_0x462daa[_0x087d('0x1a')]['include'],function(_0x54f3fb){return{'model':db[_0x54f3fb[_0x087d('0x1f')]],'as':_0x54f3fb['as'],'attributes':_0x54f3fb[_0x087d('0x20')],'include':_0x54f3fb['include']?_[_0x087d('0x1d')](_0x54f3fb[_0x087d('0x1e')],function(_0x36b395){return{'model':db[_0x36b395['model']],'as':_0x36b395['as'],'attributes':_0x36b395[_0x087d('0x20')],'include':_0x36b395[_0x087d('0x1e')]?_[_0x087d('0x1d')](_0x36b395[_0x087d('0x1e')],function(_0x31e0d8){return{'model':db[_0x31e0d8[_0x087d('0x1f')]],'as':_0x31e0d8['as'],'attributes':_0x31e0d8[_0x087d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x087d('0xe')](function(_0x5e642d){logger[_0x087d('0x21')](_0x087d('0x24'),_0x462daa);logger[_0x087d('0x25')](_0x087d('0x24'),_0x462daa,JSON[_0x087d('0x12')](_0x5e642d));_0x4196ea(_0x5e642d);})['catch'](function(_0x108fa0){logger['error']('ShowChatQueue',_0x108fa0[_0x087d('0x15')],_0x462daa);_0x434bbc(_0x3dce70[_0x087d('0x13')](0x1f4,_0x108fa0[_0x087d('0x15')]));});});};
\ No newline at end of file
+var _0x3906=['result','GetChatQueue','ChatQueue','findAll','options','where','include','attributes','model','find','raw','map','ShowChatQueue','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x33bb21,_0x234f4f){var _0x5a4079=function(_0x5df4a5){while(--_0x5df4a5){_0x33bb21['push'](_0x33bb21['shift']());}};_0x5a4079(++_0x234f4f);}(_0x3906,0xd6));var _0x6390=function(_0x1d97fd,_0x289573){_0x1d97fd=_0x1d97fd-0x0;var _0x5ce3ff=_0x3906[_0x1d97fd];return _0x5ce3ff;};'use strict';var _=require(_0x6390('0x0'));var util=require(_0x6390('0x1'));var moment=require('moment');var BPromise=require(_0x6390('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6390('0x3'));var db=require(_0x6390('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6390('0x5'))(_0x6390('0x6'));var config=require(_0x6390('0x7'));var jayson=require(_0x6390('0x8'));var client=jayson[_0x6390('0x9')][_0x6390('0xa')]({'port':0x232a});config[_0x6390('0xb')]=_[_0x6390('0xc')](config[_0x6390('0xb')],{'host':_0x6390('0xd'),'port':0x18eb});var socket=require(_0x6390('0xe'))(new Redis(config[_0x6390('0xb')]));require('./chatQueue.socket')[_0x6390('0xf')](socket);function respondWithRpcPromise(_0x522556,_0x105319,_0x1f4e72){return new BPromise(function(_0x277742,_0x428b3d){return client[_0x6390('0x10')](_0x522556,_0x1f4e72)[_0x6390('0x11')](function(_0x5f1482){logger[_0x6390('0x12')](_0x6390('0x13'),_0x105319,_0x6390('0x14'));logger[_0x6390('0x15')](_0x6390('0x16'),_0x105319,_0x6390('0x14'),JSON[_0x6390('0x17')](_0x5f1482));if(_0x5f1482[_0x6390('0x18')]){if(_0x5f1482[_0x6390('0x18')]['code']===0x1f4){logger[_0x6390('0x18')](_0x6390('0x13'),_0x105319,_0x5f1482[_0x6390('0x18')][_0x6390('0x19')]);return _0x428b3d(_0x5f1482[_0x6390('0x18')][_0x6390('0x19')]);}logger[_0x6390('0x18')](_0x6390('0x13'),_0x105319,_0x5f1482[_0x6390('0x18')][_0x6390('0x19')]);return _0x277742(_0x5f1482['error']['message']);}else{logger[_0x6390('0x12')](_0x6390('0x13'),_0x105319,_0x6390('0x14'));_0x277742(_0x5f1482[_0x6390('0x1a')][_0x6390('0x19')]);}})['catch'](function(_0x35cdce){logger[_0x6390('0x18')](_0x6390('0x13'),_0x105319,_0x35cdce);_0x428b3d(_0x35cdce);});});}exports[_0x6390('0x1b')]=function(_0x42520d){var _0xcdb5ab=this;return new Promise(function(_0x1c5414,_0x31de0a){return db[_0x6390('0x1c')][_0x6390('0x1d')]({'raw':_0x42520d['options']?_0x42520d['options']['raw']===undefined?!![]:![]:!![],'where':_0x42520d[_0x6390('0x1e')]?_0x42520d['options'][_0x6390('0x1f')]||null:null,'attributes':_0x42520d[_0x6390('0x1e')]?_0x42520d[_0x6390('0x1e')]['attributes']||null:null,'limit':_0x42520d['options']?_0x42520d[_0x6390('0x1e')]['limit']||null:null,'include':_0x42520d['options']?_0x42520d[_0x6390('0x1e')][_0x6390('0x20')]?_['map'](_0x42520d['options'][_0x6390('0x20')],function(_0x34391c){return{'model':db[_0x34391c['model']],'as':_0x34391c['as'],'attributes':_0x34391c[_0x6390('0x21')],'include':_0x34391c['include']?_['map'](_0x34391c[_0x6390('0x20')],function(_0x2cba99){return{'model':db[_0x2cba99[_0x6390('0x22')]],'as':_0x2cba99['as'],'attributes':_0x2cba99[_0x6390('0x21')],'include':_0x2cba99['include']?_['map'](_0x2cba99[_0x6390('0x20')],function(_0x25779b){return{'model':db[_0x25779b[_0x6390('0x22')]],'as':_0x25779b['as'],'attributes':_0x25779b[_0x6390('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x27a174){logger[_0x6390('0x12')](_0x6390('0x1b'),_0x42520d);logger[_0x6390('0x15')](_0x6390('0x1b'),_0x42520d,JSON['stringify'](_0x27a174));_0x1c5414(_0x27a174);})['catch'](function(_0x446917){logger[_0x6390('0x18')]('GetChatQueue',_0x446917[_0x6390('0x19')],_0x42520d);_0x31de0a(_0xcdb5ab[_0x6390('0x18')](0x1f4,_0x446917[_0x6390('0x19')]));});});};exports['ShowChatQueue']=function(_0x2cb36b){var _0x5cd765=this;return new Promise(function(_0x2fa7f6,_0x21c2ff){return db['ChatQueue'][_0x6390('0x23')]({'raw':_0x2cb36b[_0x6390('0x1e')]?_0x2cb36b[_0x6390('0x1e')][_0x6390('0x24')]===undefined?!![]:![]:!![],'where':_0x2cb36b[_0x6390('0x1e')]?_0x2cb36b[_0x6390('0x1e')]['where']||null:null,'attributes':_0x2cb36b[_0x6390('0x1e')]?_0x2cb36b[_0x6390('0x1e')]['attributes']||null:null,'include':_0x2cb36b[_0x6390('0x1e')]?_0x2cb36b[_0x6390('0x1e')][_0x6390('0x20')]?_['map'](_0x2cb36b[_0x6390('0x1e')][_0x6390('0x20')],function(_0x403f6f){return{'model':db[_0x403f6f[_0x6390('0x22')]],'as':_0x403f6f['as'],'attributes':_0x403f6f['attributes'],'include':_0x403f6f[_0x6390('0x20')]?_[_0x6390('0x25')](_0x403f6f['include'],function(_0x4fa793){return{'model':db[_0x4fa793[_0x6390('0x22')]],'as':_0x4fa793['as'],'attributes':_0x4fa793['attributes'],'include':_0x4fa793['include']?_[_0x6390('0x25')](_0x4fa793[_0x6390('0x20')],function(_0x2e5324){return{'model':db[_0x2e5324[_0x6390('0x22')]],'as':_0x2e5324['as'],'attributes':_0x2e5324[_0x6390('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fe3d1){logger[_0x6390('0x12')](_0x6390('0x26'),_0x2cb36b);logger['debug']('ShowChatQueue',_0x2cb36b,JSON['stringify'](_0x3fe3d1));_0x2fa7f6(_0x3fe3d1);})[_0x6390('0x27')](function(_0x11837e){logger[_0x6390('0x18')]('ShowChatQueue',_0x11837e[_0x6390('0x19')],_0x2cb36b);_0x21c2ff(_0x5cd765[_0x6390('0x18')](0x1f4,_0x11837e['message']));});});};
\ No newline at end of file