Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / whatsappQueueReport / whatsappQueueReport.rpc.js
index a4ee107..d54633b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1845=['update','body','attributes','limit','UpdateWhatsappQueueReport','stringify','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw'];(function(_0x197dab,_0x42d8da){var _0xa24a56=function(_0x210d3a){while(--_0x210d3a){_0x197dab['push'](_0x197dab['shift']());}};_0xa24a56(++_0x42d8da);}(_0x1845,0x128));var _0x5184=function(_0x18fbc7,_0x8d43a){_0x18fbc7=_0x18fbc7-0x0;var _0xca4d34=_0x1845[_0x18fbc7];return _0xca4d34;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5184('0x0'));var BPromise=require(_0x5184('0x1'));var rs=require(_0x5184('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5184('0x3'))['db'];var utils=require(_0x5184('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x5184('0x5'));var client=jayson[_0x5184('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeab124,_0x1f0949,_0x16330d){return new BPromise(function(_0x1a9f8d,_0x5b02bc){return client[_0x5184('0x7')](_0xeab124,_0x16330d)[_0x5184('0x8')](function(_0x52fe64){logger[_0x5184('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f0949,'request\x20sent');logger[_0x5184('0xa')](_0x5184('0xb'),_0x1f0949,_0x5184('0xc'),JSON['stringify'](_0x52fe64));if(_0x52fe64[_0x5184('0xd')]){if(_0x52fe64['error'][_0x5184('0xe')]===0x1f4){logger[_0x5184('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1f0949,_0x52fe64[_0x5184('0xd')][_0x5184('0xf')]);return _0x5b02bc(_0x52fe64['error'][_0x5184('0xf')]);}logger['error'](_0x5184('0x10'),_0x1f0949,_0x52fe64[_0x5184('0xd')][_0x5184('0xf')]);return _0x1a9f8d(_0x52fe64[_0x5184('0xd')][_0x5184('0xf')]);}else{logger[_0x5184('0x9')](_0x5184('0x10'),_0x1f0949,'request\x20sent');_0x1a9f8d(_0x52fe64['result'][_0x5184('0xf')]);}})[_0x5184('0x11')](function(_0x2cb42b){logger[_0x5184('0xd')](_0x5184('0x10'),_0x1f0949,_0x2cb42b);_0x5b02bc(_0x2cb42b);});});}exports[_0x5184('0x12')]=function(_0xcfe0c1){var _0x1c279a=this;return new Promise(function(_0x1c1b97,_0x3b5a3d){return db[_0x5184('0x13')][_0x5184('0x14')](_0xcfe0c1['body'],{'raw':_0xcfe0c1[_0x5184('0x15')]?_0xcfe0c1['options'][_0x5184('0x16')]===undefined?!![]:![]:!![]})[_0x5184('0x8')](function(_0x52c94a){logger[_0x5184('0x9')](_0x5184('0x12'),_0xcfe0c1);logger['debug'](_0x5184('0x12'),_0xcfe0c1,JSON['stringify'](_0x52c94a));_0x1c1b97(_0x52c94a);})[_0x5184('0x11')](function(_0x4f3bd2){logger[_0x5184('0xd')](_0x5184('0x12'),_0x4f3bd2['message'],_0xcfe0c1);_0x3b5a3d(_0x1c279a['error'](0x1f4,_0x4f3bd2[_0x5184('0xf')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x1fb6e7){var _0x33afee=this;return new Promise(function(_0x4f46c6,_0x2f1823){return db[_0x5184('0x13')][_0x5184('0x17')](_0x1fb6e7[_0x5184('0x18')],{'raw':_0x1fb6e7[_0x5184('0x15')]?_0x1fb6e7['options'][_0x5184('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fb6e7[_0x5184('0x15')]?_0x1fb6e7[_0x5184('0x15')]['where']||null:null,'attributes':_0x1fb6e7['options']?_0x1fb6e7[_0x5184('0x15')][_0x5184('0x19')]||null:null,'limit':_0x1fb6e7[_0x5184('0x15')]?_0x1fb6e7[_0x5184('0x15')][_0x5184('0x1a')]||null:null})[_0x5184('0x8')](function(_0x56c097){logger['info'](_0x5184('0x1b'),_0x1fb6e7);logger[_0x5184('0xa')](_0x5184('0x1b'),_0x1fb6e7,JSON[_0x5184('0x1c')](_0x56c097));_0x4f46c6(_0x56c097);})[_0x5184('0x11')](function(_0x14bd4a){logger[_0x5184('0xd')](_0x5184('0x1b'),_0x14bd4a[_0x5184('0xf')],_0x1fb6e7);_0x2f1823(_0x33afee[_0x5184('0xd')](0x1f4,_0x14bd4a['message']));});});};
\ No newline at end of file
+var _0xb151=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','util','moment'];(function(_0x24ecc9,_0x4b14b6){var _0x341dc9=function(_0x42a854){while(--_0x42a854){_0x24ecc9['push'](_0x24ecc9['shift']());}};_0x341dc9(++_0x4b14b6);}(_0xb151,0x1a1));var _0x1b15=function(_0x4e8891,_0x4667f9){_0x4e8891=_0x4e8891-0x0;var _0x448828=_0xb151[_0x4e8891];return _0x448828;};'use strict';var _=require(_0x1b15('0x0'));var util=require(_0x1b15('0x1'));var moment=require(_0x1b15('0x2'));var BPromise=require(_0x1b15('0x3'));var rs=require(_0x1b15('0x4'));var fs=require('fs');var Redis=require(_0x1b15('0x5'));var db=require(_0x1b15('0x6'))['db'];var utils=require(_0x1b15('0x7'));var logger=require(_0x1b15('0x8'))(_0x1b15('0x9'));var config=require(_0x1b15('0xa'));var jayson=require(_0x1b15('0xb'));var client=jayson['client'][_0x1b15('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x287e21,_0x547188,_0x1ab797){return new BPromise(function(_0x17452d,_0x32dc6f){return client['request'](_0x287e21,_0x1ab797)[_0x1b15('0xd')](function(_0x48b2b9){logger[_0x1b15('0xe')](_0x1b15('0xf'),_0x547188,'request\x20sent');logger[_0x1b15('0x10')](_0x1b15('0x11'),_0x547188,_0x1b15('0x12'),JSON[_0x1b15('0x13')](_0x48b2b9));if(_0x48b2b9[_0x1b15('0x14')]){if(_0x48b2b9[_0x1b15('0x14')]['code']===0x1f4){logger[_0x1b15('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x547188,_0x48b2b9[_0x1b15('0x14')][_0x1b15('0x15')]);return _0x32dc6f(_0x48b2b9[_0x1b15('0x14')][_0x1b15('0x15')]);}logger[_0x1b15('0x14')](_0x1b15('0xf'),_0x547188,_0x48b2b9['error'][_0x1b15('0x15')]);return _0x17452d(_0x48b2b9['error'][_0x1b15('0x15')]);}else{logger['info'](_0x1b15('0xf'),_0x547188,_0x1b15('0x12'));_0x17452d(_0x48b2b9[_0x1b15('0x16')][_0x1b15('0x15')]);}})[_0x1b15('0x17')](function(_0x3ae034){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x547188,_0x3ae034);_0x32dc6f(_0x3ae034);});});}exports[_0x1b15('0x18')]=function(_0x2ac63b){var _0x119832=this;return new Promise(function(_0x5cdacc,_0xda87a1){return db['WhatsappQueueReport'][_0x1b15('0x19')](_0x2ac63b[_0x1b15('0x1a')],{'raw':_0x2ac63b[_0x1b15('0x1b')]?_0x2ac63b[_0x1b15('0x1b')][_0x1b15('0x1c')]===undefined?!![]:![]:!![]})[_0x1b15('0xd')](function(_0x4cdfaa){logger['info']('CreateWhatsappQueueReport',_0x2ac63b);logger[_0x1b15('0x10')](_0x1b15('0x18'),_0x2ac63b,JSON[_0x1b15('0x13')](_0x4cdfaa));_0x5cdacc(_0x4cdfaa);})[_0x1b15('0x17')](function(_0x2c92c4){logger[_0x1b15('0x14')]('CreateWhatsappQueueReport',_0x2c92c4[_0x1b15('0x15')],_0x2ac63b);_0xda87a1(_0x119832[_0x1b15('0x14')](0x1f4,_0x2c92c4[_0x1b15('0x15')]));});});};exports[_0x1b15('0x1d')]=function(_0x2510f8){var _0x202fcd=this;return new Promise(function(_0x377ed3,_0x2b8b31){return db[_0x1b15('0x1e')][_0x1b15('0x1f')](_0x2510f8[_0x1b15('0x1a')],{'raw':_0x2510f8['options']?_0x2510f8[_0x1b15('0x1b')][_0x1b15('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2510f8[_0x1b15('0x1b')]?_0x2510f8['options'][_0x1b15('0x20')]||null:null,'attributes':_0x2510f8[_0x1b15('0x1b')]?_0x2510f8['options'][_0x1b15('0x21')]||null:null,'limit':_0x2510f8[_0x1b15('0x1b')]?_0x2510f8[_0x1b15('0x1b')][_0x1b15('0x22')]||null:null})[_0x1b15('0xd')](function(_0x5a3543){logger[_0x1b15('0xe')](_0x1b15('0x1d'),_0x2510f8);logger[_0x1b15('0x10')](_0x1b15('0x1d'),_0x2510f8,JSON[_0x1b15('0x13')](_0x5a3543));_0x377ed3(_0x5a3543);})[_0x1b15('0x17')](function(_0x3e0c2d){logger['error'](_0x1b15('0x1d'),_0x3e0c2d[_0x1b15('0x15')],_0x2510f8);_0x2b8b31(_0x202fcd['error'](0x1f4,_0x3e0c2d['message']));});});};
\ No newline at end of file