Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / faxQueue / faxQueue.rpc.js
index f88c277..c3fd68d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe45=['register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','where','attributes','map','include','model','debug','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./faxQueue.socket'];(function(_0x11b2ca,_0x5257ab){var _0x4fbdb9=function(_0x21b3e0){while(--_0x21b3e0){_0x11b2ca['push'](_0x11b2ca['shift']());}};_0x4fbdb9(++_0x5257ab);}(_0xfe45,0x151));var _0x5fe4=function(_0x4ac9de,_0x3df484){_0x4ac9de=_0x4ac9de-0x0;var _0x342a6e=_0xfe45[_0x4ac9de];return _0x342a6e;};'use strict';var _=require(_0x5fe4('0x0'));var util=require(_0x5fe4('0x1'));var moment=require(_0x5fe4('0x2'));var BPromise=require(_0x5fe4('0x3'));var rs=require(_0x5fe4('0x4'));var fs=require('fs');var Redis=require(_0x5fe4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5fe4('0x6'))(_0x5fe4('0x7'));var config=require(_0x5fe4('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5fe4('0x9')]({'port':0x232a});config[_0x5fe4('0xa')]=_[_0x5fe4('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5fe4('0xc'))(new Redis(config[_0x5fe4('0xa')]));require(_0x5fe4('0xd'))[_0x5fe4('0xe')](socket);function respondWithRpcPromise(_0x1c94a1,_0x4687f4,_0x53f881){return new BPromise(function(_0x5bd7da,_0x11a746){return client[_0x5fe4('0xf')](_0x1c94a1,_0x53f881)[_0x5fe4('0x10')](function(_0x30e5c6){logger[_0x5fe4('0x11')](_0x5fe4('0x12'),_0x4687f4,_0x5fe4('0x13'));logger['debug'](_0x5fe4('0x14'),_0x4687f4,'request\x20sent',JSON[_0x5fe4('0x15')](_0x30e5c6));if(_0x30e5c6[_0x5fe4('0x16')]){if(_0x30e5c6[_0x5fe4('0x16')][_0x5fe4('0x17')]===0x1f4){logger['error'](_0x5fe4('0x12'),_0x4687f4,_0x30e5c6['error']['message']);return _0x11a746(_0x30e5c6['error']['message']);}logger[_0x5fe4('0x16')]('FaxQueue,\x20%s,\x20%s',_0x4687f4,_0x30e5c6[_0x5fe4('0x16')][_0x5fe4('0x18')]);return _0x5bd7da(_0x30e5c6[_0x5fe4('0x16')][_0x5fe4('0x18')]);}else{logger[_0x5fe4('0x11')](_0x5fe4('0x12'),_0x4687f4,_0x5fe4('0x13'));_0x5bd7da(_0x30e5c6[_0x5fe4('0x19')]['message']);}})[_0x5fe4('0x1a')](function(_0x32b7a7){logger['error'](_0x5fe4('0x12'),_0x4687f4,_0x32b7a7);_0x11a746(_0x32b7a7);});});}exports[_0x5fe4('0x1b')]=function(_0x353d9f){var _0x4f1b8d=this;return new Promise(function(_0x2ef8d9,_0x9db6e5){return db[_0x5fe4('0x1c')]['findAll']({'raw':_0x353d9f[_0x5fe4('0x1d')]?_0x353d9f[_0x5fe4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x353d9f[_0x5fe4('0x1d')]?_0x353d9f['options'][_0x5fe4('0x1e')]||null:null,'attributes':_0x353d9f['options']?_0x353d9f[_0x5fe4('0x1d')][_0x5fe4('0x1f')]||null:null,'limit':_0x353d9f['options']?_0x353d9f[_0x5fe4('0x1d')]['limit']||null:null,'include':_0x353d9f[_0x5fe4('0x1d')]?_0x353d9f[_0x5fe4('0x1d')]['include']?_[_0x5fe4('0x20')](_0x353d9f[_0x5fe4('0x1d')][_0x5fe4('0x21')],function(_0x2c5b72){return{'model':db[_0x2c5b72['model']],'as':_0x2c5b72['as'],'attributes':_0x2c5b72[_0x5fe4('0x1f')],'include':_0x2c5b72[_0x5fe4('0x21')]?_[_0x5fe4('0x20')](_0x2c5b72[_0x5fe4('0x21')],function(_0x2281a1){return{'model':db[_0x2281a1[_0x5fe4('0x22')]],'as':_0x2281a1['as'],'attributes':_0x2281a1[_0x5fe4('0x1f')],'include':_0x2281a1[_0x5fe4('0x21')]?_['map'](_0x2281a1[_0x5fe4('0x21')],function(_0x1eab9b){return{'model':db[_0x1eab9b['model']],'as':_0x1eab9b['as'],'attributes':_0x1eab9b[_0x5fe4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5fe4('0x10')](function(_0x4b8feb){logger['info'](_0x5fe4('0x1b'),_0x353d9f);logger[_0x5fe4('0x23')](_0x5fe4('0x1b'),_0x353d9f,JSON[_0x5fe4('0x15')](_0x4b8feb));_0x2ef8d9(_0x4b8feb);})[_0x5fe4('0x1a')](function(_0x1fb912){logger[_0x5fe4('0x16')](_0x5fe4('0x1b'),_0x1fb912['message'],_0x353d9f);_0x9db6e5(_0x4f1b8d[_0x5fe4('0x16')](0x1f4,_0x1fb912[_0x5fe4('0x18')]));});});};exports[_0x5fe4('0x24')]=function(_0x1fcdb3){var _0x1311a3=this;return new Promise(function(_0x1cd3c8,_0x4ea77f){return db['FaxQueue'][_0x5fe4('0x25')]({'raw':_0x1fcdb3[_0x5fe4('0x1d')]?_0x1fcdb3[_0x5fe4('0x1d')][_0x5fe4('0x26')]===undefined?!![]:![]:!![],'where':_0x1fcdb3['options']?_0x1fcdb3[_0x5fe4('0x1d')][_0x5fe4('0x1e')]||null:null,'attributes':_0x1fcdb3['options']?_0x1fcdb3[_0x5fe4('0x1d')]['attributes']||null:null,'include':_0x1fcdb3['options']?_0x1fcdb3['options']['include']?_[_0x5fe4('0x20')](_0x1fcdb3[_0x5fe4('0x1d')][_0x5fe4('0x21')],function(_0x59b2a1){return{'model':db[_0x59b2a1[_0x5fe4('0x22')]],'as':_0x59b2a1['as'],'attributes':_0x59b2a1[_0x5fe4('0x1f')],'include':_0x59b2a1[_0x5fe4('0x21')]?_[_0x5fe4('0x20')](_0x59b2a1[_0x5fe4('0x21')],function(_0x585907){return{'model':db[_0x585907[_0x5fe4('0x22')]],'as':_0x585907['as'],'attributes':_0x585907[_0x5fe4('0x1f')],'include':_0x585907[_0x5fe4('0x21')]?_[_0x5fe4('0x20')](_0x585907[_0x5fe4('0x21')],function(_0x4ac93e){return{'model':db[_0x4ac93e['model']],'as':_0x4ac93e['as'],'attributes':_0x4ac93e[_0x5fe4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5fe4('0x10')](function(_0x34668f){logger[_0x5fe4('0x11')](_0x5fe4('0x24'),_0x1fcdb3);logger[_0x5fe4('0x23')]('ShowFaxQueue',_0x1fcdb3,JSON['stringify'](_0x34668f));_0x1cd3c8(_0x34668f);})[_0x5fe4('0x1a')](function(_0x2a4cb1){logger[_0x5fe4('0x16')](_0x5fe4('0x24'),_0x2a4cb1[_0x5fe4('0x18')],_0x1fcdb3);_0x4ea77f(_0x1311a3['error'](0x1f4,_0x2a4cb1[_0x5fe4('0x18')]));});});};
\ No newline at end of file
+var _0xf833=['http','redis','defaults','localhost','./faxQueue.socket','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxQueue,\x20%s,\x20%s','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','include','map','model','ShowFaxQueue','find','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x38af12,_0x81905e){var _0x37d48e=function(_0x2a25c8){while(--_0x2a25c8){_0x38af12['push'](_0x38af12['shift']());}};_0x37d48e(++_0x81905e);}(_0xf833,0x1b4));var _0x3f83=function(_0x253454,_0x262b56){_0x253454=_0x253454-0x0;var _0x1aff02=_0xf833[_0x253454];return _0x1aff02;};'use strict';var _=require('lodash');var util=require(_0x3f83('0x0'));var moment=require('moment');var BPromise=require(_0x3f83('0x1'));var rs=require(_0x3f83('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f83('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3f83('0x4'));var config=require(_0x3f83('0x5'));var jayson=require(_0x3f83('0x6'));var client=jayson[_0x3f83('0x7')][_0x3f83('0x8')]({'port':0x232a});config[_0x3f83('0x9')]=_[_0x3f83('0xa')](config[_0x3f83('0x9')],{'host':_0x3f83('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3f83('0xc'))[_0x3f83('0xd')](socket);function respondWithRpcPromise(_0x3a811e,_0x1f5c2d,_0x5d1df9){return new BPromise(function(_0x40cf02,_0x4e381a){return client[_0x3f83('0xe')](_0x3a811e,_0x5d1df9)[_0x3f83('0xf')](function(_0x215773){logger[_0x3f83('0x10')]('FaxQueue,\x20%s,\x20%s',_0x1f5c2d,_0x3f83('0x11'));logger[_0x3f83('0x12')](_0x3f83('0x13'),_0x1f5c2d,_0x3f83('0x11'),JSON[_0x3f83('0x14')](_0x215773));if(_0x215773[_0x3f83('0x15')]){if(_0x215773[_0x3f83('0x15')]['code']===0x1f4){logger[_0x3f83('0x15')]('FaxQueue,\x20%s,\x20%s',_0x1f5c2d,_0x215773[_0x3f83('0x15')][_0x3f83('0x16')]);return _0x4e381a(_0x215773[_0x3f83('0x15')][_0x3f83('0x16')]);}logger[_0x3f83('0x15')]('FaxQueue,\x20%s,\x20%s',_0x1f5c2d,_0x215773[_0x3f83('0x15')]['message']);return _0x40cf02(_0x215773[_0x3f83('0x15')]['message']);}else{logger['info'](_0x3f83('0x17'),_0x1f5c2d,_0x3f83('0x11'));_0x40cf02(_0x215773[_0x3f83('0x18')][_0x3f83('0x16')]);}})[_0x3f83('0x19')](function(_0x2b2649){logger[_0x3f83('0x15')](_0x3f83('0x17'),_0x1f5c2d,_0x2b2649);_0x4e381a(_0x2b2649);});});}exports[_0x3f83('0x1a')]=function(_0x10701c){var _0x14bdb9=this;return new Promise(function(_0x3a13c5,_0x2063e0){return db[_0x3f83('0x1b')]['findAll']({'raw':_0x10701c['options']?_0x10701c[_0x3f83('0x1c')][_0x3f83('0x1d')]===undefined?!![]:![]:!![],'where':_0x10701c[_0x3f83('0x1c')]?_0x10701c[_0x3f83('0x1c')][_0x3f83('0x1e')]||null:null,'attributes':_0x10701c[_0x3f83('0x1c')]?_0x10701c['options'][_0x3f83('0x1f')]||null:null,'limit':_0x10701c['options']?_0x10701c[_0x3f83('0x1c')]['limit']||null:null,'include':_0x10701c[_0x3f83('0x1c')]?_0x10701c[_0x3f83('0x1c')][_0x3f83('0x20')]?_[_0x3f83('0x21')](_0x10701c[_0x3f83('0x1c')][_0x3f83('0x20')],function(_0x305d45){return{'model':db[_0x305d45[_0x3f83('0x22')]],'as':_0x305d45['as'],'attributes':_0x305d45['attributes'],'include':_0x305d45['include']?_[_0x3f83('0x21')](_0x305d45[_0x3f83('0x20')],function(_0x115b5b){return{'model':db[_0x115b5b[_0x3f83('0x22')]],'as':_0x115b5b['as'],'attributes':_0x115b5b[_0x3f83('0x1f')],'include':_0x115b5b[_0x3f83('0x20')]?_[_0x3f83('0x21')](_0x115b5b[_0x3f83('0x20')],function(_0x40dcc4){return{'model':db[_0x40dcc4[_0x3f83('0x22')]],'as':_0x40dcc4['as'],'attributes':_0x40dcc4[_0x3f83('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3f83('0xf')](function(_0x1fa63f){logger['info'](_0x3f83('0x1a'),_0x10701c);logger['debug'](_0x3f83('0x1a'),_0x10701c,JSON['stringify'](_0x1fa63f));_0x3a13c5(_0x1fa63f);})[_0x3f83('0x19')](function(_0x335066){logger[_0x3f83('0x15')](_0x3f83('0x1a'),_0x335066[_0x3f83('0x16')],_0x10701c);_0x2063e0(_0x14bdb9[_0x3f83('0x15')](0x1f4,_0x335066[_0x3f83('0x16')]));});});};exports[_0x3f83('0x23')]=function(_0xb3b6be){var _0x2feb03=this;return new Promise(function(_0x5483d7,_0x515c77){return db[_0x3f83('0x1b')][_0x3f83('0x24')]({'raw':_0xb3b6be['options']?_0xb3b6be[_0x3f83('0x1c')][_0x3f83('0x1d')]===undefined?!![]:![]:!![],'where':_0xb3b6be[_0x3f83('0x1c')]?_0xb3b6be[_0x3f83('0x1c')]['where']||null:null,'attributes':_0xb3b6be[_0x3f83('0x1c')]?_0xb3b6be[_0x3f83('0x1c')][_0x3f83('0x1f')]||null:null,'include':_0xb3b6be['options']?_0xb3b6be[_0x3f83('0x1c')][_0x3f83('0x20')]?_[_0x3f83('0x21')](_0xb3b6be['options']['include'],function(_0x526827){return{'model':db[_0x526827[_0x3f83('0x22')]],'as':_0x526827['as'],'attributes':_0x526827[_0x3f83('0x1f')],'include':_0x526827[_0x3f83('0x20')]?_[_0x3f83('0x21')](_0x526827[_0x3f83('0x20')],function(_0x215343){return{'model':db[_0x215343[_0x3f83('0x22')]],'as':_0x215343['as'],'attributes':_0x215343[_0x3f83('0x1f')],'include':_0x215343[_0x3f83('0x20')]?_[_0x3f83('0x21')](_0x215343[_0x3f83('0x20')],function(_0x19175c){return{'model':db[_0x19175c[_0x3f83('0x22')]],'as':_0x19175c['as'],'attributes':_0x19175c['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f83('0xf')](function(_0xd1545a){logger['info']('ShowFaxQueue',_0xb3b6be);logger[_0x3f83('0x12')](_0x3f83('0x23'),_0xb3b6be,JSON[_0x3f83('0x14')](_0xd1545a));_0x5483d7(_0xd1545a);})[_0x3f83('0x19')](function(_0x511258){logger[_0x3f83('0x15')](_0x3f83('0x23'),_0x511258[_0x3f83('0x16')],_0xb3b6be);_0x515c77(_0x2feb03['error'](0x1f4,_0x511258[_0x3f83('0x16')]));});});};
\ No newline at end of file