Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / chatQueue / chatQueue.rpc.js
index 877e062..0be7257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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
+var _0x352e=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetChatQueue','options','raw','attributes','limit','map','include','model','then','ShowChatQueue','ChatQueue','where','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request'];(function(_0x526fb1,_0x1d0359){var _0x33582f=function(_0x2df327){while(--_0x2df327){_0x526fb1['push'](_0x526fb1['shift']());}};_0x33582f(++_0x1d0359);}(_0x352e,0x1a6));var _0xe352=function(_0x51e244,_0x5be8c5){_0x51e244=_0x51e244-0x0;var _0x1323da=_0x352e[_0x51e244];return _0x1323da;};'use strict';var _=require(_0xe352('0x0'));var util=require(_0xe352('0x1'));var moment=require(_0xe352('0x2'));var BPromise=require(_0xe352('0x3'));var rs=require(_0xe352('0x4'));var fs=require('fs');var Redis=require(_0xe352('0x5'));var db=require(_0xe352('0x6'))['db'];var utils=require(_0xe352('0x7'));var logger=require('../../config/logger')(_0xe352('0x8'));var config=require(_0xe352('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe352('0xa')][_0xe352('0xb')]({'port':0x232a});config[_0xe352('0xc')]=_[_0xe352('0xd')](config['redis'],{'host':_0xe352('0xe'),'port':0x18eb});var socket=require(_0xe352('0xf'))(new Redis(config[_0xe352('0xc')]));require(_0xe352('0x10'))['register'](socket);function respondWithRpcPromise(_0xfb5671,_0x42bc13,_0x2e7470){return new BPromise(function(_0x181d92,_0x3eb6c0){return client[_0xe352('0x11')](_0xfb5671,_0x2e7470)['then'](function(_0x5bb25e){logger[_0xe352('0x12')](_0xe352('0x13'),_0x42bc13,_0xe352('0x14'));logger[_0xe352('0x15')](_0xe352('0x16'),_0x42bc13,_0xe352('0x14'),JSON['stringify'](_0x5bb25e));if(_0x5bb25e[_0xe352('0x17')]){if(_0x5bb25e[_0xe352('0x17')]['code']===0x1f4){logger[_0xe352('0x17')](_0xe352('0x13'),_0x42bc13,_0x5bb25e['error'][_0xe352('0x18')]);return _0x3eb6c0(_0x5bb25e[_0xe352('0x17')][_0xe352('0x18')]);}logger[_0xe352('0x17')](_0xe352('0x13'),_0x42bc13,_0x5bb25e[_0xe352('0x17')][_0xe352('0x18')]);return _0x181d92(_0x5bb25e[_0xe352('0x17')]['message']);}else{logger[_0xe352('0x12')]('ChatQueue,\x20%s,\x20%s',_0x42bc13,'request\x20sent');_0x181d92(_0x5bb25e[_0xe352('0x19')][_0xe352('0x18')]);}})['catch'](function(_0x4bfe52){logger[_0xe352('0x17')](_0xe352('0x13'),_0x42bc13,_0x4bfe52);_0x3eb6c0(_0x4bfe52);});});}exports[_0xe352('0x1a')]=function(_0x4d5f4c){var _0x2687c4=this;return new Promise(function(_0x36a427,_0xa70d53){return db['ChatQueue']['findAll']({'raw':_0x4d5f4c[_0xe352('0x1b')]?_0x4d5f4c[_0xe352('0x1b')][_0xe352('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d5f4c[_0xe352('0x1b')]?_0x4d5f4c[_0xe352('0x1b')]['where']||null:null,'attributes':_0x4d5f4c[_0xe352('0x1b')]?_0x4d5f4c[_0xe352('0x1b')][_0xe352('0x1d')]||null:null,'limit':_0x4d5f4c[_0xe352('0x1b')]?_0x4d5f4c['options'][_0xe352('0x1e')]||null:null,'include':_0x4d5f4c['options']?_0x4d5f4c[_0xe352('0x1b')]['include']?_[_0xe352('0x1f')](_0x4d5f4c[_0xe352('0x1b')][_0xe352('0x20')],function(_0x1b1245){return{'model':db[_0x1b1245[_0xe352('0x21')]],'as':_0x1b1245['as'],'attributes':_0x1b1245[_0xe352('0x1d')],'include':_0x1b1245['include']?_['map'](_0x1b1245['include'],function(_0x2aa94a){return{'model':db[_0x2aa94a['model']],'as':_0x2aa94a['as'],'attributes':_0x2aa94a[_0xe352('0x1d')],'include':_0x2aa94a[_0xe352('0x20')]?_[_0xe352('0x1f')](_0x2aa94a[_0xe352('0x20')],function(_0x30028b){return{'model':db[_0x30028b[_0xe352('0x21')]],'as':_0x30028b['as'],'attributes':_0x30028b[_0xe352('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe352('0x22')](function(_0x32e669){logger[_0xe352('0x12')](_0xe352('0x1a'),_0x4d5f4c);logger['debug'](_0xe352('0x1a'),_0x4d5f4c,JSON['stringify'](_0x32e669));_0x36a427(_0x32e669);})['catch'](function(_0x3fc7ac){logger[_0xe352('0x17')]('GetChatQueue',_0x3fc7ac['message'],_0x4d5f4c);_0xa70d53(_0x2687c4['error'](0x1f4,_0x3fc7ac['message']));});});};exports[_0xe352('0x23')]=function(_0x144d2c){var _0x739f4a=this;return new Promise(function(_0x157576,_0x33f548){return db[_0xe352('0x24')]['find']({'raw':_0x144d2c[_0xe352('0x1b')]?_0x144d2c[_0xe352('0x1b')][_0xe352('0x1c')]===undefined?!![]:![]:!![],'where':_0x144d2c[_0xe352('0x1b')]?_0x144d2c[_0xe352('0x1b')][_0xe352('0x25')]||null:null,'attributes':_0x144d2c[_0xe352('0x1b')]?_0x144d2c[_0xe352('0x1b')]['attributes']||null:null,'include':_0x144d2c[_0xe352('0x1b')]?_0x144d2c[_0xe352('0x1b')]['include']?_['map'](_0x144d2c[_0xe352('0x1b')]['include'],function(_0x13aef5){return{'model':db[_0x13aef5[_0xe352('0x21')]],'as':_0x13aef5['as'],'attributes':_0x13aef5[_0xe352('0x1d')],'include':_0x13aef5[_0xe352('0x20')]?_[_0xe352('0x1f')](_0x13aef5[_0xe352('0x20')],function(_0x5e56e0){return{'model':db[_0x5e56e0[_0xe352('0x21')]],'as':_0x5e56e0['as'],'attributes':_0x5e56e0['attributes'],'include':_0x5e56e0[_0xe352('0x20')]?_[_0xe352('0x1f')](_0x5e56e0['include'],function(_0x5894e9){return{'model':db[_0x5894e9[_0xe352('0x21')]],'as':_0x5894e9['as'],'attributes':_0x5894e9[_0xe352('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe352('0x22')](function(_0x3d2a43){logger[_0xe352('0x12')](_0xe352('0x23'),_0x144d2c);logger['debug'](_0xe352('0x23'),_0x144d2c,JSON[_0xe352('0x26')](_0x3d2a43));_0x157576(_0x3d2a43);})[_0xe352('0x27')](function(_0x198b41){logger[_0xe352('0x17')](_0xe352('0x23'),_0x198b41[_0xe352('0x18')],_0x144d2c);_0x33f548(_0x739f4a[_0xe352('0x17')](0x1f4,_0x198b41[_0xe352('0x18')]));});});};
\ No newline at end of file