Built motion from commit (unavailable).|2.2.0
[motion2.git] / server / api / faxQueue / faxQueue.rpc.js
index da1bfd5..dcc010b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae49=['options','raw','where','include','map','model','attributes','GetFaxQueue','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','request\x20sent','stringify','error','FaxQueue,\x20%s,\x20%s','message','info','result','catch','FaxQueue','findAll'];(function(_0x1ba303,_0x1638c5){var _0x45a904=function(_0x164080){while(--_0x164080){_0x1ba303['push'](_0x1ba303['shift']());}};_0x45a904(++_0x1638c5);}(_0xae49,0x1cd));var _0x9ae4=function(_0x193bb6,_0x3cb2ec){_0x193bb6=_0x193bb6-0x0;var _0x5a267=_0xae49[_0x193bb6];return _0x5a267;};'use strict';var _=require(_0x9ae4('0x0'));var util=require(_0x9ae4('0x1'));var moment=require(_0x9ae4('0x2'));var BPromise=require(_0x9ae4('0x3'));var rs=require(_0x9ae4('0x4'));var fs=require('fs');var Redis=require(_0x9ae4('0x5'));var db=require(_0x9ae4('0x6'))['db'];var utils=require(_0x9ae4('0x7'));var logger=require(_0x9ae4('0x8'))(_0x9ae4('0x9'));var config=require(_0x9ae4('0xa'));var jayson=require(_0x9ae4('0xb'));var client=jayson['client'][_0x9ae4('0xc')]({'port':0x232a});config[_0x9ae4('0xd')]=_[_0x9ae4('0xe')](config[_0x9ae4('0xd')],{'host':_0x9ae4('0xf'),'port':0x18eb});var socket=require(_0x9ae4('0x10'))(new Redis(config['redis']));require(_0x9ae4('0x11'))[_0x9ae4('0x12')](socket);function respondWithRpcPromise(_0x5d82c3,_0x20f6dd,_0x29667c){return new BPromise(function(_0x323e53,_0x5a71f2){return client[_0x9ae4('0x13')](_0x5d82c3,_0x29667c)[_0x9ae4('0x14')](function(_0x3c2a89){logger['info']('FaxQueue,\x20%s,\x20%s',_0x20f6dd,_0x9ae4('0x15'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x20f6dd,_0x9ae4('0x15'),JSON[_0x9ae4('0x16')](_0x3c2a89));if(_0x3c2a89[_0x9ae4('0x17')]){if(_0x3c2a89[_0x9ae4('0x17')]['code']===0x1f4){logger[_0x9ae4('0x17')](_0x9ae4('0x18'),_0x20f6dd,_0x3c2a89[_0x9ae4('0x17')][_0x9ae4('0x19')]);return _0x5a71f2(_0x3c2a89[_0x9ae4('0x17')][_0x9ae4('0x19')]);}logger[_0x9ae4('0x17')]('FaxQueue,\x20%s,\x20%s',_0x20f6dd,_0x3c2a89['error'][_0x9ae4('0x19')]);return _0x323e53(_0x3c2a89['error'][_0x9ae4('0x19')]);}else{logger[_0x9ae4('0x1a')]('FaxQueue,\x20%s,\x20%s',_0x20f6dd,'request\x20sent');_0x323e53(_0x3c2a89[_0x9ae4('0x1b')][_0x9ae4('0x19')]);}})[_0x9ae4('0x1c')](function(_0x149de6){logger['error'](_0x9ae4('0x18'),_0x20f6dd,_0x149de6);_0x5a71f2(_0x149de6);});});}exports['GetFaxQueue']=function(_0x3da4d2){var _0x27ffbe=this;return new Promise(function(_0x4bfc55,_0x1c24d4){return db[_0x9ae4('0x1d')][_0x9ae4('0x1e')]({'raw':_0x3da4d2[_0x9ae4('0x1f')]?_0x3da4d2[_0x9ae4('0x1f')][_0x9ae4('0x20')]===undefined?!![]:![]:!![],'where':_0x3da4d2[_0x9ae4('0x1f')]?_0x3da4d2[_0x9ae4('0x1f')][_0x9ae4('0x21')]||null:null,'attributes':_0x3da4d2['options']?_0x3da4d2[_0x9ae4('0x1f')]['attributes']||null:null,'limit':_0x3da4d2[_0x9ae4('0x1f')]?_0x3da4d2[_0x9ae4('0x1f')]['limit']||null:null,'include':_0x3da4d2['options']?_0x3da4d2[_0x9ae4('0x1f')][_0x9ae4('0x22')]?_[_0x9ae4('0x23')](_0x3da4d2[_0x9ae4('0x1f')][_0x9ae4('0x22')],function(_0x370110){return{'model':db[_0x370110[_0x9ae4('0x24')]],'as':_0x370110['as'],'attributes':_0x370110['attributes'],'include':_0x370110[_0x9ae4('0x22')]?_[_0x9ae4('0x23')](_0x370110[_0x9ae4('0x22')],function(_0x28e99e){return{'model':db[_0x28e99e[_0x9ae4('0x24')]],'as':_0x28e99e['as'],'attributes':_0x28e99e[_0x9ae4('0x25')],'include':_0x28e99e['include']?_[_0x9ae4('0x23')](_0x28e99e[_0x9ae4('0x22')],function(_0x5689ac){return{'model':db[_0x5689ac[_0x9ae4('0x24')]],'as':_0x5689ac['as'],'attributes':_0x5689ac['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ae4('0x14')](function(_0x26176a){logger[_0x9ae4('0x1a')](_0x9ae4('0x26'),_0x3da4d2);logger['debug']('GetFaxQueue',_0x3da4d2,JSON[_0x9ae4('0x16')](_0x26176a));_0x4bfc55(_0x26176a);})[_0x9ae4('0x1c')](function(_0x9885eb){logger[_0x9ae4('0x17')](_0x9ae4('0x26'),_0x9885eb[_0x9ae4('0x19')],_0x3da4d2);_0x1c24d4(_0x27ffbe[_0x9ae4('0x17')](0x1f4,_0x9885eb[_0x9ae4('0x19')]));});});};exports[_0x9ae4('0x27')]=function(_0x1fbbc6){var _0x3449d2=this;return new Promise(function(_0x591a00,_0x282226){return db['FaxQueue'][_0x9ae4('0x28')]({'raw':_0x1fbbc6[_0x9ae4('0x1f')]?_0x1fbbc6['options'][_0x9ae4('0x20')]===undefined?!![]:![]:!![],'where':_0x1fbbc6[_0x9ae4('0x1f')]?_0x1fbbc6[_0x9ae4('0x1f')][_0x9ae4('0x21')]||null:null,'attributes':_0x1fbbc6['options']?_0x1fbbc6['options'][_0x9ae4('0x25')]||null:null,'include':_0x1fbbc6[_0x9ae4('0x1f')]?_0x1fbbc6['options'][_0x9ae4('0x22')]?_[_0x9ae4('0x23')](_0x1fbbc6[_0x9ae4('0x1f')]['include'],function(_0x5f3660){return{'model':db[_0x5f3660[_0x9ae4('0x24')]],'as':_0x5f3660['as'],'attributes':_0x5f3660[_0x9ae4('0x25')],'include':_0x5f3660[_0x9ae4('0x22')]?_[_0x9ae4('0x23')](_0x5f3660['include'],function(_0x2e6127){return{'model':db[_0x2e6127[_0x9ae4('0x24')]],'as':_0x2e6127['as'],'attributes':_0x2e6127[_0x9ae4('0x25')],'include':_0x2e6127['include']?_[_0x9ae4('0x23')](_0x2e6127[_0x9ae4('0x22')],function(_0x35fe16){return{'model':db[_0x35fe16[_0x9ae4('0x24')]],'as':_0x35fe16['as'],'attributes':_0x35fe16['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ae4('0x14')](function(_0x174f52){logger[_0x9ae4('0x1a')]('ShowFaxQueue',_0x1fbbc6);logger['debug'](_0x9ae4('0x27'),_0x1fbbc6,JSON['stringify'](_0x174f52));_0x591a00(_0x174f52);})[_0x9ae4('0x1c')](function(_0x5b8abe){logger[_0x9ae4('0x17')](_0x9ae4('0x27'),_0x5b8abe[_0x9ae4('0x19')],_0x1fbbc6);_0x282226(_0x3449d2[_0x9ae4('0x17')](0x1f4,_0x5b8abe['message']));});});};
\ No newline at end of file
+var _0x3926=['./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','GetFaxQueue','findAll','options','limit','include','map','attributes','model','stringify','catch','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5f0225,_0x52631a){var _0x2cef4b=function(_0x5a29c6){while(--_0x5a29c6){_0x5f0225['push'](_0x5f0225['shift']());}};_0x2cef4b(++_0x52631a);}(_0x3926,0xe7));var _0x6392=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x3926[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0x6392('0x0'));var util=require(_0x6392('0x1'));var moment=require(_0x6392('0x2'));var BPromise=require(_0x6392('0x3'));var rs=require(_0x6392('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6392('0x5'))['db'];var utils=require(_0x6392('0x6'));var logger=require(_0x6392('0x7'))('rpc');var config=require(_0x6392('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6392('0x9')][_0x6392('0xa')]({'port':0x232a});config[_0x6392('0xb')]=_[_0x6392('0xc')](config[_0x6392('0xb')],{'host':_0x6392('0xd'),'port':0x18eb});var socket=require(_0x6392('0xe'))(new Redis(config[_0x6392('0xb')]));require(_0x6392('0xf'))[_0x6392('0x10')](socket);function respondWithRpcPromise(_0x4fd4f8,_0x161e64,_0x3e67fe){return new BPromise(function(_0x3cc7c6,_0xc933bf){return client[_0x6392('0x11')](_0x4fd4f8,_0x3e67fe)[_0x6392('0x12')](function(_0x8b7787){logger[_0x6392('0x13')](_0x6392('0x14'),_0x161e64,'request\x20sent');logger[_0x6392('0x15')](_0x6392('0x16'),_0x161e64,_0x6392('0x17'),JSON['stringify'](_0x8b7787));if(_0x8b7787[_0x6392('0x18')]){if(_0x8b7787[_0x6392('0x18')][_0x6392('0x19')]===0x1f4){logger[_0x6392('0x18')](_0x6392('0x14'),_0x161e64,_0x8b7787[_0x6392('0x18')][_0x6392('0x1a')]);return _0xc933bf(_0x8b7787[_0x6392('0x18')][_0x6392('0x1a')]);}logger[_0x6392('0x18')](_0x6392('0x14'),_0x161e64,_0x8b7787[_0x6392('0x18')][_0x6392('0x1a')]);return _0x3cc7c6(_0x8b7787[_0x6392('0x18')][_0x6392('0x1a')]);}else{logger['info'](_0x6392('0x14'),_0x161e64,_0x6392('0x17'));_0x3cc7c6(_0x8b7787[_0x6392('0x1b')]['message']);}})['catch'](function(_0x89c6be){logger[_0x6392('0x18')]('FaxQueue,\x20%s,\x20%s',_0x161e64,_0x89c6be);_0xc933bf(_0x89c6be);});});}exports[_0x6392('0x1c')]=function(_0x5f03ce){var _0x368927=this;return new Promise(function(_0x1fdbe3,_0x329e56){return db['FaxQueue'][_0x6392('0x1d')]({'raw':_0x5f03ce[_0x6392('0x1e')]?_0x5f03ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x5f03ce[_0x6392('0x1e')]?_0x5f03ce[_0x6392('0x1e')]['where']||null:null,'attributes':_0x5f03ce[_0x6392('0x1e')]?_0x5f03ce[_0x6392('0x1e')]['attributes']||null:null,'limit':_0x5f03ce['options']?_0x5f03ce['options'][_0x6392('0x1f')]||null:null,'include':_0x5f03ce[_0x6392('0x1e')]?_0x5f03ce[_0x6392('0x1e')][_0x6392('0x20')]?_[_0x6392('0x21')](_0x5f03ce['options'][_0x6392('0x20')],function(_0x1802b6){return{'model':db[_0x1802b6['model']],'as':_0x1802b6['as'],'attributes':_0x1802b6[_0x6392('0x22')],'include':_0x1802b6[_0x6392('0x20')]?_[_0x6392('0x21')](_0x1802b6[_0x6392('0x20')],function(_0x92d0cb){return{'model':db[_0x92d0cb[_0x6392('0x23')]],'as':_0x92d0cb['as'],'attributes':_0x92d0cb[_0x6392('0x22')],'include':_0x92d0cb[_0x6392('0x20')]?_['map'](_0x92d0cb['include'],function(_0x3382bd){return{'model':db[_0x3382bd['model']],'as':_0x3382bd['as'],'attributes':_0x3382bd[_0x6392('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f0373){logger[_0x6392('0x13')](_0x6392('0x1c'),_0x5f03ce);logger[_0x6392('0x15')](_0x6392('0x1c'),_0x5f03ce,JSON[_0x6392('0x24')](_0x3f0373));_0x1fdbe3(_0x3f0373);})[_0x6392('0x25')](function(_0x113942){logger['error'](_0x6392('0x1c'),_0x113942['message'],_0x5f03ce);_0x329e56(_0x368927['error'](0x1f4,_0x113942['message']));});});};exports[_0x6392('0x26')]=function(_0x30661f){var _0x150044=this;return new Promise(function(_0xd1a3e5,_0x24ce98){return db['FaxQueue'][_0x6392('0x27')]({'raw':_0x30661f['options']?_0x30661f[_0x6392('0x1e')][_0x6392('0x28')]===undefined?!![]:![]:!![],'where':_0x30661f['options']?_0x30661f[_0x6392('0x1e')]['where']||null:null,'attributes':_0x30661f['options']?_0x30661f['options']['attributes']||null:null,'include':_0x30661f['options']?_0x30661f[_0x6392('0x1e')]['include']?_['map'](_0x30661f['options']['include'],function(_0x430a5b){return{'model':db[_0x430a5b[_0x6392('0x23')]],'as':_0x430a5b['as'],'attributes':_0x430a5b[_0x6392('0x22')],'include':_0x430a5b[_0x6392('0x20')]?_[_0x6392('0x21')](_0x430a5b['include'],function(_0x15a73d){return{'model':db[_0x15a73d['model']],'as':_0x15a73d['as'],'attributes':_0x15a73d[_0x6392('0x22')],'include':_0x15a73d[_0x6392('0x20')]?_[_0x6392('0x21')](_0x15a73d[_0x6392('0x20')],function(_0x2c8790){return{'model':db[_0x2c8790[_0x6392('0x23')]],'as':_0x2c8790['as'],'attributes':_0x2c8790['attributes']};}):[]};}):[]};}):[]:[]})[_0x6392('0x12')](function(_0x54edc9){logger[_0x6392('0x13')](_0x6392('0x26'),_0x30661f);logger[_0x6392('0x15')](_0x6392('0x26'),_0x30661f,JSON[_0x6392('0x24')](_0x54edc9));_0xd1a3e5(_0x54edc9);})[_0x6392('0x25')](function(_0x4f8ba5){logger['error'](_0x6392('0x26'),_0x4f8ba5['message'],_0x30661f);_0x24ce98(_0x150044[_0x6392('0x18')](0x1f4,_0x4f8ba5[_0x6392('0x1a')]));});});};
\ No newline at end of file