Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index 04ec7ac..cca9ec9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70d5=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','then','info','SmsQueue,\x20%s,\x20%s','SmsQueue,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetSmsQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','SmsQueue','ShowSmsQueue','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4bd205,_0x164aa6){var _0x673a4=function(_0x1463a7){while(--_0x1463a7){_0x4bd205['push'](_0x4bd205['shift']());}};_0x673a4(++_0x164aa6);}(_0x70d5,0x10b));var _0x570d=function(_0x59f148,_0x20c351){_0x59f148=_0x59f148-0x0;var _0x33cde9=_0x70d5[_0x59f148];return _0x33cde9;};'use strict';var _=require(_0x570d('0x0'));var util=require(_0x570d('0x1'));var moment=require('moment');var BPromise=require(_0x570d('0x2'));var rs=require(_0x570d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x570d('0x4'))['db'];var utils=require(_0x570d('0x5'));var logger=require(_0x570d('0x6'))(_0x570d('0x7'));var config=require(_0x570d('0x8'));var jayson=require(_0x570d('0x9'));var client=jayson['client'][_0x570d('0xa')]({'port':0x232a});config[_0x570d('0xb')]=_[_0x570d('0xc')](config[_0x570d('0xb')],{'host':_0x570d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x570d('0xe')](socket);function respondWithRpcPromise(_0x3edcf8,_0x5af7db,_0x4d531d){return new BPromise(function(_0x269e27,_0x4c04ed){return client[_0x570d('0xf')](_0x3edcf8,_0x4d531d)[_0x570d('0x10')](function(_0x321ee0){logger[_0x570d('0x11')](_0x570d('0x12'),_0x5af7db,'request\x20sent');logger['debug'](_0x570d('0x13'),_0x5af7db,'request\x20sent',JSON['stringify'](_0x321ee0));if(_0x321ee0[_0x570d('0x14')]){if(_0x321ee0[_0x570d('0x14')]['code']===0x1f4){logger['error'](_0x570d('0x12'),_0x5af7db,_0x321ee0[_0x570d('0x14')]['message']);return _0x4c04ed(_0x321ee0[_0x570d('0x14')][_0x570d('0x15')]);}logger[_0x570d('0x14')]('SmsQueue,\x20%s,\x20%s',_0x5af7db,_0x321ee0[_0x570d('0x14')]['message']);return _0x269e27(_0x321ee0[_0x570d('0x14')][_0x570d('0x15')]);}else{logger[_0x570d('0x11')](_0x570d('0x12'),_0x5af7db,_0x570d('0x16'));_0x269e27(_0x321ee0[_0x570d('0x17')][_0x570d('0x15')]);}})[_0x570d('0x18')](function(_0x1ea848){logger[_0x570d('0x14')](_0x570d('0x12'),_0x5af7db,_0x1ea848);_0x4c04ed(_0x1ea848);});});}exports[_0x570d('0x19')]=function(_0x2233c3){var _0x4e92a5=this;return new Promise(function(_0xf257bc,_0x5018f5){return db['SmsQueue'][_0x570d('0x1a')]({'raw':_0x2233c3[_0x570d('0x1b')]?_0x2233c3[_0x570d('0x1b')][_0x570d('0x1c')]===undefined?!![]:![]:!![],'where':_0x2233c3[_0x570d('0x1b')]?_0x2233c3[_0x570d('0x1b')][_0x570d('0x1d')]||null:null,'attributes':_0x2233c3['options']?_0x2233c3['options'][_0x570d('0x1e')]||null:null,'limit':_0x2233c3[_0x570d('0x1b')]?_0x2233c3['options'][_0x570d('0x1f')]||null:null,'include':_0x2233c3[_0x570d('0x1b')]?_0x2233c3[_0x570d('0x1b')][_0x570d('0x20')]?_[_0x570d('0x21')](_0x2233c3[_0x570d('0x1b')][_0x570d('0x20')],function(_0x3ceac9){return{'model':db[_0x3ceac9[_0x570d('0x22')]],'as':_0x3ceac9['as'],'attributes':_0x3ceac9['attributes'],'include':_0x3ceac9[_0x570d('0x20')]?_['map'](_0x3ceac9['include'],function(_0x580d30){return{'model':db[_0x580d30['model']],'as':_0x580d30['as'],'attributes':_0x580d30[_0x570d('0x1e')],'include':_0x580d30[_0x570d('0x20')]?_[_0x570d('0x21')](_0x580d30['include'],function(_0x1b2608){return{'model':db[_0x1b2608[_0x570d('0x22')]],'as':_0x1b2608['as'],'attributes':_0x1b2608[_0x570d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b7675){logger[_0x570d('0x11')](_0x570d('0x19'),_0x2233c3);logger[_0x570d('0x23')](_0x570d('0x19'),_0x2233c3,JSON[_0x570d('0x24')](_0x3b7675));_0xf257bc(_0x3b7675);})[_0x570d('0x18')](function(_0x5c7668){logger['error'](_0x570d('0x19'),_0x5c7668['message'],_0x2233c3);_0x5018f5(_0x4e92a5[_0x570d('0x14')](0x1f4,_0x5c7668[_0x570d('0x15')]));});});};exports['ShowSmsQueue']=function(_0x16dbe9){var _0x473c98=this;return new Promise(function(_0x3ab696,_0x538f78){return db[_0x570d('0x25')]['find']({'raw':_0x16dbe9[_0x570d('0x1b')]?_0x16dbe9['options'][_0x570d('0x1c')]===undefined?!![]:![]:!![],'where':_0x16dbe9['options']?_0x16dbe9['options']['where']||null:null,'attributes':_0x16dbe9[_0x570d('0x1b')]?_0x16dbe9[_0x570d('0x1b')][_0x570d('0x1e')]||null:null,'include':_0x16dbe9[_0x570d('0x1b')]?_0x16dbe9[_0x570d('0x1b')][_0x570d('0x20')]?_[_0x570d('0x21')](_0x16dbe9['options']['include'],function(_0x2618c0){return{'model':db[_0x2618c0['model']],'as':_0x2618c0['as'],'attributes':_0x2618c0[_0x570d('0x1e')],'include':_0x2618c0[_0x570d('0x20')]?_[_0x570d('0x21')](_0x2618c0[_0x570d('0x20')],function(_0x3818fd){return{'model':db[_0x3818fd[_0x570d('0x22')]],'as':_0x3818fd['as'],'attributes':_0x3818fd['attributes'],'include':_0x3818fd[_0x570d('0x20')]?_['map'](_0x3818fd[_0x570d('0x20')],function(_0x171e00){return{'model':db[_0x171e00[_0x570d('0x22')]],'as':_0x171e00['as'],'attributes':_0x171e00['attributes']};}):[]};}):[]};}):[]:[]})[_0x570d('0x10')](function(_0x421690){logger['info'](_0x570d('0x26'),_0x16dbe9);logger[_0x570d('0x23')](_0x570d('0x26'),_0x16dbe9,JSON[_0x570d('0x24')](_0x421690));_0x3ab696(_0x421690);})[_0x570d('0x18')](function(_0x4ab8fe){logger['error'](_0x570d('0x26'),_0x4ab8fe['message'],_0x16dbe9);_0x538f78(_0x473c98['error'](0x1f4,_0x4ab8fe[_0x570d('0x15')]));});});};
\ No newline at end of file
+var _0x5f0b=['options','raw','where','attributes','limit','include','map','model','then','ShowSmsQueue','find','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue'];(function(_0x3578ac,_0x31e6fa){var _0x21f362=function(_0x5c6ce6){while(--_0x5c6ce6){_0x3578ac['push'](_0x3578ac['shift']());}};_0x21f362(++_0x31e6fa);}(_0x5f0b,0xa7));var _0xb5f0=function(_0xb58c21,_0x1450dc){_0xb58c21=_0xb58c21-0x0;var _0x24773e=_0x5f0b[_0xb58c21];return _0x24773e;};'use strict';var _=require('lodash');var util=require(_0xb5f0('0x0'));var moment=require(_0xb5f0('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5f0('0x2'));var fs=require('fs');var Redis=require(_0xb5f0('0x3'));var db=require(_0xb5f0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5f0('0x5'));var config=require(_0xb5f0('0x6'));var jayson=require(_0xb5f0('0x7'));var client=jayson[_0xb5f0('0x8')][_0xb5f0('0x9')]({'port':0x232a});config[_0xb5f0('0xa')]=_[_0xb5f0('0xb')](config[_0xb5f0('0xa')],{'host':_0xb5f0('0xc'),'port':0x18eb});var socket=require(_0xb5f0('0xd'))(new Redis(config['redis']));require(_0xb5f0('0xe'))[_0xb5f0('0xf')](socket);function respondWithRpcPromise(_0x1ad6e7,_0x6cda90,_0x5d2ccd){return new BPromise(function(_0x493999,_0x4dc5c8){return client['request'](_0x1ad6e7,_0x5d2ccd)['then'](function(_0x1ded18){logger['info'](_0xb5f0('0x10'),_0x6cda90,_0xb5f0('0x11'));logger[_0xb5f0('0x12')](_0xb5f0('0x13'),_0x6cda90,_0xb5f0('0x11'),JSON[_0xb5f0('0x14')](_0x1ded18));if(_0x1ded18[_0xb5f0('0x15')]){if(_0x1ded18[_0xb5f0('0x15')][_0xb5f0('0x16')]===0x1f4){logger['error'](_0xb5f0('0x10'),_0x6cda90,_0x1ded18[_0xb5f0('0x15')][_0xb5f0('0x17')]);return _0x4dc5c8(_0x1ded18[_0xb5f0('0x15')]['message']);}logger[_0xb5f0('0x15')]('SmsQueue,\x20%s,\x20%s',_0x6cda90,_0x1ded18[_0xb5f0('0x15')][_0xb5f0('0x17')]);return _0x493999(_0x1ded18[_0xb5f0('0x15')][_0xb5f0('0x17')]);}else{logger[_0xb5f0('0x18')](_0xb5f0('0x10'),_0x6cda90,'request\x20sent');_0x493999(_0x1ded18[_0xb5f0('0x19')][_0xb5f0('0x17')]);}})[_0xb5f0('0x1a')](function(_0x435fe4){logger[_0xb5f0('0x15')]('SmsQueue,\x20%s,\x20%s',_0x6cda90,_0x435fe4);_0x4dc5c8(_0x435fe4);});});}exports[_0xb5f0('0x1b')]=function(_0x47b54d){var _0x4ad368=this;return new Promise(function(_0x43cfe2,_0x48f9d6){return db['SmsQueue']['findAll']({'raw':_0x47b54d[_0xb5f0('0x1c')]?_0x47b54d['options'][_0xb5f0('0x1d')]===undefined?!![]:![]:!![],'where':_0x47b54d['options']?_0x47b54d['options'][_0xb5f0('0x1e')]||null:null,'attributes':_0x47b54d[_0xb5f0('0x1c')]?_0x47b54d['options'][_0xb5f0('0x1f')]||null:null,'limit':_0x47b54d['options']?_0x47b54d[_0xb5f0('0x1c')][_0xb5f0('0x20')]||null:null,'include':_0x47b54d['options']?_0x47b54d[_0xb5f0('0x1c')][_0xb5f0('0x21')]?_[_0xb5f0('0x22')](_0x47b54d[_0xb5f0('0x1c')][_0xb5f0('0x21')],function(_0x386916){return{'model':db[_0x386916['model']],'as':_0x386916['as'],'attributes':_0x386916[_0xb5f0('0x1f')],'include':_0x386916['include']?_['map'](_0x386916['include'],function(_0x37db95){return{'model':db[_0x37db95[_0xb5f0('0x23')]],'as':_0x37db95['as'],'attributes':_0x37db95[_0xb5f0('0x1f')],'include':_0x37db95[_0xb5f0('0x21')]?_['map'](_0x37db95['include'],function(_0x2b43bd){return{'model':db[_0x2b43bd[_0xb5f0('0x23')]],'as':_0x2b43bd['as'],'attributes':_0x2b43bd['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5f0('0x24')](function(_0x407de1){logger['info']('GetSmsQueue',_0x47b54d);logger[_0xb5f0('0x12')](_0xb5f0('0x1b'),_0x47b54d,JSON[_0xb5f0('0x14')](_0x407de1));_0x43cfe2(_0x407de1);})['catch'](function(_0x1f7f8f){logger[_0xb5f0('0x15')](_0xb5f0('0x1b'),_0x1f7f8f[_0xb5f0('0x17')],_0x47b54d);_0x48f9d6(_0x4ad368[_0xb5f0('0x15')](0x1f4,_0x1f7f8f[_0xb5f0('0x17')]));});});};exports[_0xb5f0('0x25')]=function(_0xe9f381){var _0x5bf7b4=this;return new Promise(function(_0x319b16,_0x5136d9){return db['SmsQueue'][_0xb5f0('0x26')]({'raw':_0xe9f381[_0xb5f0('0x1c')]?_0xe9f381[_0xb5f0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xe9f381['options']?_0xe9f381[_0xb5f0('0x1c')]['where']||null:null,'attributes':_0xe9f381[_0xb5f0('0x1c')]?_0xe9f381['options']['attributes']||null:null,'include':_0xe9f381[_0xb5f0('0x1c')]?_0xe9f381[_0xb5f0('0x1c')][_0xb5f0('0x21')]?_[_0xb5f0('0x22')](_0xe9f381['options'][_0xb5f0('0x21')],function(_0x193d59){return{'model':db[_0x193d59['model']],'as':_0x193d59['as'],'attributes':_0x193d59[_0xb5f0('0x1f')],'include':_0x193d59[_0xb5f0('0x21')]?_[_0xb5f0('0x22')](_0x193d59['include'],function(_0x411997){return{'model':db[_0x411997['model']],'as':_0x411997['as'],'attributes':_0x411997[_0xb5f0('0x1f')],'include':_0x411997['include']?_[_0xb5f0('0x22')](_0x411997[_0xb5f0('0x21')],function(_0x34735a){return{'model':db[_0x34735a[_0xb5f0('0x23')]],'as':_0x34735a['as'],'attributes':_0x34735a[_0xb5f0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5f0('0x24')](function(_0x29967c){logger[_0xb5f0('0x18')]('ShowSmsQueue',_0xe9f381);logger[_0xb5f0('0x12')](_0xb5f0('0x25'),_0xe9f381,JSON['stringify'](_0x29967c));_0x319b16(_0x29967c);})['catch'](function(_0x2e07c0){logger[_0xb5f0('0x15')](_0xb5f0('0x25'),_0x2e07c0['message'],_0xe9f381);_0x5136d9(_0x5bf7b4[_0xb5f0('0x15')](0x1f4,_0x2e07c0['message']));});});};
\ No newline at end of file