Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / api / whatsappQueue / whatsappQueue.rpc.js
index 5f18266..03bca0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cef=['ShowWhatsappQueue','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','WhatsappQueue','findAll','options','where','limit','map','include','model','attributes','then','GetWhatsappQueue','debug','stringify','catch'];(function(_0x18e50f,_0x484130){var _0x49ae07=function(_0x52c3c1){while(--_0x52c3c1){_0x18e50f['push'](_0x18e50f['shift']());}};_0x49ae07(++_0x484130);}(_0x0cef,0x7d));var _0xf0ce=function(_0x29cb88,_0x36e887){_0x29cb88=_0x29cb88-0x0;var _0x7988a7=_0x0cef[_0x29cb88];return _0x7988a7;};'use strict';var _=require('lodash');var util=require(_0xf0ce('0x0'));var moment=require(_0xf0ce('0x1'));var BPromise=require(_0xf0ce('0x2'));var rs=require(_0xf0ce('0x3'));var fs=require('fs');var Redis=require(_0xf0ce('0x4'));var db=require(_0xf0ce('0x5'))['db'];var utils=require(_0xf0ce('0x6'));var logger=require('../../config/logger')(_0xf0ce('0x7'));var config=require('../../config/environment');var jayson=require(_0xf0ce('0x8'));var client=jayson[_0xf0ce('0x9')]['http']({'port':0x232a});config['redis']=_[_0xf0ce('0xa')](config['redis'],{'host':_0xf0ce('0xb'),'port':0x18eb});var socket=require(_0xf0ce('0xc'))(new Redis(config[_0xf0ce('0xd')]));require(_0xf0ce('0xe'))[_0xf0ce('0xf')](socket);function respondWithRpcPromise(_0x5ddfb1,_0x23d57e,_0x489cfd){return new BPromise(function(_0x11d639,_0x290f2b){return client[_0xf0ce('0x10')](_0x5ddfb1,_0x489cfd)['then'](function(_0x4e4d6d){logger[_0xf0ce('0x11')](_0xf0ce('0x12'),_0x23d57e,_0xf0ce('0x13'));logger['debug'](_0xf0ce('0x14'),_0x23d57e,_0xf0ce('0x13'),JSON['stringify'](_0x4e4d6d));if(_0x4e4d6d['error']){if(_0x4e4d6d[_0xf0ce('0x15')][_0xf0ce('0x16')]===0x1f4){logger[_0xf0ce('0x15')](_0xf0ce('0x12'),_0x23d57e,_0x4e4d6d[_0xf0ce('0x15')][_0xf0ce('0x17')]);return _0x290f2b(_0x4e4d6d[_0xf0ce('0x15')][_0xf0ce('0x17')]);}logger[_0xf0ce('0x15')](_0xf0ce('0x12'),_0x23d57e,_0x4e4d6d['error'][_0xf0ce('0x17')]);return _0x11d639(_0x4e4d6d[_0xf0ce('0x15')][_0xf0ce('0x17')]);}else{logger[_0xf0ce('0x11')](_0xf0ce('0x12'),_0x23d57e,_0xf0ce('0x13'));_0x11d639(_0x4e4d6d[_0xf0ce('0x18')][_0xf0ce('0x17')]);}})['catch'](function(_0x3a0d1f){logger[_0xf0ce('0x15')](_0xf0ce('0x12'),_0x23d57e,_0x3a0d1f);_0x290f2b(_0x3a0d1f);});});}exports['GetWhatsappQueue']=function(_0x1a40f7){var _0x3f6d57=this;return new Promise(function(_0x3697a3,_0x4d5dfa){return db[_0xf0ce('0x19')][_0xf0ce('0x1a')]({'raw':_0x1a40f7[_0xf0ce('0x1b')]?_0x1a40f7[_0xf0ce('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1a40f7[_0xf0ce('0x1b')]?_0x1a40f7[_0xf0ce('0x1b')][_0xf0ce('0x1c')]||null:null,'attributes':_0x1a40f7[_0xf0ce('0x1b')]?_0x1a40f7[_0xf0ce('0x1b')]['attributes']||null:null,'limit':_0x1a40f7['options']?_0x1a40f7[_0xf0ce('0x1b')][_0xf0ce('0x1d')]||null:null,'include':_0x1a40f7['options']?_0x1a40f7['options']['include']?_[_0xf0ce('0x1e')](_0x1a40f7[_0xf0ce('0x1b')][_0xf0ce('0x1f')],function(_0x27879f){return{'model':db[_0x27879f[_0xf0ce('0x20')]],'as':_0x27879f['as'],'attributes':_0x27879f[_0xf0ce('0x21')],'include':_0x27879f[_0xf0ce('0x1f')]?_[_0xf0ce('0x1e')](_0x27879f[_0xf0ce('0x1f')],function(_0x20aeb9){return{'model':db[_0x20aeb9[_0xf0ce('0x20')]],'as':_0x20aeb9['as'],'attributes':_0x20aeb9[_0xf0ce('0x21')],'include':_0x20aeb9[_0xf0ce('0x1f')]?_[_0xf0ce('0x1e')](_0x20aeb9['include'],function(_0x5d69c3){return{'model':db[_0x5d69c3[_0xf0ce('0x20')]],'as':_0x5d69c3['as'],'attributes':_0x5d69c3[_0xf0ce('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf0ce('0x22')](function(_0xa7a55d){logger[_0xf0ce('0x11')](_0xf0ce('0x23'),_0x1a40f7);logger[_0xf0ce('0x24')](_0xf0ce('0x23'),_0x1a40f7,JSON[_0xf0ce('0x25')](_0xa7a55d));_0x3697a3(_0xa7a55d);})[_0xf0ce('0x26')](function(_0x39a57f){logger['error'](_0xf0ce('0x23'),_0x39a57f[_0xf0ce('0x17')],_0x1a40f7);_0x4d5dfa(_0x3f6d57[_0xf0ce('0x15')](0x1f4,_0x39a57f[_0xf0ce('0x17')]));});});};exports[_0xf0ce('0x27')]=function(_0x3d6bc3){var _0x45b1ed=this;return new Promise(function(_0x1d0a55,_0x28db3f){return db[_0xf0ce('0x19')][_0xf0ce('0x28')]({'raw':_0x3d6bc3[_0xf0ce('0x1b')]?_0x3d6bc3[_0xf0ce('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3d6bc3[_0xf0ce('0x1b')]?_0x3d6bc3['options'][_0xf0ce('0x1c')]||null:null,'attributes':_0x3d6bc3[_0xf0ce('0x1b')]?_0x3d6bc3[_0xf0ce('0x1b')]['attributes']||null:null,'include':_0x3d6bc3[_0xf0ce('0x1b')]?_0x3d6bc3[_0xf0ce('0x1b')][_0xf0ce('0x1f')]?_[_0xf0ce('0x1e')](_0x3d6bc3[_0xf0ce('0x1b')]['include'],function(_0x285305){return{'model':db[_0x285305['model']],'as':_0x285305['as'],'attributes':_0x285305[_0xf0ce('0x21')],'include':_0x285305[_0xf0ce('0x1f')]?_[_0xf0ce('0x1e')](_0x285305[_0xf0ce('0x1f')],function(_0x51fb57){return{'model':db[_0x51fb57['model']],'as':_0x51fb57['as'],'attributes':_0x51fb57[_0xf0ce('0x21')],'include':_0x51fb57[_0xf0ce('0x1f')]?_[_0xf0ce('0x1e')](_0x51fb57[_0xf0ce('0x1f')],function(_0x483def){return{'model':db[_0x483def[_0xf0ce('0x20')]],'as':_0x483def['as'],'attributes':_0x483def[_0xf0ce('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf0ce('0x22')](function(_0x123e44){logger[_0xf0ce('0x11')]('ShowWhatsappQueue',_0x3d6bc3);logger[_0xf0ce('0x24')](_0xf0ce('0x27'),_0x3d6bc3,JSON[_0xf0ce('0x25')](_0x123e44));_0x1d0a55(_0x123e44);})[_0xf0ce('0x26')](function(_0x4f99a3){logger['error'](_0xf0ce('0x27'),_0x4f99a3['message'],_0x3d6bc3);_0x28db3f(_0x45b1ed[_0xf0ce('0x15')](0x1f4,_0x4f99a3[_0xf0ce('0x17')]));});});};
\ No newline at end of file
+var _0xc58b=['options','where','attributes','limit','include','map','model','then','find','raw','ShowWhatsappQueue','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./whatsappQueue.socket','register','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xc58b,0x1df));var _0xbc58=function(_0x34ffcc,_0x5bf550){_0x34ffcc=_0x34ffcc-0x0;var _0x4e815a=_0xc58b[_0x34ffcc];return _0x4e815a;};'use strict';var _=require(_0xbc58('0x0'));var util=require(_0xbc58('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc58('0x2'));var fs=require('fs');var Redis=require(_0xbc58('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc58('0x4'))(_0xbc58('0x5'));var config=require(_0xbc58('0x6'));var jayson=require(_0xbc58('0x7'));var client=jayson[_0xbc58('0x8')][_0xbc58('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xbc58('0xa'),'port':0x18eb});var socket=require(_0xbc58('0xb'))(new Redis(config[_0xbc58('0xc')]));require(_0xbc58('0xd'))[_0xbc58('0xe')](socket);function respondWithRpcPromise(_0x2dfc95,_0x21fb97,_0x163541){return new BPromise(function(_0xf7ae76,_0x5bb20a){return client['request'](_0x2dfc95,_0x163541)['then'](function(_0x4b7fad){logger['info'](_0xbc58('0xf'),_0x21fb97,_0xbc58('0x10'));logger[_0xbc58('0x11')](_0xbc58('0x12'),_0x21fb97,'request\x20sent',JSON[_0xbc58('0x13')](_0x4b7fad));if(_0x4b7fad[_0xbc58('0x14')]){if(_0x4b7fad['error'][_0xbc58('0x15')]===0x1f4){logger['error'](_0xbc58('0xf'),_0x21fb97,_0x4b7fad[_0xbc58('0x14')]['message']);return _0x5bb20a(_0x4b7fad[_0xbc58('0x14')][_0xbc58('0x16')]);}logger[_0xbc58('0x14')](_0xbc58('0xf'),_0x21fb97,_0x4b7fad['error'][_0xbc58('0x16')]);return _0xf7ae76(_0x4b7fad[_0xbc58('0x14')][_0xbc58('0x16')]);}else{logger[_0xbc58('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x21fb97,_0xbc58('0x10'));_0xf7ae76(_0x4b7fad[_0xbc58('0x18')][_0xbc58('0x16')]);}})[_0xbc58('0x19')](function(_0x3f66f6){logger[_0xbc58('0x14')](_0xbc58('0xf'),_0x21fb97,_0x3f66f6);_0x5bb20a(_0x3f66f6);});});}exports[_0xbc58('0x1a')]=function(_0x129837){var _0x17d49c=this;return new Promise(function(_0x5b9168,_0x2938bf){return db[_0xbc58('0x1b')]['findAll']({'raw':_0x129837[_0xbc58('0x1c')]?_0x129837[_0xbc58('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x129837[_0xbc58('0x1c')]?_0x129837[_0xbc58('0x1c')][_0xbc58('0x1d')]||null:null,'attributes':_0x129837[_0xbc58('0x1c')]?_0x129837[_0xbc58('0x1c')][_0xbc58('0x1e')]||null:null,'limit':_0x129837[_0xbc58('0x1c')]?_0x129837['options'][_0xbc58('0x1f')]||null:null,'include':_0x129837[_0xbc58('0x1c')]?_0x129837[_0xbc58('0x1c')][_0xbc58('0x20')]?_[_0xbc58('0x21')](_0x129837[_0xbc58('0x1c')]['include'],function(_0xc2b195){return{'model':db[_0xc2b195['model']],'as':_0xc2b195['as'],'attributes':_0xc2b195[_0xbc58('0x1e')],'include':_0xc2b195[_0xbc58('0x20')]?_[_0xbc58('0x21')](_0xc2b195[_0xbc58('0x20')],function(_0x29c236){return{'model':db[_0x29c236['model']],'as':_0x29c236['as'],'attributes':_0x29c236[_0xbc58('0x1e')],'include':_0x29c236[_0xbc58('0x20')]?_[_0xbc58('0x21')](_0x29c236[_0xbc58('0x20')],function(_0x5c0a32){return{'model':db[_0x5c0a32[_0xbc58('0x22')]],'as':_0x5c0a32['as'],'attributes':_0x5c0a32[_0xbc58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc58('0x23')](function(_0x57547f){logger[_0xbc58('0x17')](_0xbc58('0x1a'),_0x129837);logger[_0xbc58('0x11')](_0xbc58('0x1a'),_0x129837,JSON['stringify'](_0x57547f));_0x5b9168(_0x57547f);})['catch'](function(_0x13a8d6){logger[_0xbc58('0x14')](_0xbc58('0x1a'),_0x13a8d6['message'],_0x129837);_0x2938bf(_0x17d49c[_0xbc58('0x14')](0x1f4,_0x13a8d6[_0xbc58('0x16')]));});});};exports['ShowWhatsappQueue']=function(_0x4815c9){var _0x465a07=this;return new Promise(function(_0x35fcb3,_0x2995db){return db['WhatsappQueue'][_0xbc58('0x24')]({'raw':_0x4815c9[_0xbc58('0x1c')]?_0x4815c9['options'][_0xbc58('0x25')]===undefined?!![]:![]:!![],'where':_0x4815c9['options']?_0x4815c9[_0xbc58('0x1c')]['where']||null:null,'attributes':_0x4815c9[_0xbc58('0x1c')]?_0x4815c9['options']['attributes']||null:null,'include':_0x4815c9['options']?_0x4815c9[_0xbc58('0x1c')]['include']?_[_0xbc58('0x21')](_0x4815c9[_0xbc58('0x1c')][_0xbc58('0x20')],function(_0x2b1796){return{'model':db[_0x2b1796[_0xbc58('0x22')]],'as':_0x2b1796['as'],'attributes':_0x2b1796['attributes'],'include':_0x2b1796[_0xbc58('0x20')]?_[_0xbc58('0x21')](_0x2b1796[_0xbc58('0x20')],function(_0x59ba4e){return{'model':db[_0x59ba4e[_0xbc58('0x22')]],'as':_0x59ba4e['as'],'attributes':_0x59ba4e['attributes'],'include':_0x59ba4e[_0xbc58('0x20')]?_[_0xbc58('0x21')](_0x59ba4e[_0xbc58('0x20')],function(_0x53e6a0){return{'model':db[_0x53e6a0[_0xbc58('0x22')]],'as':_0x53e6a0['as'],'attributes':_0x53e6a0[_0xbc58('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc58('0x23')](function(_0x3817d2){logger['info']('ShowWhatsappQueue',_0x4815c9);logger['debug']('ShowWhatsappQueue',_0x4815c9,JSON['stringify'](_0x3817d2));_0x35fcb3(_0x3817d2);})[_0xbc58('0x19')](function(_0x3a755e){logger[_0xbc58('0x14')](_0xbc58('0x26'),_0x3a755e[_0xbc58('0x16')],_0x4815c9);_0x2995db(_0x465a07[_0xbc58('0x14')](0x1f4,_0x3a755e[_0xbc58('0x16')]));});});};
\ No newline at end of file