Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / api / faxQueue / faxQueue.rpc.js
index 7910210..ba17363 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31ec=['redis','localhost','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','map','include','model','debug','find','where','then','stringify','ShowFaxQueue','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x196dc5,_0x50be9d){var _0x56458e=function(_0x5bd98b){while(--_0x5bd98b){_0x196dc5['push'](_0x196dc5['shift']());}};_0x56458e(++_0x50be9d);}(_0x31ec,0x199));var _0xc31e=function(_0x2b2318,_0x4bec7e){_0x2b2318=_0x2b2318-0x0;var _0x5da5d3=_0x31ec[_0x2b2318];return _0x5da5d3;};'use strict';var _=require('lodash');var util=require(_0xc31e('0x0'));var moment=require(_0xc31e('0x1'));var BPromise=require(_0xc31e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc31e('0x3'))['db'];var utils=require(_0xc31e('0x4'));var logger=require(_0xc31e('0x5'))(_0xc31e('0x6'));var config=require('../../config/environment');var jayson=require(_0xc31e('0x7'));var client=jayson[_0xc31e('0x8')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc31e('0x9')],{'host':_0xc31e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc31e('0x9')]));require(_0xc31e('0xb'))['register'](socket);function respondWithRpcPromise(_0xc0c89f,_0x1231f9,_0x40cdb0){return new BPromise(function(_0x5d48dc,_0x352e90){return client[_0xc31e('0xc')](_0xc0c89f,_0x40cdb0)['then'](function(_0x3212c7){logger[_0xc31e('0xd')](_0xc31e('0xe'),_0x1231f9,'request\x20sent');logger['debug'](_0xc31e('0xf'),_0x1231f9,_0xc31e('0x10'),JSON['stringify'](_0x3212c7));if(_0x3212c7[_0xc31e('0x11')]){if(_0x3212c7['error'][_0xc31e('0x12')]===0x1f4){logger[_0xc31e('0x11')](_0xc31e('0xe'),_0x1231f9,_0x3212c7[_0xc31e('0x11')][_0xc31e('0x13')]);return _0x352e90(_0x3212c7[_0xc31e('0x11')]['message']);}logger[_0xc31e('0x11')](_0xc31e('0xe'),_0x1231f9,_0x3212c7[_0xc31e('0x11')][_0xc31e('0x13')]);return _0x5d48dc(_0x3212c7[_0xc31e('0x11')][_0xc31e('0x13')]);}else{logger[_0xc31e('0xd')](_0xc31e('0xe'),_0x1231f9,'request\x20sent');_0x5d48dc(_0x3212c7[_0xc31e('0x14')]['message']);}})[_0xc31e('0x15')](function(_0x283a26){logger[_0xc31e('0x11')]('FaxQueue,\x20%s,\x20%s',_0x1231f9,_0x283a26);_0x352e90(_0x283a26);});});}exports[_0xc31e('0x16')]=function(_0x33c952){var _0x40780e=this;return new Promise(function(_0x2e50ec,_0x5dfef3){return db[_0xc31e('0x17')][_0xc31e('0x18')]({'raw':_0x33c952[_0xc31e('0x19')]?_0x33c952['options'][_0xc31e('0x1a')]===undefined?!![]:![]:!![],'where':_0x33c952[_0xc31e('0x19')]?_0x33c952[_0xc31e('0x19')]['where']||null:null,'attributes':_0x33c952['options']?_0x33c952[_0xc31e('0x19')][_0xc31e('0x1b')]||null:null,'limit':_0x33c952['options']?_0x33c952['options'][_0xc31e('0x1c')]||null:null,'include':_0x33c952[_0xc31e('0x19')]?_0x33c952['options']['include']?_[_0xc31e('0x1d')](_0x33c952[_0xc31e('0x19')][_0xc31e('0x1e')],function(_0x1fa372){return{'model':db[_0x1fa372[_0xc31e('0x1f')]],'as':_0x1fa372['as'],'attributes':_0x1fa372['attributes'],'include':_0x1fa372[_0xc31e('0x1e')]?_[_0xc31e('0x1d')](_0x1fa372[_0xc31e('0x1e')],function(_0x37bc75){return{'model':db[_0x37bc75[_0xc31e('0x1f')]],'as':_0x37bc75['as'],'attributes':_0x37bc75[_0xc31e('0x1b')],'include':_0x37bc75[_0xc31e('0x1e')]?_[_0xc31e('0x1d')](_0x37bc75[_0xc31e('0x1e')],function(_0x43dcf7){return{'model':db[_0x43dcf7[_0xc31e('0x1f')]],'as':_0x43dcf7['as'],'attributes':_0x43dcf7[_0xc31e('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x284750){logger['info']('GetFaxQueue',_0x33c952);logger[_0xc31e('0x20')](_0xc31e('0x16'),_0x33c952,JSON['stringify'](_0x284750));_0x2e50ec(_0x284750);})[_0xc31e('0x15')](function(_0x596fbf){logger[_0xc31e('0x11')](_0xc31e('0x16'),_0x596fbf[_0xc31e('0x13')],_0x33c952);_0x5dfef3(_0x40780e[_0xc31e('0x11')](0x1f4,_0x596fbf['message']));});});};exports['ShowFaxQueue']=function(_0x568fd4){var _0x2bb9b1=this;return new Promise(function(_0x498a78,_0x162765){return db['FaxQueue'][_0xc31e('0x21')]({'raw':_0x568fd4[_0xc31e('0x19')]?_0x568fd4[_0xc31e('0x19')][_0xc31e('0x1a')]===undefined?!![]:![]:!![],'where':_0x568fd4['options']?_0x568fd4['options'][_0xc31e('0x22')]||null:null,'attributes':_0x568fd4[_0xc31e('0x19')]?_0x568fd4['options'][_0xc31e('0x1b')]||null:null,'include':_0x568fd4[_0xc31e('0x19')]?_0x568fd4[_0xc31e('0x19')][_0xc31e('0x1e')]?_[_0xc31e('0x1d')](_0x568fd4[_0xc31e('0x19')][_0xc31e('0x1e')],function(_0x4b183e){return{'model':db[_0x4b183e[_0xc31e('0x1f')]],'as':_0x4b183e['as'],'attributes':_0x4b183e[_0xc31e('0x1b')],'include':_0x4b183e[_0xc31e('0x1e')]?_[_0xc31e('0x1d')](_0x4b183e[_0xc31e('0x1e')],function(_0x46fa3b){return{'model':db[_0x46fa3b[_0xc31e('0x1f')]],'as':_0x46fa3b['as'],'attributes':_0x46fa3b[_0xc31e('0x1b')],'include':_0x46fa3b['include']?_[_0xc31e('0x1d')](_0x46fa3b[_0xc31e('0x1e')],function(_0x5c6099){return{'model':db[_0x5c6099[_0xc31e('0x1f')]],'as':_0x5c6099['as'],'attributes':_0x5c6099['attributes']};}):[]};}):[]};}):[]:[]})[_0xc31e('0x23')](function(_0x5f5579){logger[_0xc31e('0xd')]('ShowFaxQueue',_0x568fd4);logger['debug']('ShowFaxQueue',_0x568fd4,JSON[_0xc31e('0x24')](_0x5f5579));_0x498a78(_0x5f5579);})[_0xc31e('0x15')](function(_0xa48904){logger[_0xc31e('0x11')](_0xc31e('0x25'),_0xa48904['message'],_0x568fd4);_0x162765(_0x2bb9b1[_0xc31e('0x11')](0x1f4,_0xa48904[_0xc31e('0x13')]));});});};
\ No newline at end of file
+var _0x9a05=['./faxQueue.socket','register','request','then','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','map','include','model','debug','stringify','ShowFaxQueue','find','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9a05,0xbb));var _0x59a0=function(_0x3d47ae,_0x131b67){_0x3d47ae=_0x3d47ae-0x0;var _0x1c11bd=_0x9a05[_0x3d47ae];return _0x1c11bd;};'use strict';var _=require('lodash');var util=require(_0x59a0('0x0'));var moment=require(_0x59a0('0x1'));var BPromise=require(_0x59a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x59a0('0x3'));var db=require(_0x59a0('0x4'))['db'];var utils=require(_0x59a0('0x5'));var logger=require(_0x59a0('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x59a0('0x7')][_0x59a0('0x8')]({'port':0x232a});config[_0x59a0('0x9')]=_[_0x59a0('0xa')](config[_0x59a0('0x9')],{'host':_0x59a0('0xb'),'port':0x18eb});var socket=require(_0x59a0('0xc'))(new Redis(config['redis']));require(_0x59a0('0xd'))[_0x59a0('0xe')](socket);function respondWithRpcPromise(_0x478d1e,_0x6f37cb,_0x5d7639){return new BPromise(function(_0x22cd5b,_0x51bdc4){return client[_0x59a0('0xf')](_0x478d1e,_0x5d7639)[_0x59a0('0x10')](function(_0x2597a4){logger[_0x59a0('0x11')]('FaxQueue,\x20%s,\x20%s',_0x6f37cb,_0x59a0('0x12'));logger['debug'](_0x59a0('0x13'),_0x6f37cb,_0x59a0('0x12'),JSON['stringify'](_0x2597a4));if(_0x2597a4['error']){if(_0x2597a4[_0x59a0('0x14')]['code']===0x1f4){logger[_0x59a0('0x14')](_0x59a0('0x15'),_0x6f37cb,_0x2597a4['error'][_0x59a0('0x16')]);return _0x51bdc4(_0x2597a4['error'][_0x59a0('0x16')]);}logger[_0x59a0('0x14')](_0x59a0('0x15'),_0x6f37cb,_0x2597a4[_0x59a0('0x14')][_0x59a0('0x16')]);return _0x22cd5b(_0x2597a4[_0x59a0('0x14')][_0x59a0('0x16')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x6f37cb,_0x59a0('0x12'));_0x22cd5b(_0x2597a4[_0x59a0('0x17')][_0x59a0('0x16')]);}})[_0x59a0('0x18')](function(_0x5c0abc){logger[_0x59a0('0x14')](_0x59a0('0x15'),_0x6f37cb,_0x5c0abc);_0x51bdc4(_0x5c0abc);});});}exports[_0x59a0('0x19')]=function(_0x287612){var _0x5480f6=this;return new Promise(function(_0x1ddd06,_0xfb1b5c){return db[_0x59a0('0x1a')][_0x59a0('0x1b')]({'raw':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')][_0x59a0('0x1d')]||null:null,'attributes':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')][_0x59a0('0x1e')]||null:null,'limit':_0x287612[_0x59a0('0x1c')]?_0x287612['options'][_0x59a0('0x1f')]||null:null,'include':_0x287612[_0x59a0('0x1c')]?_0x287612[_0x59a0('0x1c')]['include']?_[_0x59a0('0x20')](_0x287612[_0x59a0('0x1c')][_0x59a0('0x21')],function(_0x464e85){return{'model':db[_0x464e85['model']],'as':_0x464e85['as'],'attributes':_0x464e85[_0x59a0('0x1e')],'include':_0x464e85[_0x59a0('0x21')]?_[_0x59a0('0x20')](_0x464e85[_0x59a0('0x21')],function(_0x3cdb14){return{'model':db[_0x3cdb14[_0x59a0('0x22')]],'as':_0x3cdb14['as'],'attributes':_0x3cdb14['attributes'],'include':_0x3cdb14[_0x59a0('0x21')]?_[_0x59a0('0x20')](_0x3cdb14['include'],function(_0xed8b1e){return{'model':db[_0xed8b1e['model']],'as':_0xed8b1e['as'],'attributes':_0xed8b1e[_0x59a0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af497){logger[_0x59a0('0x11')]('GetFaxQueue',_0x287612);logger[_0x59a0('0x23')](_0x59a0('0x19'),_0x287612,JSON[_0x59a0('0x24')](_0x4af497));_0x1ddd06(_0x4af497);})[_0x59a0('0x18')](function(_0x3eb376){logger[_0x59a0('0x14')](_0x59a0('0x19'),_0x3eb376['message'],_0x287612);_0xfb1b5c(_0x5480f6[_0x59a0('0x14')](0x1f4,_0x3eb376[_0x59a0('0x16')]));});});};exports[_0x59a0('0x25')]=function(_0x1c3dca){var _0xf9372a=this;return new Promise(function(_0xb3d131,_0x5cae31){return db[_0x59a0('0x1a')][_0x59a0('0x26')]({'raw':_0x1c3dca[_0x59a0('0x1c')]?_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x27')]===undefined?!![]:![]:!![],'where':_0x1c3dca['options']?_0x1c3dca[_0x59a0('0x1c')]['where']||null:null,'attributes':_0x1c3dca['options']?_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x1e')]||null:null,'include':_0x1c3dca[_0x59a0('0x1c')]?_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x21')]?_['map'](_0x1c3dca[_0x59a0('0x1c')][_0x59a0('0x21')],function(_0x1d89df){return{'model':db[_0x1d89df[_0x59a0('0x22')]],'as':_0x1d89df['as'],'attributes':_0x1d89df[_0x59a0('0x1e')],'include':_0x1d89df[_0x59a0('0x21')]?_[_0x59a0('0x20')](_0x1d89df[_0x59a0('0x21')],function(_0x4a917b){return{'model':db[_0x4a917b['model']],'as':_0x4a917b['as'],'attributes':_0x4a917b['attributes'],'include':_0x4a917b[_0x59a0('0x21')]?_['map'](_0x4a917b[_0x59a0('0x21')],function(_0x36e069){return{'model':db[_0x36e069[_0x59a0('0x22')]],'as':_0x36e069['as'],'attributes':_0x36e069[_0x59a0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x59a0('0x10')](function(_0x473d4c){logger[_0x59a0('0x11')](_0x59a0('0x25'),_0x1c3dca);logger[_0x59a0('0x23')](_0x59a0('0x25'),_0x1c3dca,JSON[_0x59a0('0x24')](_0x473d4c));_0xb3d131(_0x473d4c);})['catch'](function(_0x4fd4ea){logger['error'](_0x59a0('0x25'),_0x4fd4ea[_0x59a0('0x16')],_0x1c3dca);_0x5cae31(_0xf9372a[_0x59a0('0x14')](0x1f4,_0x4fd4ea['message']));});});};
\ No newline at end of file