Built motion from commit (unavailable).|2.5.6
[motion2.git] / server / api / smsQueue / smsQueue.rpc.js
index aa82752..903b5fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc560=['request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SmsQueue','findAll','options','raw','where','limit','include','model','attributes','map','then','GetSmsQueue','catch','ShowSmsQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./smsQueue.socket','register'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xc560,0x181));var _0x0c56=function(_0x4de38f,_0x3c8dd1){_0x4de38f=_0x4de38f-0x0;var _0x259ab5=_0xc560[_0x4de38f];return _0x259ab5;};'use strict';var _=require('lodash');var util=require(_0x0c56('0x0'));var moment=require(_0x0c56('0x1'));var BPromise=require(_0x0c56('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c56('0x3'));var db=require(_0x0c56('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c56('0x5'))(_0x0c56('0x6'));var config=require(_0x0c56('0x7'));var jayson=require(_0x0c56('0x8'));var client=jayson[_0x0c56('0x9')][_0x0c56('0xa')]({'port':0x232a});config['redis']=_[_0x0c56('0xb')](config[_0x0c56('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c56('0xc')]));require(_0x0c56('0xd'))[_0x0c56('0xe')](socket);function respondWithRpcPromise(_0x5771a9,_0x5973fc,_0x519dfa){return new BPromise(function(_0x3e451b,_0x44c115){return client[_0x0c56('0xf')](_0x5771a9,_0x519dfa)['then'](function(_0x7d6eb2){logger[_0x0c56('0x10')](_0x0c56('0x11'),_0x5973fc,_0x0c56('0x12'));logger[_0x0c56('0x13')](_0x0c56('0x14'),_0x5973fc,_0x0c56('0x12'),JSON[_0x0c56('0x15')](_0x7d6eb2));if(_0x7d6eb2[_0x0c56('0x16')]){if(_0x7d6eb2[_0x0c56('0x16')]['code']===0x1f4){logger[_0x0c56('0x16')]('SmsQueue,\x20%s,\x20%s',_0x5973fc,_0x7d6eb2[_0x0c56('0x16')]['message']);return _0x44c115(_0x7d6eb2[_0x0c56('0x16')][_0x0c56('0x17')]);}logger['error'](_0x0c56('0x11'),_0x5973fc,_0x7d6eb2['error'][_0x0c56('0x17')]);return _0x3e451b(_0x7d6eb2[_0x0c56('0x16')]['message']);}else{logger['info'](_0x0c56('0x11'),_0x5973fc,_0x0c56('0x12'));_0x3e451b(_0x7d6eb2[_0x0c56('0x18')][_0x0c56('0x17')]);}})['catch'](function(_0x2ebaef){logger['error'](_0x0c56('0x11'),_0x5973fc,_0x2ebaef);_0x44c115(_0x2ebaef);});});}exports['GetSmsQueue']=function(_0x1c156a){var _0x3dcf3f=this;return new Promise(function(_0x1d3a6b,_0xc34331){return db[_0x0c56('0x19')][_0x0c56('0x1a')]({'raw':_0x1c156a[_0x0c56('0x1b')]?_0x1c156a[_0x0c56('0x1b')][_0x0c56('0x1c')]===undefined?!![]:![]:!![],'where':_0x1c156a[_0x0c56('0x1b')]?_0x1c156a[_0x0c56('0x1b')][_0x0c56('0x1d')]||null:null,'attributes':_0x1c156a[_0x0c56('0x1b')]?_0x1c156a[_0x0c56('0x1b')]['attributes']||null:null,'limit':_0x1c156a['options']?_0x1c156a[_0x0c56('0x1b')][_0x0c56('0x1e')]||null:null,'include':_0x1c156a[_0x0c56('0x1b')]?_0x1c156a[_0x0c56('0x1b')][_0x0c56('0x1f')]?_['map'](_0x1c156a['options'][_0x0c56('0x1f')],function(_0x59df7a){return{'model':db[_0x59df7a[_0x0c56('0x20')]],'as':_0x59df7a['as'],'attributes':_0x59df7a[_0x0c56('0x21')],'include':_0x59df7a[_0x0c56('0x1f')]?_[_0x0c56('0x22')](_0x59df7a[_0x0c56('0x1f')],function(_0x21a771){return{'model':db[_0x21a771['model']],'as':_0x21a771['as'],'attributes':_0x21a771['attributes'],'include':_0x21a771[_0x0c56('0x1f')]?_[_0x0c56('0x22')](_0x21a771['include'],function(_0x128152){return{'model':db[_0x128152['model']],'as':_0x128152['as'],'attributes':_0x128152['attributes']};}):[]};}):[]};}):[]:[]})[_0x0c56('0x23')](function(_0x410687){logger['info'](_0x0c56('0x24'),_0x1c156a);logger[_0x0c56('0x13')](_0x0c56('0x24'),_0x1c156a,JSON['stringify'](_0x410687));_0x1d3a6b(_0x410687);})[_0x0c56('0x25')](function(_0x107d39){logger[_0x0c56('0x16')](_0x0c56('0x24'),_0x107d39[_0x0c56('0x17')],_0x1c156a);_0xc34331(_0x3dcf3f[_0x0c56('0x16')](0x1f4,_0x107d39[_0x0c56('0x17')]));});});};exports[_0x0c56('0x26')]=function(_0x74ed92){var _0x402130=this;return new Promise(function(_0x378428,_0x1805e4){return db[_0x0c56('0x19')][_0x0c56('0x27')]({'raw':_0x74ed92[_0x0c56('0x1b')]?_0x74ed92[_0x0c56('0x1b')][_0x0c56('0x1c')]===undefined?!![]:![]:!![],'where':_0x74ed92[_0x0c56('0x1b')]?_0x74ed92[_0x0c56('0x1b')][_0x0c56('0x1d')]||null:null,'attributes':_0x74ed92['options']?_0x74ed92[_0x0c56('0x1b')][_0x0c56('0x21')]||null:null,'include':_0x74ed92[_0x0c56('0x1b')]?_0x74ed92[_0x0c56('0x1b')]['include']?_['map'](_0x74ed92[_0x0c56('0x1b')]['include'],function(_0x5a3cd8){return{'model':db[_0x5a3cd8['model']],'as':_0x5a3cd8['as'],'attributes':_0x5a3cd8['attributes'],'include':_0x5a3cd8['include']?_[_0x0c56('0x22')](_0x5a3cd8['include'],function(_0x5dc7ef){return{'model':db[_0x5dc7ef[_0x0c56('0x20')]],'as':_0x5dc7ef['as'],'attributes':_0x5dc7ef[_0x0c56('0x21')],'include':_0x5dc7ef['include']?_[_0x0c56('0x22')](_0x5dc7ef[_0x0c56('0x1f')],function(_0x4c3144){return{'model':db[_0x4c3144['model']],'as':_0x4c3144['as'],'attributes':_0x4c3144[_0x0c56('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0c56('0x23')](function(_0x5277eb){logger[_0x0c56('0x10')]('ShowSmsQueue',_0x74ed92);logger[_0x0c56('0x13')](_0x0c56('0x26'),_0x74ed92,JSON[_0x0c56('0x15')](_0x5277eb));_0x378428(_0x5277eb);})[_0x0c56('0x25')](function(_0x1a2d0f){logger['error']('ShowSmsQueue',_0x1a2d0f['message'],_0x74ed92);_0x1805e4(_0x402130[_0x0c56('0x16')](0x1f4,_0x1a2d0f[_0x0c56('0x17')]));});});};
\ No newline at end of file
+var _0xd499=['include','model','attributes','then','debug','GetSmsQueue','ShowSmsQueue','find','map','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','where','limit'];(function(_0x1212d7,_0x28b2e2){var _0x2e1411=function(_0x2199c7){while(--_0x2199c7){_0x1212d7['push'](_0x1212d7['shift']());}};_0x2e1411(++_0x28b2e2);}(_0xd499,0x1e9));var _0x9d49=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xd499[_0x2f6f50];return _0x2cf365;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d49('0x0'));var BPromise=require(_0x9d49('0x1'));var rs=require(_0x9d49('0x2'));var fs=require('fs');var Redis=require(_0x9d49('0x3'));var db=require(_0x9d49('0x4'))['db'];var utils=require(_0x9d49('0x5'));var logger=require(_0x9d49('0x6'))(_0x9d49('0x7'));var config=require(_0x9d49('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d49('0x9')][_0x9d49('0xa')]({'port':0x232a});config[_0x9d49('0xb')]=_[_0x9d49('0xc')](config['redis'],{'host':_0x9d49('0xd'),'port':0x18eb});var socket=require(_0x9d49('0xe'))(new Redis(config[_0x9d49('0xb')]));require(_0x9d49('0xf'))[_0x9d49('0x10')](socket);function respondWithRpcPromise(_0x3cebd5,_0x55d21d,_0x53de04){return new BPromise(function(_0x56a2d5,_0xc69557){return client['request'](_0x3cebd5,_0x53de04)['then'](function(_0x5ca7ff){logger[_0x9d49('0x11')](_0x9d49('0x12'),_0x55d21d,_0x9d49('0x13'));logger['debug'](_0x9d49('0x14'),_0x55d21d,_0x9d49('0x13'),JSON[_0x9d49('0x15')](_0x5ca7ff));if(_0x5ca7ff['error']){if(_0x5ca7ff[_0x9d49('0x16')]['code']===0x1f4){logger[_0x9d49('0x16')](_0x9d49('0x12'),_0x55d21d,_0x5ca7ff['error'][_0x9d49('0x17')]);return _0xc69557(_0x5ca7ff[_0x9d49('0x16')]['message']);}logger[_0x9d49('0x16')]('SmsQueue,\x20%s,\x20%s',_0x55d21d,_0x5ca7ff[_0x9d49('0x16')][_0x9d49('0x17')]);return _0x56a2d5(_0x5ca7ff[_0x9d49('0x16')][_0x9d49('0x17')]);}else{logger[_0x9d49('0x11')](_0x9d49('0x12'),_0x55d21d,_0x9d49('0x13'));_0x56a2d5(_0x5ca7ff[_0x9d49('0x18')][_0x9d49('0x17')]);}})[_0x9d49('0x19')](function(_0x49d5da){logger[_0x9d49('0x16')](_0x9d49('0x12'),_0x55d21d,_0x49d5da);_0xc69557(_0x49d5da);});});}exports['GetSmsQueue']=function(_0x4c8960){var _0x5ce2d5=this;return new Promise(function(_0x165137,_0x4c45e0){return db['SmsQueue'][_0x9d49('0x1a')]({'raw':_0x4c8960[_0x9d49('0x1b')]?_0x4c8960['options'][_0x9d49('0x1c')]===undefined?!![]:![]:!![],'where':_0x4c8960['options']?_0x4c8960[_0x9d49('0x1b')][_0x9d49('0x1d')]||null:null,'attributes':_0x4c8960[_0x9d49('0x1b')]?_0x4c8960[_0x9d49('0x1b')]['attributes']||null:null,'limit':_0x4c8960[_0x9d49('0x1b')]?_0x4c8960[_0x9d49('0x1b')][_0x9d49('0x1e')]||null:null,'include':_0x4c8960[_0x9d49('0x1b')]?_0x4c8960[_0x9d49('0x1b')][_0x9d49('0x1f')]?_['map'](_0x4c8960[_0x9d49('0x1b')][_0x9d49('0x1f')],function(_0x1503f1){return{'model':db[_0x1503f1[_0x9d49('0x20')]],'as':_0x1503f1['as'],'attributes':_0x1503f1[_0x9d49('0x21')],'include':_0x1503f1[_0x9d49('0x1f')]?_['map'](_0x1503f1[_0x9d49('0x1f')],function(_0x5b8d83){return{'model':db[_0x5b8d83[_0x9d49('0x20')]],'as':_0x5b8d83['as'],'attributes':_0x5b8d83[_0x9d49('0x21')],'include':_0x5b8d83['include']?_['map'](_0x5b8d83[_0x9d49('0x1f')],function(_0x2e0d7b){return{'model':db[_0x2e0d7b[_0x9d49('0x20')]],'as':_0x2e0d7b['as'],'attributes':_0x2e0d7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d49('0x22')](function(_0x49e535){logger[_0x9d49('0x11')]('GetSmsQueue',_0x4c8960);logger[_0x9d49('0x23')]('GetSmsQueue',_0x4c8960,JSON[_0x9d49('0x15')](_0x49e535));_0x165137(_0x49e535);})[_0x9d49('0x19')](function(_0x26a3bb){logger[_0x9d49('0x16')](_0x9d49('0x24'),_0x26a3bb[_0x9d49('0x17')],_0x4c8960);_0x4c45e0(_0x5ce2d5[_0x9d49('0x16')](0x1f4,_0x26a3bb[_0x9d49('0x17')]));});});};exports[_0x9d49('0x25')]=function(_0x47c0d7){var _0x1e1ec1=this;return new Promise(function(_0x519fa5,_0x32dd6c){return db['SmsQueue'][_0x9d49('0x26')]({'raw':_0x47c0d7[_0x9d49('0x1b')]?_0x47c0d7[_0x9d49('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x47c0d7['options']?_0x47c0d7['options']['where']||null:null,'attributes':_0x47c0d7[_0x9d49('0x1b')]?_0x47c0d7['options'][_0x9d49('0x21')]||null:null,'include':_0x47c0d7[_0x9d49('0x1b')]?_0x47c0d7[_0x9d49('0x1b')]['include']?_['map'](_0x47c0d7[_0x9d49('0x1b')]['include'],function(_0x57f97a){return{'model':db[_0x57f97a[_0x9d49('0x20')]],'as':_0x57f97a['as'],'attributes':_0x57f97a[_0x9d49('0x21')],'include':_0x57f97a[_0x9d49('0x1f')]?_['map'](_0x57f97a[_0x9d49('0x1f')],function(_0x22e43e){return{'model':db[_0x22e43e[_0x9d49('0x20')]],'as':_0x22e43e['as'],'attributes':_0x22e43e['attributes'],'include':_0x22e43e[_0x9d49('0x1f')]?_[_0x9d49('0x27')](_0x22e43e[_0x9d49('0x1f')],function(_0x74cfd5){return{'model':db[_0x74cfd5[_0x9d49('0x20')]],'as':_0x74cfd5['as'],'attributes':_0x74cfd5[_0x9d49('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x972e74){logger[_0x9d49('0x11')](_0x9d49('0x25'),_0x47c0d7);logger[_0x9d49('0x23')]('ShowSmsQueue',_0x47c0d7,JSON[_0x9d49('0x15')](_0x972e74));_0x519fa5(_0x972e74);})['catch'](function(_0x2ad328){logger['error'](_0x9d49('0x25'),_0x2ad328['message'],_0x47c0d7);_0x32dd6c(_0x1e1ec1[_0x9d49('0x16')](0x1f4,_0x2ad328[_0x9d49('0x17')]));});});};
\ No newline at end of file