Built motion from commit 9e1399f3.|2.5.37
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index b61897d..e39c6f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe164=['socket.io-emitter','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','defaults','redis'];(function(_0x32aea7,_0x482ca0){var _0x207a10=function(_0x23ce65){while(--_0x23ce65){_0x32aea7['push'](_0x32aea7['shift']());}};_0x207a10(++_0x482ca0);}(_0xe164,0x1a2));var _0x4e16=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xe164[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x4e16('0x0'));var util=require('util');var moment=require(_0x4e16('0x1'));var BPromise=require(_0x4e16('0x2'));var rs=require(_0x4e16('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e16('0x4'))['db'];var utils=require(_0x4e16('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4e16('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4e16('0x7')][_0x4e16('0x8')]({'port':0x232a});config['redis']=_[_0x4e16('0x9')](config[_0x4e16('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4e16('0xb'))(new Redis(config[_0x4e16('0xa')]));require(_0x4e16('0xc'))[_0x4e16('0xd')](socket);function respondWithRpcPromise(_0xe2eb3,_0x410bff,_0x51c0d7){return new BPromise(function(_0x3dedb5,_0xa1c347){return client[_0x4e16('0xe')](_0xe2eb3,_0x51c0d7)[_0x4e16('0xf')](function(_0x18752a){logger[_0x4e16('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x410bff,_0x4e16('0x11'));logger[_0x4e16('0x12')](_0x4e16('0x13'),_0x410bff,_0x4e16('0x11'),JSON['stringify'](_0x18752a));if(_0x18752a[_0x4e16('0x14')]){if(_0x18752a['error']['code']===0x1f4){logger[_0x4e16('0x14')](_0x4e16('0x15'),_0x410bff,_0x18752a['error'][_0x4e16('0x16')]);return _0xa1c347(_0x18752a['error']['message']);}logger[_0x4e16('0x14')](_0x4e16('0x15'),_0x410bff,_0x18752a[_0x4e16('0x14')][_0x4e16('0x16')]);return _0x3dedb5(_0x18752a['error']['message']);}else{logger[_0x4e16('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x410bff,_0x4e16('0x11'));_0x3dedb5(_0x18752a[_0x4e16('0x17')]['message']);}})[_0x4e16('0x18')](function(_0xb26044){logger[_0x4e16('0x14')](_0x4e16('0x15'),_0x410bff,_0xb26044);_0xa1c347(_0xb26044);});});}exports[_0x4e16('0x19')]=function(_0x5c43b0){var _0x1f8a28=this;return new Promise(function(_0x1d830e,_0x4f8444){return db[_0x4e16('0x1a')][_0x4e16('0x1b')]({'raw':_0x5c43b0['options']?_0x5c43b0[_0x4e16('0x1c')][_0x4e16('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c43b0[_0x4e16('0x1c')]?_0x5c43b0['options']['where']||null:null,'attributes':_0x5c43b0[_0x4e16('0x1c')]?_0x5c43b0[_0x4e16('0x1c')][_0x4e16('0x1e')]||null:null,'limit':_0x5c43b0[_0x4e16('0x1c')]?_0x5c43b0[_0x4e16('0x1c')][_0x4e16('0x1f')]||null:null,'include':_0x5c43b0[_0x4e16('0x1c')]?_0x5c43b0['options'][_0x4e16('0x20')]?_[_0x4e16('0x21')](_0x5c43b0[_0x4e16('0x1c')][_0x4e16('0x20')],function(_0x18665a){return{'model':db[_0x18665a[_0x4e16('0x22')]],'as':_0x18665a['as'],'attributes':_0x18665a[_0x4e16('0x1e')],'include':_0x18665a[_0x4e16('0x20')]?_[_0x4e16('0x21')](_0x18665a['include'],function(_0x4cfcf2){return{'model':db[_0x4cfcf2[_0x4e16('0x22')]],'as':_0x4cfcf2['as'],'attributes':_0x4cfcf2[_0x4e16('0x1e')],'include':_0x4cfcf2['include']?_[_0x4e16('0x21')](_0x4cfcf2[_0x4e16('0x20')],function(_0x16325d){return{'model':db[_0x16325d[_0x4e16('0x22')]],'as':_0x16325d['as'],'attributes':_0x16325d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e16('0xf')](function(_0x28d970){logger[_0x4e16('0x10')](_0x4e16('0x19'),_0x5c43b0);logger['debug'](_0x4e16('0x19'),_0x5c43b0,JSON[_0x4e16('0x23')](_0x28d970));_0x1d830e(_0x28d970);})[_0x4e16('0x18')](function(_0x36ef54){logger[_0x4e16('0x14')](_0x4e16('0x19'),_0x36ef54[_0x4e16('0x16')],_0x5c43b0);_0x4f8444(_0x1f8a28[_0x4e16('0x14')](0x1f4,_0x36ef54['message']));});});};exports[_0x4e16('0x24')]=function(_0x5b8940){var _0x540041=this;return new Promise(function(_0x4747b5,_0x34d7f2){return db[_0x4e16('0x1a')][_0x4e16('0x25')]({'raw':_0x5b8940[_0x4e16('0x1c')]?_0x5b8940[_0x4e16('0x1c')][_0x4e16('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b8940[_0x4e16('0x1c')]?_0x5b8940[_0x4e16('0x1c')][_0x4e16('0x26')]||null:null,'attributes':_0x5b8940[_0x4e16('0x1c')]?_0x5b8940[_0x4e16('0x1c')][_0x4e16('0x1e')]||null:null,'include':_0x5b8940['options']?_0x5b8940[_0x4e16('0x1c')][_0x4e16('0x20')]?_[_0x4e16('0x21')](_0x5b8940[_0x4e16('0x1c')][_0x4e16('0x20')],function(_0x29174b){return{'model':db[_0x29174b[_0x4e16('0x22')]],'as':_0x29174b['as'],'attributes':_0x29174b['attributes'],'include':_0x29174b[_0x4e16('0x20')]?_[_0x4e16('0x21')](_0x29174b[_0x4e16('0x20')],function(_0x91ea62){return{'model':db[_0x91ea62[_0x4e16('0x22')]],'as':_0x91ea62['as'],'attributes':_0x91ea62[_0x4e16('0x1e')],'include':_0x91ea62[_0x4e16('0x20')]?_[_0x4e16('0x21')](_0x91ea62[_0x4e16('0x20')],function(_0x4fc35e){return{'model':db[_0x4fc35e[_0x4e16('0x22')]],'as':_0x4fc35e['as'],'attributes':_0x4fc35e[_0x4e16('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4e16('0xf')](function(_0x2c6e1b){logger[_0x4e16('0x10')]('ShowOpenchannelQueue',_0x5b8940);logger[_0x4e16('0x12')](_0x4e16('0x24'),_0x5b8940,JSON[_0x4e16('0x23')](_0x2c6e1b));_0x4747b5(_0x2c6e1b);})['catch'](function(_0x3e16a0){logger[_0x4e16('0x14')]('ShowOpenchannelQueue',_0x3e16a0[_0x4e16('0x16')],_0x5b8940);_0x34d7f2(_0x540041[_0x4e16('0x14')](0x1f4,_0x3e16a0['message']));});});};
\ No newline at end of file
+var _0xa309=['OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueue,\x20%s,\x20%s','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','limit','include','map','attributes','model','then','stringify','ShowOpenchannelQueue','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','request\x20sent','debug'];(function(_0x34c0f1,_0x52ee0c){var _0xabef14=function(_0x27f20a){while(--_0x27f20a){_0x34c0f1['push'](_0x34c0f1['shift']());}};_0xabef14(++_0x52ee0c);}(_0xa309,0x1cd));var _0x9a30=function(_0x1a4e5a,_0x4cd134){_0x1a4e5a=_0x1a4e5a-0x0;var _0x28e285=_0xa309[_0x1a4e5a];return _0x28e285;};'use strict';var _=require('lodash');var util=require(_0x9a30('0x0'));var moment=require('moment');var BPromise=require(_0x9a30('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a30('0x2'));var db=require(_0x9a30('0x3'))['db'];var utils=require(_0x9a30('0x4'));var logger=require(_0x9a30('0x5'))('rpc');var config=require(_0x9a30('0x6'));var jayson=require(_0x9a30('0x7'));var client=jayson[_0x9a30('0x8')][_0x9a30('0x9')]({'port':0x232a});config[_0x9a30('0xa')]=_[_0x9a30('0xb')](config[_0x9a30('0xa')],{'host':_0x9a30('0xc'),'port':0x18eb});var socket=require(_0x9a30('0xd'))(new Redis(config['redis']));require(_0x9a30('0xe'))[_0x9a30('0xf')](socket);function respondWithRpcPromise(_0x180e9c,_0x22558b,_0x197071){return new BPromise(function(_0x4d405d,_0x55a70a){return client[_0x9a30('0x10')](_0x180e9c,_0x197071)['then'](function(_0x2fc78d){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x22558b,_0x9a30('0x11'));logger[_0x9a30('0x12')](_0x9a30('0x13'),_0x22558b,_0x9a30('0x11'),JSON['stringify'](_0x2fc78d));if(_0x2fc78d[_0x9a30('0x14')]){if(_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x15')]===0x1f4){logger[_0x9a30('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x22558b,_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);return _0x55a70a(_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);}logger['error'](_0x9a30('0x17'),_0x22558b,_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);return _0x4d405d(_0x2fc78d[_0x9a30('0x14')][_0x9a30('0x16')]);}else{logger[_0x9a30('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x22558b,_0x9a30('0x11'));_0x4d405d(_0x2fc78d[_0x9a30('0x19')]['message']);}})[_0x9a30('0x1a')](function(_0x1d4c39){logger[_0x9a30('0x14')](_0x9a30('0x17'),_0x22558b,_0x1d4c39);_0x55a70a(_0x1d4c39);});});}exports[_0x9a30('0x1b')]=function(_0x4a5d0e){var _0x12f126=this;return new Promise(function(_0x5b620d,_0x1b1a9c){return db[_0x9a30('0x1c')][_0x9a30('0x1d')]({'raw':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')]['where']||null:null,'attributes':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')]['attributes']||null:null,'limit':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')][_0x9a30('0x1f')]||null:null,'include':_0x4a5d0e[_0x9a30('0x1e')]?_0x4a5d0e[_0x9a30('0x1e')][_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x4a5d0e[_0x9a30('0x1e')][_0x9a30('0x20')],function(_0x293f2a){return{'model':db[_0x293f2a['model']],'as':_0x293f2a['as'],'attributes':_0x293f2a[_0x9a30('0x22')],'include':_0x293f2a[_0x9a30('0x20')]?_['map'](_0x293f2a['include'],function(_0x3a398a){return{'model':db[_0x3a398a[_0x9a30('0x23')]],'as':_0x3a398a['as'],'attributes':_0x3a398a[_0x9a30('0x22')],'include':_0x3a398a[_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x3a398a[_0x9a30('0x20')],function(_0xa1cd97){return{'model':db[_0xa1cd97[_0x9a30('0x23')]],'as':_0xa1cd97['as'],'attributes':_0xa1cd97[_0x9a30('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9a30('0x24')](function(_0x379b78){logger[_0x9a30('0x18')](_0x9a30('0x1b'),_0x4a5d0e);logger[_0x9a30('0x12')]('GetOpenchannelQueue',_0x4a5d0e,JSON[_0x9a30('0x25')](_0x379b78));_0x5b620d(_0x379b78);})['catch'](function(_0x48b5b0){logger[_0x9a30('0x14')](_0x9a30('0x1b'),_0x48b5b0[_0x9a30('0x16')],_0x4a5d0e);_0x1b1a9c(_0x12f126['error'](0x1f4,_0x48b5b0[_0x9a30('0x16')]));});});};exports[_0x9a30('0x26')]=function(_0x523f97){var _0x13e2a0=this;return new Promise(function(_0x4f6d8b,_0x24592f){return db[_0x9a30('0x1c')]['find']({'raw':_0x523f97[_0x9a30('0x1e')]?_0x523f97[_0x9a30('0x1e')][_0x9a30('0x27')]===undefined?!![]:![]:!![],'where':_0x523f97['options']?_0x523f97[_0x9a30('0x1e')]['where']||null:null,'attributes':_0x523f97[_0x9a30('0x1e')]?_0x523f97[_0x9a30('0x1e')][_0x9a30('0x22')]||null:null,'include':_0x523f97[_0x9a30('0x1e')]?_0x523f97[_0x9a30('0x1e')]['include']?_[_0x9a30('0x21')](_0x523f97[_0x9a30('0x1e')][_0x9a30('0x20')],function(_0x1cc58b){return{'model':db[_0x1cc58b[_0x9a30('0x23')]],'as':_0x1cc58b['as'],'attributes':_0x1cc58b['attributes'],'include':_0x1cc58b[_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x1cc58b[_0x9a30('0x20')],function(_0x2672c2){return{'model':db[_0x2672c2[_0x9a30('0x23')]],'as':_0x2672c2['as'],'attributes':_0x2672c2[_0x9a30('0x22')],'include':_0x2672c2[_0x9a30('0x20')]?_[_0x9a30('0x21')](_0x2672c2[_0x9a30('0x20')],function(_0x3325cd){return{'model':db[_0x3325cd[_0x9a30('0x23')]],'as':_0x3325cd['as'],'attributes':_0x3325cd['attributes']};}):[]};}):[]};}):[]:[]})[_0x9a30('0x24')](function(_0x26d4a2){logger[_0x9a30('0x18')]('ShowOpenchannelQueue',_0x523f97);logger[_0x9a30('0x12')](_0x9a30('0x26'),_0x523f97,JSON[_0x9a30('0x25')](_0x26d4a2));_0x4f6d8b(_0x26d4a2);})[_0x9a30('0x1a')](function(_0x1be9fb){logger['error'](_0x9a30('0x26'),_0x1be9fb['message'],_0x523f97);_0x24592f(_0x13e2a0['error'](0x1f4,_0x1be9fb[_0x9a30('0x16')]));});});};
\ No newline at end of file