Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / openchannelQueue / openchannelQueue.rpc.js
index f1c3946..091af93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8102=['localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','OpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','GetOpenchannelQueue','debug','ShowOpenchannelQueue','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults'];(function(_0x904894,_0x224c3d){var _0x3553e9=function(_0x318da5){while(--_0x318da5){_0x904894['push'](_0x904894['shift']());}};_0x3553e9(++_0x224c3d);}(_0x8102,0x1a1));var _0x2810=function(_0x896367,_0x3addbe){_0x896367=_0x896367-0x0;var _0x58896c=_0x8102[_0x896367];return _0x58896c;};'use strict';var _=require(_0x2810('0x0'));var util=require(_0x2810('0x1'));var moment=require('moment');var BPromise=require(_0x2810('0x2'));var rs=require(_0x2810('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2810('0x4'))['db'];var utils=require(_0x2810('0x5'));var logger=require(_0x2810('0x6'))('rpc');var config=require(_0x2810('0x7'));var jayson=require(_0x2810('0x8'));var client=jayson[_0x2810('0x9')]['http']({'port':0x232a});config[_0x2810('0xa')]=_[_0x2810('0xb')](config['redis'],{'host':_0x2810('0xc'),'port':0x18eb});var socket=require(_0x2810('0xd'))(new Redis(config[_0x2810('0xa')]));require(_0x2810('0xe'))[_0x2810('0xf')](socket);function respondWithRpcPromise(_0x30def3,_0x19e28c,_0x36d06){return new BPromise(function(_0x1eab32,_0x12df76){return client[_0x2810('0x10')](_0x30def3,_0x36d06)[_0x2810('0x11')](function(_0x4f01b2){logger[_0x2810('0x12')](_0x2810('0x13'),_0x19e28c,_0x2810('0x14'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x19e28c,_0x2810('0x14'),JSON[_0x2810('0x15')](_0x4f01b2));if(_0x4f01b2[_0x2810('0x16')]){if(_0x4f01b2[_0x2810('0x16')]['code']===0x1f4){logger[_0x2810('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x19e28c,_0x4f01b2[_0x2810('0x16')][_0x2810('0x17')]);return _0x12df76(_0x4f01b2[_0x2810('0x16')][_0x2810('0x17')]);}logger['error'](_0x2810('0x13'),_0x19e28c,_0x4f01b2[_0x2810('0x16')][_0x2810('0x17')]);return _0x1eab32(_0x4f01b2[_0x2810('0x16')]['message']);}else{logger[_0x2810('0x12')](_0x2810('0x13'),_0x19e28c,_0x2810('0x14'));_0x1eab32(_0x4f01b2['result']['message']);}})[_0x2810('0x18')](function(_0x3d372f){logger['error'](_0x2810('0x13'),_0x19e28c,_0x3d372f);_0x12df76(_0x3d372f);});});}exports['GetOpenchannelQueue']=function(_0x102f07){var _0x3e172e=this;return new Promise(function(_0x11036e,_0x1f8540){return db[_0x2810('0x19')][_0x2810('0x1a')]({'raw':_0x102f07[_0x2810('0x1b')]?_0x102f07[_0x2810('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x102f07[_0x2810('0x1b')]?_0x102f07[_0x2810('0x1b')][_0x2810('0x1c')]||null:null,'attributes':_0x102f07[_0x2810('0x1b')]?_0x102f07['options'][_0x2810('0x1d')]||null:null,'limit':_0x102f07[_0x2810('0x1b')]?_0x102f07[_0x2810('0x1b')][_0x2810('0x1e')]||null:null,'include':_0x102f07['options']?_0x102f07[_0x2810('0x1b')][_0x2810('0x1f')]?_[_0x2810('0x20')](_0x102f07[_0x2810('0x1b')]['include'],function(_0xf362b8){return{'model':db[_0xf362b8['model']],'as':_0xf362b8['as'],'attributes':_0xf362b8[_0x2810('0x1d')],'include':_0xf362b8[_0x2810('0x1f')]?_[_0x2810('0x20')](_0xf362b8['include'],function(_0x594e74){return{'model':db[_0x594e74[_0x2810('0x21')]],'as':_0x594e74['as'],'attributes':_0x594e74[_0x2810('0x1d')],'include':_0x594e74[_0x2810('0x1f')]?_[_0x2810('0x20')](_0x594e74[_0x2810('0x1f')],function(_0x32fe68){return{'model':db[_0x32fe68[_0x2810('0x21')]],'as':_0x32fe68['as'],'attributes':_0x32fe68['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ca745){logger[_0x2810('0x12')](_0x2810('0x22'),_0x102f07);logger[_0x2810('0x23')](_0x2810('0x22'),_0x102f07,JSON[_0x2810('0x15')](_0x5ca745));_0x11036e(_0x5ca745);})[_0x2810('0x18')](function(_0x2e7552){logger[_0x2810('0x16')](_0x2810('0x22'),_0x2e7552[_0x2810('0x17')],_0x102f07);_0x1f8540(_0x3e172e['error'](0x1f4,_0x2e7552[_0x2810('0x17')]));});});};exports[_0x2810('0x24')]=function(_0x3eb468){var _0x49a782=this;return new Promise(function(_0x475835,_0x4585c8){return db[_0x2810('0x19')][_0x2810('0x25')]({'raw':_0x3eb468[_0x2810('0x1b')]?_0x3eb468[_0x2810('0x1b')][_0x2810('0x26')]===undefined?!![]:![]:!![],'where':_0x3eb468[_0x2810('0x1b')]?_0x3eb468['options'][_0x2810('0x1c')]||null:null,'attributes':_0x3eb468[_0x2810('0x1b')]?_0x3eb468[_0x2810('0x1b')]['attributes']||null:null,'include':_0x3eb468[_0x2810('0x1b')]?_0x3eb468[_0x2810('0x1b')][_0x2810('0x1f')]?_['map'](_0x3eb468[_0x2810('0x1b')][_0x2810('0x1f')],function(_0xf6cacc){return{'model':db[_0xf6cacc[_0x2810('0x21')]],'as':_0xf6cacc['as'],'attributes':_0xf6cacc['attributes'],'include':_0xf6cacc[_0x2810('0x1f')]?_['map'](_0xf6cacc['include'],function(_0x4cc3f2){return{'model':db[_0x4cc3f2[_0x2810('0x21')]],'as':_0x4cc3f2['as'],'attributes':_0x4cc3f2[_0x2810('0x1d')],'include':_0x4cc3f2[_0x2810('0x1f')]?_['map'](_0x4cc3f2['include'],function(_0x4819db){return{'model':db[_0x4819db[_0x2810('0x21')]],'as':_0x4819db['as'],'attributes':_0x4819db[_0x2810('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x2810('0x11')](function(_0x18e929){logger[_0x2810('0x12')](_0x2810('0x24'),_0x3eb468);logger[_0x2810('0x23')](_0x2810('0x24'),_0x3eb468,JSON['stringify'](_0x18e929));_0x475835(_0x18e929);})[_0x2810('0x18')](function(_0x448514){logger[_0x2810('0x16')](_0x2810('0x24'),_0x448514[_0x2810('0x17')],_0x3eb468);_0x4585c8(_0x49a782[_0x2810('0x16')](0x1f4,_0x448514[_0x2810('0x17')]));});});};
\ No newline at end of file
+var _0x8af5=['then','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','include','model','map','stringify','ShowOpenchannelQueue','find','debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x8af5,0x8c));var _0x58af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8af5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x58af('0x0'));var moment=require(_0x58af('0x1'));var BPromise=require(_0x58af('0x2'));var rs=require(_0x58af('0x3'));var fs=require('fs');var Redis=require(_0x58af('0x4'));var db=require(_0x58af('0x5'))['db'];var utils=require(_0x58af('0x6'));var logger=require(_0x58af('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x58af('0x8'));var client=jayson[_0x58af('0x9')][_0x58af('0xa')]({'port':0x232a});config[_0x58af('0xb')]=_[_0x58af('0xc')](config['redis'],{'host':_0x58af('0xd'),'port':0x18eb});var socket=require(_0x58af('0xe'))(new Redis(config[_0x58af('0xb')]));require('./openchannelQueue.socket')[_0x58af('0xf')](socket);function respondWithRpcPromise(_0x192f99,_0xb98877,_0x4d7645){return new BPromise(function(_0x17340b,_0x255b12){return client['request'](_0x192f99,_0x4d7645)[_0x58af('0x10')](function(_0x144fd2){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0xb98877,_0x58af('0x11'));logger['debug'](_0x58af('0x12'),_0xb98877,_0x58af('0x11'),JSON['stringify'](_0x144fd2));if(_0x144fd2[_0x58af('0x13')]){if(_0x144fd2['error'][_0x58af('0x14')]===0x1f4){logger['error'](_0x58af('0x15'),_0xb98877,_0x144fd2[_0x58af('0x13')][_0x58af('0x16')]);return _0x255b12(_0x144fd2[_0x58af('0x13')]['message']);}logger[_0x58af('0x13')](_0x58af('0x15'),_0xb98877,_0x144fd2[_0x58af('0x13')][_0x58af('0x16')]);return _0x17340b(_0x144fd2[_0x58af('0x13')][_0x58af('0x16')]);}else{logger[_0x58af('0x17')](_0x58af('0x15'),_0xb98877,_0x58af('0x11'));_0x17340b(_0x144fd2['result'][_0x58af('0x16')]);}})['catch'](function(_0x205d47){logger['error'](_0x58af('0x15'),_0xb98877,_0x205d47);_0x255b12(_0x205d47);});});}exports[_0x58af('0x18')]=function(_0xe5f466){var _0x30aa1a=this;return new Promise(function(_0x274582,_0x3ec8e5){return db[_0x58af('0x19')][_0x58af('0x1a')]({'raw':_0xe5f466[_0x58af('0x1b')]?_0xe5f466[_0x58af('0x1b')][_0x58af('0x1c')]===undefined?!![]:![]:!![],'where':_0xe5f466['options']?_0xe5f466[_0x58af('0x1b')][_0x58af('0x1d')]||null:null,'attributes':_0xe5f466['options']?_0xe5f466[_0x58af('0x1b')][_0x58af('0x1e')]||null:null,'limit':_0xe5f466[_0x58af('0x1b')]?_0xe5f466[_0x58af('0x1b')]['limit']||null:null,'include':_0xe5f466['options']?_0xe5f466[_0x58af('0x1b')]['include']?_['map'](_0xe5f466[_0x58af('0x1b')][_0x58af('0x1f')],function(_0x599aa5){return{'model':db[_0x599aa5[_0x58af('0x20')]],'as':_0x599aa5['as'],'attributes':_0x599aa5['attributes'],'include':_0x599aa5['include']?_[_0x58af('0x21')](_0x599aa5[_0x58af('0x1f')],function(_0x13fbad){return{'model':db[_0x13fbad[_0x58af('0x20')]],'as':_0x13fbad['as'],'attributes':_0x13fbad[_0x58af('0x1e')],'include':_0x13fbad[_0x58af('0x1f')]?_[_0x58af('0x21')](_0x13fbad[_0x58af('0x1f')],function(_0x5296c7){return{'model':db[_0x5296c7['model']],'as':_0x5296c7['as'],'attributes':_0x5296c7[_0x58af('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x58af('0x10')](function(_0x5659c8){logger['info'](_0x58af('0x18'),_0xe5f466);logger['debug'](_0x58af('0x18'),_0xe5f466,JSON[_0x58af('0x22')](_0x5659c8));_0x274582(_0x5659c8);})['catch'](function(_0x36f9ea){logger['error'](_0x58af('0x18'),_0x36f9ea[_0x58af('0x16')],_0xe5f466);_0x3ec8e5(_0x30aa1a[_0x58af('0x13')](0x1f4,_0x36f9ea[_0x58af('0x16')]));});});};exports[_0x58af('0x23')]=function(_0x3ec254){var _0x2be076=this;return new Promise(function(_0x249641,_0x3f66f4){return db['OpenchannelQueue'][_0x58af('0x24')]({'raw':_0x3ec254[_0x58af('0x1b')]?_0x3ec254[_0x58af('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3ec254[_0x58af('0x1b')]?_0x3ec254[_0x58af('0x1b')][_0x58af('0x1d')]||null:null,'attributes':_0x3ec254[_0x58af('0x1b')]?_0x3ec254[_0x58af('0x1b')]['attributes']||null:null,'include':_0x3ec254[_0x58af('0x1b')]?_0x3ec254[_0x58af('0x1b')][_0x58af('0x1f')]?_[_0x58af('0x21')](_0x3ec254['options'][_0x58af('0x1f')],function(_0x5be4df){return{'model':db[_0x5be4df[_0x58af('0x20')]],'as':_0x5be4df['as'],'attributes':_0x5be4df[_0x58af('0x1e')],'include':_0x5be4df[_0x58af('0x1f')]?_[_0x58af('0x21')](_0x5be4df[_0x58af('0x1f')],function(_0x5bc218){return{'model':db[_0x5bc218[_0x58af('0x20')]],'as':_0x5bc218['as'],'attributes':_0x5bc218[_0x58af('0x1e')],'include':_0x5bc218['include']?_['map'](_0x5bc218[_0x58af('0x1f')],function(_0x408c90){return{'model':db[_0x408c90[_0x58af('0x20')]],'as':_0x408c90['as'],'attributes':_0x408c90[_0x58af('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x141a80){logger[_0x58af('0x17')](_0x58af('0x23'),_0x3ec254);logger[_0x58af('0x25')](_0x58af('0x23'),_0x3ec254,JSON['stringify'](_0x141a80));_0x249641(_0x141a80);})[_0x58af('0x26')](function(_0x5793f6){logger[_0x58af('0x13')](_0x58af('0x23'),_0x5793f6[_0x58af('0x16')],_0x3ec254);_0x3f66f4(_0x2be076[_0x58af('0x13')](0x1f4,_0x5793f6['message']));});});};
\ No newline at end of file