Built motion from commit f16df95f.|2.5.40
[motion2.git] / server / api / faxQueue / faxQueue.rpc.js
index c3cb505..858d2ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc95f=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxQueue.socket','register','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','catch','GetFaxQueue','FaxQueue','options','raw','where','limit','include','model','attributes','map','ShowFaxQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x437db4,_0x711b41){var _0x25bc71=function(_0x5ac27f){while(--_0x5ac27f){_0x437db4['push'](_0x437db4['shift']());}};_0x25bc71(++_0x711b41);}(_0xc95f,0x99));var _0xfc95=function(_0x38c0b2,_0x6a67a5){_0x38c0b2=_0x38c0b2-0x0;var _0x283c00=_0xc95f[_0x38c0b2];return _0x283c00;};'use strict';var _=require('lodash');var util=require(_0xfc95('0x0'));var moment=require('moment');var BPromise=require(_0xfc95('0x1'));var rs=require(_0xfc95('0x2'));var fs=require('fs');var Redis=require(_0xfc95('0x3'));var db=require(_0xfc95('0x4'))['db'];var utils=require(_0xfc95('0x5'));var logger=require(_0xfc95('0x6'))(_0xfc95('0x7'));var config=require(_0xfc95('0x8'));var jayson=require(_0xfc95('0x9'));var client=jayson[_0xfc95('0xa')][_0xfc95('0xb')]({'port':0x232a});config[_0xfc95('0xc')]=_[_0xfc95('0xd')](config[_0xfc95('0xc')],{'host':_0xfc95('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfc95('0xf'))[_0xfc95('0x10')](socket);function respondWithRpcPromise(_0x20c05c,_0x2ed5b5,_0x41922b){return new BPromise(function(_0x2e1483,_0x58853a){return client['request'](_0x20c05c,_0x41922b)[_0xfc95('0x11')](function(_0x2b4fbd){logger[_0xfc95('0x12')]('FaxQueue,\x20%s,\x20%s',_0x2ed5b5,_0xfc95('0x13'));logger[_0xfc95('0x14')](_0xfc95('0x15'),_0x2ed5b5,_0xfc95('0x13'),JSON[_0xfc95('0x16')](_0x2b4fbd));if(_0x2b4fbd[_0xfc95('0x17')]){if(_0x2b4fbd['error'][_0xfc95('0x18')]===0x1f4){logger[_0xfc95('0x17')](_0xfc95('0x19'),_0x2ed5b5,_0x2b4fbd[_0xfc95('0x17')][_0xfc95('0x1a')]);return _0x58853a(_0x2b4fbd['error'][_0xfc95('0x1a')]);}logger['error'](_0xfc95('0x19'),_0x2ed5b5,_0x2b4fbd[_0xfc95('0x17')][_0xfc95('0x1a')]);return _0x2e1483(_0x2b4fbd[_0xfc95('0x17')][_0xfc95('0x1a')]);}else{logger[_0xfc95('0x12')](_0xfc95('0x19'),_0x2ed5b5,_0xfc95('0x13'));_0x2e1483(_0x2b4fbd['result'][_0xfc95('0x1a')]);}})[_0xfc95('0x1b')](function(_0x534562){logger[_0xfc95('0x17')]('FaxQueue,\x20%s,\x20%s',_0x2ed5b5,_0x534562);_0x58853a(_0x534562);});});}exports[_0xfc95('0x1c')]=function(_0x2c0747){var _0x122e49=this;return new Promise(function(_0x11f8b0,_0x179f2d){return db[_0xfc95('0x1d')]['findAll']({'raw':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x1f')]===undefined?!![]:![]:!![],'where':_0x2c0747['options']?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x20')]||null:null,'attributes':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747['options']['attributes']||null:null,'limit':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x21')]||null:null,'include':_0x2c0747[_0xfc95('0x1e')]?_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x22')]?_['map'](_0x2c0747[_0xfc95('0x1e')][_0xfc95('0x22')],function(_0x339d72){return{'model':db[_0x339d72[_0xfc95('0x23')]],'as':_0x339d72['as'],'attributes':_0x339d72[_0xfc95('0x24')],'include':_0x339d72[_0xfc95('0x22')]?_[_0xfc95('0x25')](_0x339d72[_0xfc95('0x22')],function(_0x3577dd){return{'model':db[_0x3577dd[_0xfc95('0x23')]],'as':_0x3577dd['as'],'attributes':_0x3577dd[_0xfc95('0x24')],'include':_0x3577dd['include']?_[_0xfc95('0x25')](_0x3577dd[_0xfc95('0x22')],function(_0x11695a){return{'model':db[_0x11695a[_0xfc95('0x23')]],'as':_0x11695a['as'],'attributes':_0x11695a[_0xfc95('0x24')]};}):[]};}):[]};}):[]:[]})[_0xfc95('0x11')](function(_0x6e8167){logger[_0xfc95('0x12')](_0xfc95('0x1c'),_0x2c0747);logger['debug'](_0xfc95('0x1c'),_0x2c0747,JSON[_0xfc95('0x16')](_0x6e8167));_0x11f8b0(_0x6e8167);})['catch'](function(_0x492c2c){logger[_0xfc95('0x17')]('GetFaxQueue',_0x492c2c[_0xfc95('0x1a')],_0x2c0747);_0x179f2d(_0x122e49[_0xfc95('0x17')](0x1f4,_0x492c2c[_0xfc95('0x1a')]));});});};exports[_0xfc95('0x26')]=function(_0x269767){var _0x1a641f=this;return new Promise(function(_0x580c63,_0x2da23f){return db[_0xfc95('0x1d')][_0xfc95('0x27')]({'raw':_0x269767[_0xfc95('0x1e')]?_0x269767[_0xfc95('0x1e')][_0xfc95('0x1f')]===undefined?!![]:![]:!![],'where':_0x269767[_0xfc95('0x1e')]?_0x269767['options'][_0xfc95('0x20')]||null:null,'attributes':_0x269767[_0xfc95('0x1e')]?_0x269767[_0xfc95('0x1e')]['attributes']||null:null,'include':_0x269767[_0xfc95('0x1e')]?_0x269767[_0xfc95('0x1e')][_0xfc95('0x22')]?_[_0xfc95('0x25')](_0x269767['options'][_0xfc95('0x22')],function(_0x42cb95){return{'model':db[_0x42cb95[_0xfc95('0x23')]],'as':_0x42cb95['as'],'attributes':_0x42cb95[_0xfc95('0x24')],'include':_0x42cb95['include']?_[_0xfc95('0x25')](_0x42cb95['include'],function(_0x22980c){return{'model':db[_0x22980c[_0xfc95('0x23')]],'as':_0x22980c['as'],'attributes':_0x22980c[_0xfc95('0x24')],'include':_0x22980c[_0xfc95('0x22')]?_[_0xfc95('0x25')](_0x22980c[_0xfc95('0x22')],function(_0x2d7115){return{'model':db[_0x2d7115['model']],'as':_0x2d7115['as'],'attributes':_0x2d7115[_0xfc95('0x24')]};}):[]};}):[]};}):[]:[]})[_0xfc95('0x11')](function(_0x1cab50){logger[_0xfc95('0x12')]('ShowFaxQueue',_0x269767);logger[_0xfc95('0x14')]('ShowFaxQueue',_0x269767,JSON[_0xfc95('0x16')](_0x1cab50));_0x580c63(_0x1cab50);})[_0xfc95('0x1b')](function(_0x40f864){logger['error'](_0xfc95('0x26'),_0x40f864[_0xfc95('0x1a')],_0x269767);_0x2da23f(_0x1a641f['error'](0x1f4,_0x40f864['message']));});});};
\ No newline at end of file
+var _0x0270=['defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','include','map','model','stringify','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x1542d9,_0x5451e7){var _0x5e1c07=function(_0x25804c){while(--_0x25804c){_0x1542d9['push'](_0x1542d9['shift']());}};_0x5e1c07(++_0x5451e7);}(_0x0270,0xa2));var _0x0027=function(_0x334539,_0x4c163b){_0x334539=_0x334539-0x0;var _0x4f23a7=_0x0270[_0x334539];return _0x4f23a7;};'use strict';var _=require(_0x0027('0x0'));var util=require(_0x0027('0x1'));var moment=require(_0x0027('0x2'));var BPromise=require(_0x0027('0x3'));var rs=require(_0x0027('0x4'));var fs=require('fs');var Redis=require(_0x0027('0x5'));var db=require(_0x0027('0x6'))['db'];var utils=require(_0x0027('0x7'));var logger=require(_0x0027('0x8'))(_0x0027('0x9'));var config=require(_0x0027('0xa'));var jayson=require(_0x0027('0xb'));var client=jayson['client'][_0x0027('0xc')]({'port':0x232a});config[_0x0027('0xd')]=_[_0x0027('0xe')](config['redis'],{'host':_0x0027('0xf'),'port':0x18eb});var socket=require(_0x0027('0x10'))(new Redis(config[_0x0027('0xd')]));require(_0x0027('0x11'))[_0x0027('0x12')](socket);function respondWithRpcPromise(_0x2ba61a,_0x1cff5a,_0x297cbe){return new BPromise(function(_0x27a26a,_0x2b621f){return client[_0x0027('0x13')](_0x2ba61a,_0x297cbe)[_0x0027('0x14')](function(_0x2050af){logger[_0x0027('0x15')](_0x0027('0x16'),_0x1cff5a,_0x0027('0x17'));logger[_0x0027('0x18')](_0x0027('0x19'),_0x1cff5a,'request\x20sent',JSON['stringify'](_0x2050af));if(_0x2050af[_0x0027('0x1a')]){if(_0x2050af[_0x0027('0x1a')][_0x0027('0x1b')]===0x1f4){logger[_0x0027('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x1cff5a,_0x2050af['error']['message']);return _0x2b621f(_0x2050af[_0x0027('0x1a')]['message']);}logger[_0x0027('0x1a')](_0x0027('0x16'),_0x1cff5a,_0x2050af[_0x0027('0x1a')][_0x0027('0x1c')]);return _0x27a26a(_0x2050af[_0x0027('0x1a')][_0x0027('0x1c')]);}else{logger[_0x0027('0x15')]('FaxQueue,\x20%s,\x20%s',_0x1cff5a,'request\x20sent');_0x27a26a(_0x2050af[_0x0027('0x1d')][_0x0027('0x1c')]);}})[_0x0027('0x1e')](function(_0x5e8cdf){logger[_0x0027('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x1cff5a,_0x5e8cdf);_0x2b621f(_0x5e8cdf);});});}exports[_0x0027('0x1f')]=function(_0x3a44c4){var _0x4832da=this;return new Promise(function(_0x551946,_0x3f4c08){return db[_0x0027('0x20')][_0x0027('0x21')]({'raw':_0x3a44c4[_0x0027('0x22')]?_0x3a44c4[_0x0027('0x22')][_0x0027('0x23')]===undefined?!![]:![]:!![],'where':_0x3a44c4[_0x0027('0x22')]?_0x3a44c4[_0x0027('0x22')][_0x0027('0x24')]||null:null,'attributes':_0x3a44c4[_0x0027('0x22')]?_0x3a44c4[_0x0027('0x22')][_0x0027('0x25')]||null:null,'limit':_0x3a44c4['options']?_0x3a44c4[_0x0027('0x22')]['limit']||null:null,'include':_0x3a44c4[_0x0027('0x22')]?_0x3a44c4[_0x0027('0x22')][_0x0027('0x26')]?_[_0x0027('0x27')](_0x3a44c4[_0x0027('0x22')][_0x0027('0x26')],function(_0x33b94f){return{'model':db[_0x33b94f['model']],'as':_0x33b94f['as'],'attributes':_0x33b94f[_0x0027('0x25')],'include':_0x33b94f[_0x0027('0x26')]?_[_0x0027('0x27')](_0x33b94f[_0x0027('0x26')],function(_0x235e51){return{'model':db[_0x235e51[_0x0027('0x28')]],'as':_0x235e51['as'],'attributes':_0x235e51[_0x0027('0x25')],'include':_0x235e51[_0x0027('0x26')]?_['map'](_0x235e51[_0x0027('0x26')],function(_0x52f321){return{'model':db[_0x52f321[_0x0027('0x28')]],'as':_0x52f321['as'],'attributes':_0x52f321[_0x0027('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0027('0x14')](function(_0x407a70){logger[_0x0027('0x15')](_0x0027('0x1f'),_0x3a44c4);logger[_0x0027('0x18')]('GetFaxQueue',_0x3a44c4,JSON[_0x0027('0x29')](_0x407a70));_0x551946(_0x407a70);})[_0x0027('0x1e')](function(_0x42d987){logger[_0x0027('0x1a')](_0x0027('0x1f'),_0x42d987[_0x0027('0x1c')],_0x3a44c4);_0x3f4c08(_0x4832da[_0x0027('0x1a')](0x1f4,_0x42d987[_0x0027('0x1c')]));});});};exports[_0x0027('0x2a')]=function(_0x4d0dcc){var _0x1eac73=this;return new Promise(function(_0x41c99d,_0x583094){return db['FaxQueue'][_0x0027('0x2b')]({'raw':_0x4d0dcc['options']?_0x4d0dcc[_0x0027('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x4d0dcc['options']?_0x4d0dcc[_0x0027('0x22')]['where']||null:null,'attributes':_0x4d0dcc[_0x0027('0x22')]?_0x4d0dcc[_0x0027('0x22')][_0x0027('0x25')]||null:null,'include':_0x4d0dcc[_0x0027('0x22')]?_0x4d0dcc[_0x0027('0x22')][_0x0027('0x26')]?_[_0x0027('0x27')](_0x4d0dcc['options'][_0x0027('0x26')],function(_0x271297){return{'model':db[_0x271297[_0x0027('0x28')]],'as':_0x271297['as'],'attributes':_0x271297[_0x0027('0x25')],'include':_0x271297[_0x0027('0x26')]?_[_0x0027('0x27')](_0x271297[_0x0027('0x26')],function(_0x23788b){return{'model':db[_0x23788b['model']],'as':_0x23788b['as'],'attributes':_0x23788b['attributes'],'include':_0x23788b[_0x0027('0x26')]?_['map'](_0x23788b[_0x0027('0x26')],function(_0x1b313e){return{'model':db[_0x1b313e[_0x0027('0x28')]],'as':_0x1b313e['as'],'attributes':_0x1b313e[_0x0027('0x25')]};}):[]};}):[]};}):[]:[]})[_0x0027('0x14')](function(_0x33ba7f){logger[_0x0027('0x15')](_0x0027('0x2a'),_0x4d0dcc);logger[_0x0027('0x18')](_0x0027('0x2a'),_0x4d0dcc,JSON['stringify'](_0x33ba7f));_0x41c99d(_0x33ba7f);})['catch'](function(_0x2d5a92){logger[_0x0027('0x1a')](_0x0027('0x2a'),_0x2d5a92[_0x0027('0x1c')],_0x4d0dcc);_0x583094(_0x1eac73[_0x0027('0x1a')](0x1f4,_0x2d5a92[_0x0027('0x1c')]));});});};
\ No newline at end of file