Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / chatQueue / chatQueue.rpc.js
index d2d854c..2e25410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30cb=['client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','map','include','model','ShowChatQueue','find','where','info','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x30cb,0x1f1));var _0xb30c=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x30cb[_0x264b61];return _0x8fff4f;};'use strict';var _=require(_0xb30c('0x0'));var util=require(_0xb30c('0x1'));var moment=require(_0xb30c('0x2'));var BPromise=require(_0xb30c('0x3'));var rs=require(_0xb30c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb30c('0x5'))['db'];var utils=require(_0xb30c('0x6'));var logger=require(_0xb30c('0x7'))('rpc');var config=require(_0xb30c('0x8'));var jayson=require(_0xb30c('0x9'));var client=jayson[_0xb30c('0xa')][_0xb30c('0xb')]({'port':0x232a});config[_0xb30c('0xc')]=_[_0xb30c('0xd')](config[_0xb30c('0xc')],{'host':_0xb30c('0xe'),'port':0x18eb});var socket=require(_0xb30c('0xf'))(new Redis(config[_0xb30c('0xc')]));require(_0xb30c('0x10'))['register'](socket);function respondWithRpcPromise(_0x4b62a8,_0x56fd8a,_0x5c07c5){return new BPromise(function(_0x3ad6b6,_0x1a151f){return client[_0xb30c('0x11')](_0x4b62a8,_0x5c07c5)[_0xb30c('0x12')](function(_0x1fe782){logger['info'](_0xb30c('0x13'),_0x56fd8a,_0xb30c('0x14'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x56fd8a,_0xb30c('0x14'),JSON[_0xb30c('0x15')](_0x1fe782));if(_0x1fe782[_0xb30c('0x16')]){if(_0x1fe782[_0xb30c('0x16')][_0xb30c('0x17')]===0x1f4){logger[_0xb30c('0x16')](_0xb30c('0x13'),_0x56fd8a,_0x1fe782[_0xb30c('0x16')][_0xb30c('0x18')]);return _0x1a151f(_0x1fe782['error']['message']);}logger[_0xb30c('0x16')](_0xb30c('0x13'),_0x56fd8a,_0x1fe782[_0xb30c('0x16')]['message']);return _0x3ad6b6(_0x1fe782[_0xb30c('0x16')]['message']);}else{logger['info'](_0xb30c('0x13'),_0x56fd8a,'request\x20sent');_0x3ad6b6(_0x1fe782[_0xb30c('0x19')][_0xb30c('0x18')]);}})['catch'](function(_0x1dcc9a){logger[_0xb30c('0x16')](_0xb30c('0x13'),_0x56fd8a,_0x1dcc9a);_0x1a151f(_0x1dcc9a);});});}exports[_0xb30c('0x1a')]=function(_0x1e1180){var _0x2a5df8=this;return new Promise(function(_0x3df973,_0x502ead){return db[_0xb30c('0x1b')][_0xb30c('0x1c')]({'raw':_0x1e1180[_0xb30c('0x1d')]?_0x1e1180[_0xb30c('0x1d')][_0xb30c('0x1e')]===undefined?!![]:![]:!![],'where':_0x1e1180[_0xb30c('0x1d')]?_0x1e1180[_0xb30c('0x1d')]['where']||null:null,'attributes':_0x1e1180[_0xb30c('0x1d')]?_0x1e1180['options'][_0xb30c('0x1f')]||null:null,'limit':_0x1e1180['options']?_0x1e1180[_0xb30c('0x1d')]['limit']||null:null,'include':_0x1e1180[_0xb30c('0x1d')]?_0x1e1180[_0xb30c('0x1d')]['include']?_[_0xb30c('0x20')](_0x1e1180[_0xb30c('0x1d')][_0xb30c('0x21')],function(_0x4e46bf){return{'model':db[_0x4e46bf[_0xb30c('0x22')]],'as':_0x4e46bf['as'],'attributes':_0x4e46bf[_0xb30c('0x1f')],'include':_0x4e46bf['include']?_[_0xb30c('0x20')](_0x4e46bf['include'],function(_0x93090d){return{'model':db[_0x93090d[_0xb30c('0x22')]],'as':_0x93090d['as'],'attributes':_0x93090d[_0xb30c('0x1f')],'include':_0x93090d[_0xb30c('0x21')]?_['map'](_0x93090d[_0xb30c('0x21')],function(_0x464667){return{'model':db[_0x464667[_0xb30c('0x22')]],'as':_0x464667['as'],'attributes':_0x464667[_0xb30c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb30c('0x12')](function(_0xa9af30){logger['info']('GetChatQueue',_0x1e1180);logger['debug'](_0xb30c('0x1a'),_0x1e1180,JSON['stringify'](_0xa9af30));_0x3df973(_0xa9af30);})['catch'](function(_0x238a55){logger[_0xb30c('0x16')]('GetChatQueue',_0x238a55['message'],_0x1e1180);_0x502ead(_0x2a5df8[_0xb30c('0x16')](0x1f4,_0x238a55[_0xb30c('0x18')]));});});};exports[_0xb30c('0x23')]=function(_0x403faa){var _0x125c4c=this;return new Promise(function(_0x45daf7,_0x3545ff){return db[_0xb30c('0x1b')][_0xb30c('0x24')]({'raw':_0x403faa[_0xb30c('0x1d')]?_0x403faa[_0xb30c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x403faa[_0xb30c('0x1d')]?_0x403faa[_0xb30c('0x1d')][_0xb30c('0x25')]||null:null,'attributes':_0x403faa['options']?_0x403faa[_0xb30c('0x1d')][_0xb30c('0x1f')]||null:null,'include':_0x403faa[_0xb30c('0x1d')]?_0x403faa['options'][_0xb30c('0x21')]?_['map'](_0x403faa[_0xb30c('0x1d')]['include'],function(_0x2ae0bb){return{'model':db[_0x2ae0bb['model']],'as':_0x2ae0bb['as'],'attributes':_0x2ae0bb[_0xb30c('0x1f')],'include':_0x2ae0bb[_0xb30c('0x21')]?_['map'](_0x2ae0bb[_0xb30c('0x21')],function(_0x1b402d){return{'model':db[_0x1b402d[_0xb30c('0x22')]],'as':_0x1b402d['as'],'attributes':_0x1b402d['attributes'],'include':_0x1b402d[_0xb30c('0x21')]?_[_0xb30c('0x20')](_0x1b402d[_0xb30c('0x21')],function(_0x4e3947){return{'model':db[_0x4e3947['model']],'as':_0x4e3947['as'],'attributes':_0x4e3947[_0xb30c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb30c('0x12')](function(_0x40ebea){logger[_0xb30c('0x26')](_0xb30c('0x23'),_0x403faa);logger['debug'](_0xb30c('0x23'),_0x403faa,JSON[_0xb30c('0x15')](_0x40ebea));_0x45daf7(_0x40ebea);})['catch'](function(_0x41a7c7){logger['error'](_0xb30c('0x23'),_0x41a7c7['message'],_0x403faa);_0x3545ff(_0x125c4c[_0xb30c('0x16')](0x1f4,_0x41a7c7[_0xb30c('0x18')]));});});};
\ No newline at end of file
+var _0xf79b=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options','raw','attributes','limit','include','map','model','ShowChatQueue','find','where','util','moment','randomstring','ioredis'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf79b,0xa0));var _0xbf79=function(_0x22edf2,_0x215181){_0x22edf2=_0x22edf2-0x0;var _0x22b866=_0xf79b[_0x22edf2];return _0x22b866;};'use strict';var _=require('lodash');var util=require(_0xbf79('0x0'));var moment=require(_0xbf79('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf79('0x2'));var fs=require('fs');var Redis=require(_0xbf79('0x3'));var db=require(_0xbf79('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf79('0x5'))(_0xbf79('0x6'));var config=require(_0xbf79('0x7'));var jayson=require(_0xbf79('0x8'));var client=jayson[_0xbf79('0x9')][_0xbf79('0xa')]({'port':0x232a});config[_0xbf79('0xb')]=_[_0xbf79('0xc')](config['redis'],{'host':_0xbf79('0xd'),'port':0x18eb});var socket=require(_0xbf79('0xe'))(new Redis(config['redis']));require(_0xbf79('0xf'))['register'](socket);function respondWithRpcPromise(_0x2be4f4,_0x5211fa,_0x358b46){return new BPromise(function(_0x53ca23,_0x484dae){return client[_0xbf79('0x10')](_0x2be4f4,_0x358b46)[_0xbf79('0x11')](function(_0x37b698){logger[_0xbf79('0x12')](_0xbf79('0x13'),_0x5211fa,_0xbf79('0x14'));logger[_0xbf79('0x15')](_0xbf79('0x16'),_0x5211fa,_0xbf79('0x14'),JSON[_0xbf79('0x17')](_0x37b698));if(_0x37b698[_0xbf79('0x18')]){if(_0x37b698[_0xbf79('0x18')][_0xbf79('0x19')]===0x1f4){logger[_0xbf79('0x18')]('ChatQueue,\x20%s,\x20%s',_0x5211fa,_0x37b698[_0xbf79('0x18')][_0xbf79('0x1a')]);return _0x484dae(_0x37b698[_0xbf79('0x18')][_0xbf79('0x1a')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x5211fa,_0x37b698[_0xbf79('0x18')]['message']);return _0x53ca23(_0x37b698[_0xbf79('0x18')][_0xbf79('0x1a')]);}else{logger[_0xbf79('0x12')]('ChatQueue,\x20%s,\x20%s',_0x5211fa,_0xbf79('0x14'));_0x53ca23(_0x37b698[_0xbf79('0x1b')][_0xbf79('0x1a')]);}})['catch'](function(_0x26cb87){logger[_0xbf79('0x18')](_0xbf79('0x13'),_0x5211fa,_0x26cb87);_0x484dae(_0x26cb87);});});}exports[_0xbf79('0x1c')]=function(_0x25305c){var _0x8b6f45=this;return new Promise(function(_0x353f12,_0xf36665){return db[_0xbf79('0x1d')][_0xbf79('0x1e')]({'raw':_0x25305c[_0xbf79('0x1f')]?_0x25305c['options'][_0xbf79('0x20')]===undefined?!![]:![]:!![],'where':_0x25305c[_0xbf79('0x1f')]?_0x25305c[_0xbf79('0x1f')]['where']||null:null,'attributes':_0x25305c['options']?_0x25305c[_0xbf79('0x1f')][_0xbf79('0x21')]||null:null,'limit':_0x25305c['options']?_0x25305c['options'][_0xbf79('0x22')]||null:null,'include':_0x25305c['options']?_0x25305c[_0xbf79('0x1f')][_0xbf79('0x23')]?_[_0xbf79('0x24')](_0x25305c[_0xbf79('0x1f')][_0xbf79('0x23')],function(_0x5f30bd){return{'model':db[_0x5f30bd[_0xbf79('0x25')]],'as':_0x5f30bd['as'],'attributes':_0x5f30bd['attributes'],'include':_0x5f30bd['include']?_[_0xbf79('0x24')](_0x5f30bd['include'],function(_0x1317c0){return{'model':db[_0x1317c0[_0xbf79('0x25')]],'as':_0x1317c0['as'],'attributes':_0x1317c0['attributes'],'include':_0x1317c0[_0xbf79('0x23')]?_['map'](_0x1317c0[_0xbf79('0x23')],function(_0x320f6e){return{'model':db[_0x320f6e[_0xbf79('0x25')]],'as':_0x320f6e['as'],'attributes':_0x320f6e[_0xbf79('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbf79('0x11')](function(_0x5dba78){logger['info'](_0xbf79('0x1c'),_0x25305c);logger[_0xbf79('0x15')](_0xbf79('0x1c'),_0x25305c,JSON['stringify'](_0x5dba78));_0x353f12(_0x5dba78);})['catch'](function(_0xf7e3eb){logger[_0xbf79('0x18')](_0xbf79('0x1c'),_0xf7e3eb[_0xbf79('0x1a')],_0x25305c);_0xf36665(_0x8b6f45[_0xbf79('0x18')](0x1f4,_0xf7e3eb[_0xbf79('0x1a')]));});});};exports[_0xbf79('0x26')]=function(_0x400e7e){var _0xa669de=this;return new Promise(function(_0xabd6d3,_0x371e0b){return db[_0xbf79('0x1d')][_0xbf79('0x27')]({'raw':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x20')]===undefined?!![]:![]:!![],'where':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x28')]||null:null,'attributes':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x21')]||null:null,'include':_0x400e7e[_0xbf79('0x1f')]?_0x400e7e['options'][_0xbf79('0x23')]?_[_0xbf79('0x24')](_0x400e7e[_0xbf79('0x1f')][_0xbf79('0x23')],function(_0x2e1e5b){return{'model':db[_0x2e1e5b[_0xbf79('0x25')]],'as':_0x2e1e5b['as'],'attributes':_0x2e1e5b[_0xbf79('0x21')],'include':_0x2e1e5b[_0xbf79('0x23')]?_['map'](_0x2e1e5b[_0xbf79('0x23')],function(_0x24872d){return{'model':db[_0x24872d['model']],'as':_0x24872d['as'],'attributes':_0x24872d['attributes'],'include':_0x24872d['include']?_[_0xbf79('0x24')](_0x24872d[_0xbf79('0x23')],function(_0x507ac2){return{'model':db[_0x507ac2['model']],'as':_0x507ac2['as'],'attributes':_0x507ac2[_0xbf79('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbf79('0x11')](function(_0xf025a7){logger[_0xbf79('0x12')](_0xbf79('0x26'),_0x400e7e);logger['debug'](_0xbf79('0x26'),_0x400e7e,JSON[_0xbf79('0x17')](_0xf025a7));_0xabd6d3(_0xf025a7);})['catch'](function(_0x192b49){logger[_0xbf79('0x18')]('ShowChatQueue',_0x192b49[_0xbf79('0x1a')],_0x400e7e);_0x371e0b(_0xa669de[_0xbf79('0x18')](0x1f4,_0x192b49['message']));});});};
\ No newline at end of file