Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / faxQueue / faxQueue.rpc.js
index 223544c..5345cb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x185a=['model','then','debug','ShowFaxQueue','find','raw','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','map','include','attributes'];(function(_0x42faa1,_0x2c8d4b){var _0xb95671=function(_0x28a613){while(--_0x28a613){_0x42faa1['push'](_0x42faa1['shift']());}};_0xb95671(++_0x2c8d4b);}(_0x185a,0x1e6));var _0xa185=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x185a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xa185('0x0'));var util=require(_0xa185('0x1'));var moment=require('moment');var BPromise=require(_0xa185('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa185('0x3'))['db'];var utils=require(_0xa185('0x4'));var logger=require(_0xa185('0x5'))(_0xa185('0x6'));var config=require(_0xa185('0x7'));var jayson=require(_0xa185('0x8'));var client=jayson[_0xa185('0x9')][_0xa185('0xa')]({'port':0x232a});config[_0xa185('0xb')]=_['defaults'](config['redis'],{'host':_0xa185('0xc'),'port':0x18eb});var socket=require(_0xa185('0xd'))(new Redis(config[_0xa185('0xb')]));require(_0xa185('0xe'))['register'](socket);function respondWithRpcPromise(_0x291795,_0x4222a3,_0x17f2cd){return new BPromise(function(_0x20ac31,_0x498480){return client[_0xa185('0xf')](_0x291795,_0x17f2cd)['then'](function(_0x48b283){logger[_0xa185('0x10')](_0xa185('0x11'),_0x4222a3,_0xa185('0x12'));logger['debug'](_0xa185('0x13'),_0x4222a3,_0xa185('0x12'),JSON[_0xa185('0x14')](_0x48b283));if(_0x48b283[_0xa185('0x15')]){if(_0x48b283[_0xa185('0x15')][_0xa185('0x16')]===0x1f4){logger['error'](_0xa185('0x11'),_0x4222a3,_0x48b283['error'][_0xa185('0x17')]);return _0x498480(_0x48b283[_0xa185('0x15')]['message']);}logger[_0xa185('0x15')](_0xa185('0x11'),_0x4222a3,_0x48b283[_0xa185('0x15')][_0xa185('0x17')]);return _0x20ac31(_0x48b283['error']['message']);}else{logger[_0xa185('0x10')](_0xa185('0x11'),_0x4222a3,_0xa185('0x12'));_0x20ac31(_0x48b283[_0xa185('0x18')]['message']);}})[_0xa185('0x19')](function(_0x3023ca){logger[_0xa185('0x15')](_0xa185('0x11'),_0x4222a3,_0x3023ca);_0x498480(_0x3023ca);});});}exports[_0xa185('0x1a')]=function(_0xb4b126){var _0x1c6369=this;return new Promise(function(_0xce7e7f,_0x4f3b0a){return db[_0xa185('0x1b')][_0xa185('0x1c')]({'raw':_0xb4b126[_0xa185('0x1d')]?_0xb4b126[_0xa185('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xb4b126[_0xa185('0x1d')]?_0xb4b126[_0xa185('0x1d')][_0xa185('0x1e')]||null:null,'attributes':_0xb4b126['options']?_0xb4b126['options']['attributes']||null:null,'limit':_0xb4b126[_0xa185('0x1d')]?_0xb4b126['options']['limit']||null:null,'include':_0xb4b126[_0xa185('0x1d')]?_0xb4b126['options']['include']?_[_0xa185('0x1f')](_0xb4b126[_0xa185('0x1d')][_0xa185('0x20')],function(_0xef6739){return{'model':db[_0xef6739['model']],'as':_0xef6739['as'],'attributes':_0xef6739[_0xa185('0x21')],'include':_0xef6739[_0xa185('0x20')]?_[_0xa185('0x1f')](_0xef6739[_0xa185('0x20')],function(_0x47c080){return{'model':db[_0x47c080[_0xa185('0x22')]],'as':_0x47c080['as'],'attributes':_0x47c080['attributes'],'include':_0x47c080[_0xa185('0x20')]?_[_0xa185('0x1f')](_0x47c080[_0xa185('0x20')],function(_0x371d21){return{'model':db[_0x371d21[_0xa185('0x22')]],'as':_0x371d21['as'],'attributes':_0x371d21['attributes']};}):[]};}):[]};}):[]:[]})[_0xa185('0x23')](function(_0x48acef){logger[_0xa185('0x10')]('GetFaxQueue',_0xb4b126);logger[_0xa185('0x24')](_0xa185('0x1a'),_0xb4b126,JSON[_0xa185('0x14')](_0x48acef));_0xce7e7f(_0x48acef);})[_0xa185('0x19')](function(_0x38eb52){logger[_0xa185('0x15')](_0xa185('0x1a'),_0x38eb52[_0xa185('0x17')],_0xb4b126);_0x4f3b0a(_0x1c6369[_0xa185('0x15')](0x1f4,_0x38eb52['message']));});});};exports[_0xa185('0x25')]=function(_0x1efe96){var _0x36c63c=this;return new Promise(function(_0x857d9e,_0xdd251b){return db[_0xa185('0x1b')][_0xa185('0x26')]({'raw':_0x1efe96[_0xa185('0x1d')]?_0x1efe96[_0xa185('0x1d')][_0xa185('0x27')]===undefined?!![]:![]:!![],'where':_0x1efe96[_0xa185('0x1d')]?_0x1efe96[_0xa185('0x1d')][_0xa185('0x1e')]||null:null,'attributes':_0x1efe96[_0xa185('0x1d')]?_0x1efe96[_0xa185('0x1d')][_0xa185('0x21')]||null:null,'include':_0x1efe96[_0xa185('0x1d')]?_0x1efe96[_0xa185('0x1d')][_0xa185('0x20')]?_['map'](_0x1efe96['options'][_0xa185('0x20')],function(_0x4a7583){return{'model':db[_0x4a7583['model']],'as':_0x4a7583['as'],'attributes':_0x4a7583[_0xa185('0x21')],'include':_0x4a7583[_0xa185('0x20')]?_['map'](_0x4a7583[_0xa185('0x20')],function(_0x261411){return{'model':db[_0x261411[_0xa185('0x22')]],'as':_0x261411['as'],'attributes':_0x261411['attributes'],'include':_0x261411[_0xa185('0x20')]?_['map'](_0x261411[_0xa185('0x20')],function(_0x37f360){return{'model':db[_0x37f360[_0xa185('0x22')]],'as':_0x37f360['as'],'attributes':_0x37f360['attributes']};}):[]};}):[]};}):[]:[]})[_0xa185('0x23')](function(_0x517dd4){logger['info'](_0xa185('0x25'),_0x1efe96);logger[_0xa185('0x24')](_0xa185('0x25'),_0x1efe96,JSON[_0xa185('0x14')](_0x517dd4));_0x857d9e(_0x517dd4);})[_0xa185('0x19')](function(_0x364dd7){logger[_0xa185('0x15')](_0xa185('0x25'),_0x364dd7[_0xa185('0x17')],_0x1efe96);_0xdd251b(_0x36c63c[_0xa185('0x15')](0x1f4,_0x364dd7[_0xa185('0x17')]));});});};
\ No newline at end of file
+var _0x19fb=['FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit','include','map','model','stringify','ShowFaxQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','request','then','info'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x19fb,0x12d));var _0xb19f=function(_0x529734,_0x502a29){_0x529734=_0x529734-0x0;var _0x177897=_0x19fb[_0x529734];return _0x177897;};'use strict';var _=require(_0xb19f('0x0'));var util=require(_0xb19f('0x1'));var moment=require('moment');var BPromise=require(_0xb19f('0x2'));var rs=require(_0xb19f('0x3'));var fs=require('fs');var Redis=require(_0xb19f('0x4'));var db=require(_0xb19f('0x5'))['db'];var utils=require(_0xb19f('0x6'));var logger=require(_0xb19f('0x7'))(_0xb19f('0x8'));var config=require(_0xb19f('0x9'));var jayson=require(_0xb19f('0xa'));var client=jayson['client'][_0xb19f('0xb')]({'port':0x232a});config[_0xb19f('0xc')]=_[_0xb19f('0xd')](config[_0xb19f('0xc')],{'host':_0xb19f('0xe'),'port':0x18eb});var socket=require(_0xb19f('0xf'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x4ac516,_0x301b9b,_0x3da902){return new BPromise(function(_0x77a43f,_0x31dae0){return client[_0xb19f('0x10')](_0x4ac516,_0x3da902)[_0xb19f('0x11')](function(_0x202bab){logger[_0xb19f('0x12')](_0xb19f('0x13'),_0x301b9b,_0xb19f('0x14'));logger[_0xb19f('0x15')](_0xb19f('0x16'),_0x301b9b,'request\x20sent',JSON['stringify'](_0x202bab));if(_0x202bab[_0xb19f('0x17')]){if(_0x202bab[_0xb19f('0x17')][_0xb19f('0x18')]===0x1f4){logger[_0xb19f('0x17')](_0xb19f('0x13'),_0x301b9b,_0x202bab[_0xb19f('0x17')][_0xb19f('0x19')]);return _0x31dae0(_0x202bab['error']['message']);}logger[_0xb19f('0x17')]('FaxQueue,\x20%s,\x20%s',_0x301b9b,_0x202bab[_0xb19f('0x17')][_0xb19f('0x19')]);return _0x77a43f(_0x202bab[_0xb19f('0x17')][_0xb19f('0x19')]);}else{logger[_0xb19f('0x12')](_0xb19f('0x13'),_0x301b9b,_0xb19f('0x14'));_0x77a43f(_0x202bab[_0xb19f('0x1a')][_0xb19f('0x19')]);}})[_0xb19f('0x1b')](function(_0x51862b){logger['error'](_0xb19f('0x13'),_0x301b9b,_0x51862b);_0x31dae0(_0x51862b);});});}exports[_0xb19f('0x1c')]=function(_0x3aeced){var _0x58a719=this;return new Promise(function(_0x48c866,_0x4a1ef7){return db[_0xb19f('0x1d')]['findAll']({'raw':_0x3aeced[_0xb19f('0x1e')]?_0x3aeced['options'][_0xb19f('0x1f')]===undefined?!![]:![]:!![],'where':_0x3aeced[_0xb19f('0x1e')]?_0x3aeced[_0xb19f('0x1e')][_0xb19f('0x20')]||null:null,'attributes':_0x3aeced[_0xb19f('0x1e')]?_0x3aeced[_0xb19f('0x1e')][_0xb19f('0x21')]||null:null,'limit':_0x3aeced[_0xb19f('0x1e')]?_0x3aeced[_0xb19f('0x1e')][_0xb19f('0x22')]||null:null,'include':_0x3aeced[_0xb19f('0x1e')]?_0x3aeced['options'][_0xb19f('0x23')]?_[_0xb19f('0x24')](_0x3aeced[_0xb19f('0x1e')][_0xb19f('0x23')],function(_0x43b943){return{'model':db[_0x43b943[_0xb19f('0x25')]],'as':_0x43b943['as'],'attributes':_0x43b943['attributes'],'include':_0x43b943['include']?_[_0xb19f('0x24')](_0x43b943[_0xb19f('0x23')],function(_0x10607c){return{'model':db[_0x10607c[_0xb19f('0x25')]],'as':_0x10607c['as'],'attributes':_0x10607c[_0xb19f('0x21')],'include':_0x10607c[_0xb19f('0x23')]?_['map'](_0x10607c[_0xb19f('0x23')],function(_0x1f8728){return{'model':db[_0x1f8728[_0xb19f('0x25')]],'as':_0x1f8728['as'],'attributes':_0x1f8728[_0xb19f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb19f('0x11')](function(_0x35be5f){logger[_0xb19f('0x12')]('GetFaxQueue',_0x3aeced);logger['debug'](_0xb19f('0x1c'),_0x3aeced,JSON[_0xb19f('0x26')](_0x35be5f));_0x48c866(_0x35be5f);})[_0xb19f('0x1b')](function(_0x50cff3){logger[_0xb19f('0x17')]('GetFaxQueue',_0x50cff3['message'],_0x3aeced);_0x4a1ef7(_0x58a719[_0xb19f('0x17')](0x1f4,_0x50cff3[_0xb19f('0x19')]));});});};exports['ShowFaxQueue']=function(_0x494e2e){var _0x5cf17e=this;return new Promise(function(_0x1cbfd7,_0x9692c3){return db[_0xb19f('0x1d')]['find']({'raw':_0x494e2e['options']?_0x494e2e[_0xb19f('0x1e')][_0xb19f('0x1f')]===undefined?!![]:![]:!![],'where':_0x494e2e[_0xb19f('0x1e')]?_0x494e2e['options'][_0xb19f('0x20')]||null:null,'attributes':_0x494e2e[_0xb19f('0x1e')]?_0x494e2e[_0xb19f('0x1e')]['attributes']||null:null,'include':_0x494e2e[_0xb19f('0x1e')]?_0x494e2e[_0xb19f('0x1e')]['include']?_[_0xb19f('0x24')](_0x494e2e[_0xb19f('0x1e')]['include'],function(_0xb8a014){return{'model':db[_0xb8a014[_0xb19f('0x25')]],'as':_0xb8a014['as'],'attributes':_0xb8a014[_0xb19f('0x21')],'include':_0xb8a014[_0xb19f('0x23')]?_[_0xb19f('0x24')](_0xb8a014['include'],function(_0x332214){return{'model':db[_0x332214[_0xb19f('0x25')]],'as':_0x332214['as'],'attributes':_0x332214['attributes'],'include':_0x332214[_0xb19f('0x23')]?_[_0xb19f('0x24')](_0x332214[_0xb19f('0x23')],function(_0x584852){return{'model':db[_0x584852[_0xb19f('0x25')]],'as':_0x584852['as'],'attributes':_0x584852[_0xb19f('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb19f('0x11')](function(_0x100d1a){logger['info'](_0xb19f('0x27'),_0x494e2e);logger['debug']('ShowFaxQueue',_0x494e2e,JSON['stringify'](_0x100d1a));_0x1cbfd7(_0x100d1a);})[_0xb19f('0x1b')](function(_0x20e100){logger[_0xb19f('0x17')]('ShowFaxQueue',_0x20e100['message'],_0x494e2e);_0x9692c3(_0x5cf17e[_0xb19f('0x17')](0x1f4,_0x20e100[_0xb19f('0x19')]));});});};
\ No newline at end of file