Built motion from commit 775e2a94.|2.6.3
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index ceecec0..db88674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f96=['ShowSmsQueue','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSmsQueue','findAll','options','attributes','limit','map','include','model','stringify','SmsQueue','find','raw','where'];(function(_0x1018cc,_0x586e82){var _0x8ac101=function(_0x4cdac3){while(--_0x4cdac3){_0x1018cc['push'](_0x1018cc['shift']());}};_0x8ac101(++_0x586e82);}(_0x5f96,0xce));var _0x65f9=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f96[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x65f9('0x0'));var util=require(_0x65f9('0x1'));var moment=require(_0x65f9('0x2'));var BPromise=require(_0x65f9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x65f9('0x5'));var logger=require(_0x65f9('0x6'))('rpc');var config=require(_0x65f9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x65f9('0x8')][_0x65f9('0x9')]({'port':0x232a});config[_0x65f9('0xa')]=_[_0x65f9('0xb')](config['redis'],{'host':_0x65f9('0xc'),'port':0x18eb});var socket=require(_0x65f9('0xd'))(new Redis(config[_0x65f9('0xa')]));require('./smsQueue.socket')[_0x65f9('0xe')](socket);function respondWithRpcPromise(_0x15a760,_0x1ad8c2,_0x363710){return new BPromise(function(_0x22571e,_0x1ee969){return client[_0x65f9('0xf')](_0x15a760,_0x363710)[_0x65f9('0x10')](function(_0x48609a){logger[_0x65f9('0x11')](_0x65f9('0x12'),_0x1ad8c2,'request\x20sent');logger[_0x65f9('0x13')](_0x65f9('0x14'),_0x1ad8c2,_0x65f9('0x15'),JSON['stringify'](_0x48609a));if(_0x48609a[_0x65f9('0x16')]){if(_0x48609a[_0x65f9('0x16')][_0x65f9('0x17')]===0x1f4){logger[_0x65f9('0x16')](_0x65f9('0x12'),_0x1ad8c2,_0x48609a[_0x65f9('0x16')][_0x65f9('0x18')]);return _0x1ee969(_0x48609a[_0x65f9('0x16')][_0x65f9('0x18')]);}logger[_0x65f9('0x16')](_0x65f9('0x12'),_0x1ad8c2,_0x48609a[_0x65f9('0x16')][_0x65f9('0x18')]);return _0x22571e(_0x48609a[_0x65f9('0x16')][_0x65f9('0x18')]);}else{logger[_0x65f9('0x11')](_0x65f9('0x12'),_0x1ad8c2,_0x65f9('0x15'));_0x22571e(_0x48609a[_0x65f9('0x19')]['message']);}})[_0x65f9('0x1a')](function(_0x277b17){logger['error'](_0x65f9('0x12'),_0x1ad8c2,_0x277b17);_0x1ee969(_0x277b17);});});}exports[_0x65f9('0x1b')]=function(_0x38173b){var _0x3dcc6b=this;return new Promise(function(_0x3758b6,_0x5ecdab){return db['SmsQueue'][_0x65f9('0x1c')]({'raw':_0x38173b[_0x65f9('0x1d')]?_0x38173b['options']['raw']===undefined?!![]:![]:!![],'where':_0x38173b[_0x65f9('0x1d')]?_0x38173b[_0x65f9('0x1d')]['where']||null:null,'attributes':_0x38173b[_0x65f9('0x1d')]?_0x38173b[_0x65f9('0x1d')][_0x65f9('0x1e')]||null:null,'limit':_0x38173b[_0x65f9('0x1d')]?_0x38173b['options'][_0x65f9('0x1f')]||null:null,'include':_0x38173b[_0x65f9('0x1d')]?_0x38173b[_0x65f9('0x1d')]['include']?_[_0x65f9('0x20')](_0x38173b[_0x65f9('0x1d')][_0x65f9('0x21')],function(_0x398ec0){return{'model':db[_0x398ec0['model']],'as':_0x398ec0['as'],'attributes':_0x398ec0[_0x65f9('0x1e')],'include':_0x398ec0[_0x65f9('0x21')]?_[_0x65f9('0x20')](_0x398ec0[_0x65f9('0x21')],function(_0x24b907){return{'model':db[_0x24b907[_0x65f9('0x22')]],'as':_0x24b907['as'],'attributes':_0x24b907[_0x65f9('0x1e')],'include':_0x24b907[_0x65f9('0x21')]?_['map'](_0x24b907[_0x65f9('0x21')],function(_0x3f75d7){return{'model':db[_0x3f75d7[_0x65f9('0x22')]],'as':_0x3f75d7['as'],'attributes':_0x3f75d7[_0x65f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x65f9('0x10')](function(_0x12f3e2){logger[_0x65f9('0x11')]('GetSmsQueue',_0x38173b);logger[_0x65f9('0x13')]('GetSmsQueue',_0x38173b,JSON[_0x65f9('0x23')](_0x12f3e2));_0x3758b6(_0x12f3e2);})[_0x65f9('0x1a')](function(_0x34fa8a){logger[_0x65f9('0x16')](_0x65f9('0x1b'),_0x34fa8a[_0x65f9('0x18')],_0x38173b);_0x5ecdab(_0x3dcc6b[_0x65f9('0x16')](0x1f4,_0x34fa8a[_0x65f9('0x18')]));});});};exports['ShowSmsQueue']=function(_0x42cdc9){var _0x355c15=this;return new Promise(function(_0x57c60d,_0xfea585){return db[_0x65f9('0x24')][_0x65f9('0x25')]({'raw':_0x42cdc9[_0x65f9('0x1d')]?_0x42cdc9[_0x65f9('0x1d')][_0x65f9('0x26')]===undefined?!![]:![]:!![],'where':_0x42cdc9[_0x65f9('0x1d')]?_0x42cdc9[_0x65f9('0x1d')][_0x65f9('0x27')]||null:null,'attributes':_0x42cdc9[_0x65f9('0x1d')]?_0x42cdc9[_0x65f9('0x1d')][_0x65f9('0x1e')]||null:null,'include':_0x42cdc9['options']?_0x42cdc9['options']['include']?_[_0x65f9('0x20')](_0x42cdc9[_0x65f9('0x1d')]['include'],function(_0x2e681e){return{'model':db[_0x2e681e['model']],'as':_0x2e681e['as'],'attributes':_0x2e681e['attributes'],'include':_0x2e681e[_0x65f9('0x21')]?_[_0x65f9('0x20')](_0x2e681e['include'],function(_0xe37ca4){return{'model':db[_0xe37ca4['model']],'as':_0xe37ca4['as'],'attributes':_0xe37ca4[_0x65f9('0x1e')],'include':_0xe37ca4[_0x65f9('0x21')]?_[_0x65f9('0x20')](_0xe37ca4[_0x65f9('0x21')],function(_0x215c8){return{'model':db[_0x215c8['model']],'as':_0x215c8['as'],'attributes':_0x215c8[_0x65f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x65f9('0x10')](function(_0x37d93b){logger[_0x65f9('0x11')](_0x65f9('0x28'),_0x42cdc9);logger['debug'](_0x65f9('0x28'),_0x42cdc9,JSON[_0x65f9('0x23')](_0x37d93b));_0x57c60d(_0x37d93b);})[_0x65f9('0x1a')](function(_0x31e419){logger[_0x65f9('0x16')](_0x65f9('0x28'),_0x31e419[_0x65f9('0x18')],_0x42cdc9);_0xfea585(_0x355c15[_0x65f9('0x16')](0x1f4,_0x31e419[_0x65f9('0x18')]));});});};
\ No newline at end of file
+var _0x7653=['bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsQueue','options','raw','limit','include','map','attributes','model','GetSmsQueue','debug','ShowSmsQueue','where','lodash','moment'];(function(_0x33929f,_0x139567){var _0x299f88=function(_0x10ca1a){while(--_0x10ca1a){_0x33929f['push'](_0x33929f['shift']());}};_0x299f88(++_0x139567);}(_0x7653,0x64));var _0x3765=function(_0x3355,_0x9b2e0f){_0x3355=_0x3355-0x0;var _0x3fcab2=_0x7653[_0x3355];return _0x3fcab2;};'use strict';var _=require(_0x3765('0x0'));var util=require('util');var moment=require(_0x3765('0x1'));var BPromise=require(_0x3765('0x2'));var rs=require(_0x3765('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3765('0x4'));var logger=require(_0x3765('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3765('0x6'));var client=jayson[_0x3765('0x7')][_0x3765('0x8')]({'port':0x232a});config[_0x3765('0x9')]=_[_0x3765('0xa')](config[_0x3765('0x9')],{'host':_0x3765('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3765('0x9')]));require(_0x3765('0xc'))['register'](socket);function respondWithRpcPromise(_0x543048,_0xa71f78,_0x411648){return new BPromise(function(_0x1383d7,_0x31e915){return client['request'](_0x543048,_0x411648)[_0x3765('0xd')](function(_0x1486d1){logger[_0x3765('0xe')](_0x3765('0xf'),_0xa71f78,_0x3765('0x10'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0xa71f78,_0x3765('0x10'),JSON[_0x3765('0x11')](_0x1486d1));if(_0x1486d1[_0x3765('0x12')]){if(_0x1486d1['error'][_0x3765('0x13')]===0x1f4){logger[_0x3765('0x12')]('SmsQueue,\x20%s,\x20%s',_0xa71f78,_0x1486d1[_0x3765('0x12')][_0x3765('0x14')]);return _0x31e915(_0x1486d1[_0x3765('0x12')][_0x3765('0x14')]);}logger[_0x3765('0x12')](_0x3765('0xf'),_0xa71f78,_0x1486d1[_0x3765('0x12')][_0x3765('0x14')]);return _0x1383d7(_0x1486d1[_0x3765('0x12')]['message']);}else{logger[_0x3765('0xe')]('SmsQueue,\x20%s,\x20%s',_0xa71f78,_0x3765('0x10'));_0x1383d7(_0x1486d1['result'][_0x3765('0x14')]);}})[_0x3765('0x15')](function(_0x2552cf){logger[_0x3765('0x12')](_0x3765('0xf'),_0xa71f78,_0x2552cf);_0x31e915(_0x2552cf);});});}exports['GetSmsQueue']=function(_0x350e9f){var _0xd1cca9=this;return new Promise(function(_0x2e9e1c,_0x23c67b){return db[_0x3765('0x16')]['findAll']({'raw':_0x350e9f[_0x3765('0x17')]?_0x350e9f[_0x3765('0x17')][_0x3765('0x18')]===undefined?!![]:![]:!![],'where':_0x350e9f[_0x3765('0x17')]?_0x350e9f[_0x3765('0x17')]['where']||null:null,'attributes':_0x350e9f[_0x3765('0x17')]?_0x350e9f[_0x3765('0x17')]['attributes']||null:null,'limit':_0x350e9f['options']?_0x350e9f['options'][_0x3765('0x19')]||null:null,'include':_0x350e9f['options']?_0x350e9f[_0x3765('0x17')][_0x3765('0x1a')]?_[_0x3765('0x1b')](_0x350e9f[_0x3765('0x17')][_0x3765('0x1a')],function(_0x35c401){return{'model':db[_0x35c401['model']],'as':_0x35c401['as'],'attributes':_0x35c401[_0x3765('0x1c')],'include':_0x35c401[_0x3765('0x1a')]?_['map'](_0x35c401[_0x3765('0x1a')],function(_0xcc3375){return{'model':db[_0xcc3375[_0x3765('0x1d')]],'as':_0xcc3375['as'],'attributes':_0xcc3375['attributes'],'include':_0xcc3375[_0x3765('0x1a')]?_[_0x3765('0x1b')](_0xcc3375[_0x3765('0x1a')],function(_0x21b378){return{'model':db[_0x21b378['model']],'as':_0x21b378['as'],'attributes':_0x21b378[_0x3765('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e08fc){logger[_0x3765('0xe')](_0x3765('0x1e'),_0x350e9f);logger[_0x3765('0x1f')](_0x3765('0x1e'),_0x350e9f,JSON[_0x3765('0x11')](_0x2e08fc));_0x2e9e1c(_0x2e08fc);})[_0x3765('0x15')](function(_0x52b222){logger[_0x3765('0x12')](_0x3765('0x1e'),_0x52b222[_0x3765('0x14')],_0x350e9f);_0x23c67b(_0xd1cca9['error'](0x1f4,_0x52b222[_0x3765('0x14')]));});});};exports[_0x3765('0x20')]=function(_0x7f40e4){var _0x43f79f=this;return new Promise(function(_0x102a94,_0x1db412){return db[_0x3765('0x16')]['find']({'raw':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')][_0x3765('0x18')]===undefined?!![]:![]:!![],'where':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')][_0x3765('0x21')]||null:null,'attributes':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')][_0x3765('0x1c')]||null:null,'include':_0x7f40e4[_0x3765('0x17')]?_0x7f40e4[_0x3765('0x17')]['include']?_[_0x3765('0x1b')](_0x7f40e4['options']['include'],function(_0xd69f07){return{'model':db[_0xd69f07['model']],'as':_0xd69f07['as'],'attributes':_0xd69f07[_0x3765('0x1c')],'include':_0xd69f07[_0x3765('0x1a')]?_[_0x3765('0x1b')](_0xd69f07['include'],function(_0x289805){return{'model':db[_0x289805[_0x3765('0x1d')]],'as':_0x289805['as'],'attributes':_0x289805[_0x3765('0x1c')],'include':_0x289805[_0x3765('0x1a')]?_[_0x3765('0x1b')](_0x289805[_0x3765('0x1a')],function(_0xbaaaee){return{'model':db[_0xbaaaee[_0x3765('0x1d')]],'as':_0xbaaaee['as'],'attributes':_0xbaaaee[_0x3765('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3765('0xd')](function(_0x516458){logger[_0x3765('0xe')]('ShowSmsQueue',_0x7f40e4);logger[_0x3765('0x1f')]('ShowSmsQueue',_0x7f40e4,JSON[_0x3765('0x11')](_0x516458));_0x102a94(_0x516458);})[_0x3765('0x15')](function(_0x37dea0){logger[_0x3765('0x12')](_0x3765('0x20'),_0x37dea0[_0x3765('0x14')],_0x7f40e4);_0x1db412(_0x43f79f['error'](0x1f4,_0x37dea0[_0x3765('0x14')]));});});};
\ No newline at end of file