Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / whatsappQueueReport / whatsappQueueReport.rpc.js
index 4537cfc..35b7681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d3d=['debug','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','CreateWhatsappQueueReport','create','body','options','raw','catch','WhatsappQueueReport','update','attributes','UpdateWhatsappQueueReport','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x34c698,_0x3cf869){var _0x16d626=function(_0x16fab4){while(--_0x16fab4){_0x34c698['push'](_0x34c698['shift']());}};_0x16d626(++_0x3cf869);}(_0x1d3d,0x1e0));var _0xd1d3=function(_0x1be7b2,_0x24f048){_0x1be7b2=_0x1be7b2-0x0;var _0x5b8faa=_0x1d3d[_0x1be7b2];return _0x5b8faa;};'use strict';var _=require('lodash');var util=require(_0xd1d3('0x0'));var moment=require(_0xd1d3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1d3('0x2'));var db=require(_0xd1d3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xd1d3('0x4'))('rpc');var config=require(_0xd1d3('0x5'));var jayson=require(_0xd1d3('0x6'));var client=jayson[_0xd1d3('0x7')][_0xd1d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4aef63,_0x1286c6,_0x31434a){return new BPromise(function(_0x48200e,_0x38612c){return client[_0xd1d3('0x9')](_0x4aef63,_0x31434a)[_0xd1d3('0xa')](function(_0x593fd7){logger[_0xd1d3('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1286c6,_0xd1d3('0xc'));logger[_0xd1d3('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x1286c6,_0xd1d3('0xc'),JSON[_0xd1d3('0xe')](_0x593fd7));if(_0x593fd7[_0xd1d3('0xf')]){if(_0x593fd7['error']['code']===0x1f4){logger[_0xd1d3('0xf')](_0xd1d3('0x10'),_0x1286c6,_0x593fd7['error']['message']);return _0x38612c(_0x593fd7[_0xd1d3('0xf')][_0xd1d3('0x11')]);}logger[_0xd1d3('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x1286c6,_0x593fd7['error'][_0xd1d3('0x11')]);return _0x48200e(_0x593fd7[_0xd1d3('0xf')][_0xd1d3('0x11')]);}else{logger[_0xd1d3('0xb')](_0xd1d3('0x10'),_0x1286c6,_0xd1d3('0xc'));_0x48200e(_0x593fd7[_0xd1d3('0x12')]['message']);}})['catch'](function(_0x568711){logger[_0xd1d3('0xf')](_0xd1d3('0x10'),_0x1286c6,_0x568711);_0x38612c(_0x568711);});});}exports[_0xd1d3('0x13')]=function(_0x10ce0b){var _0x10835c=this;return new Promise(function(_0xdae96f,_0x4c29e4){return db['WhatsappQueueReport'][_0xd1d3('0x14')](_0x10ce0b[_0xd1d3('0x15')],{'raw':_0x10ce0b[_0xd1d3('0x16')]?_0x10ce0b[_0xd1d3('0x16')][_0xd1d3('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x13fee0){logger['info'](_0xd1d3('0x13'),_0x10ce0b);logger['debug'](_0xd1d3('0x13'),_0x10ce0b,JSON[_0xd1d3('0xe')](_0x13fee0));_0xdae96f(_0x13fee0);})[_0xd1d3('0x18')](function(_0x10f74d){logger[_0xd1d3('0xf')](_0xd1d3('0x13'),_0x10f74d['message'],_0x10ce0b);_0x4c29e4(_0x10835c[_0xd1d3('0xf')](0x1f4,_0x10f74d['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x5c678d){var _0x1fc7de=this;return new Promise(function(_0x3e440a,_0x1532b9){return db[_0xd1d3('0x19')][_0xd1d3('0x1a')](_0x5c678d[_0xd1d3('0x15')],{'raw':_0x5c678d[_0xd1d3('0x16')]?_0x5c678d[_0xd1d3('0x16')][_0xd1d3('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c678d[_0xd1d3('0x16')]?_0x5c678d['options']['where']||null:null,'attributes':_0x5c678d[_0xd1d3('0x16')]?_0x5c678d[_0xd1d3('0x16')][_0xd1d3('0x1b')]||null:null,'limit':_0x5c678d[_0xd1d3('0x16')]?_0x5c678d[_0xd1d3('0x16')]['limit']||null:null})['then'](function(_0x16e83b){logger['info'](_0xd1d3('0x1c'),_0x5c678d);logger['debug']('UpdateWhatsappQueueReport',_0x5c678d,JSON['stringify'](_0x16e83b));_0x3e440a(_0x16e83b);})[_0xd1d3('0x18')](function(_0x259a24){logger[_0xd1d3('0xf')]('UpdateWhatsappQueueReport',_0x259a24[_0xd1d3('0x11')],_0x5c678d);_0x1532b9(_0x1fc7de[_0xd1d3('0xf')](0x1f4,_0x259a24[_0xd1d3('0x11')]));});});};
\ No newline at end of file
+var _0x902c=['jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','UpdateWhatsappQueueReport','update','attributes','limit','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x902c,0x155));var _0xc902=function(_0x1de06b,_0x7fa1c4){_0x1de06b=_0x1de06b-0x0;var _0x578041=_0x902c[_0x1de06b];return _0x578041;};'use strict';var _=require(_0xc902('0x0'));var util=require('util');var moment=require(_0xc902('0x1'));var BPromise=require('bluebird');var rs=require(_0xc902('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc902('0x3'))['db'];var utils=require(_0xc902('0x4'));var logger=require('../../config/logger')(_0xc902('0x5'));var config=require(_0xc902('0x6'));var jayson=require(_0xc902('0x7'));var client=jayson[_0xc902('0x8')][_0xc902('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35ae20,_0x46ea55,_0x191277){return new BPromise(function(_0x1fcf91,_0x527506){return client[_0xc902('0xa')](_0x35ae20,_0x191277)[_0xc902('0xb')](function(_0x38dc49){logger['info'](_0xc902('0xc'),_0x46ea55,_0xc902('0xd'));logger[_0xc902('0xe')](_0xc902('0xf'),_0x46ea55,_0xc902('0xd'),JSON[_0xc902('0x10')](_0x38dc49));if(_0x38dc49[_0xc902('0x11')]){if(_0x38dc49[_0xc902('0x11')]['code']===0x1f4){logger[_0xc902('0x11')](_0xc902('0xc'),_0x46ea55,_0x38dc49[_0xc902('0x11')][_0xc902('0x12')]);return _0x527506(_0x38dc49[_0xc902('0x11')][_0xc902('0x12')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x46ea55,_0x38dc49['error'][_0xc902('0x12')]);return _0x1fcf91(_0x38dc49[_0xc902('0x11')][_0xc902('0x12')]);}else{logger[_0xc902('0x13')](_0xc902('0xc'),_0x46ea55,'request\x20sent');_0x1fcf91(_0x38dc49['result']['message']);}})['catch'](function(_0x1c2871){logger[_0xc902('0x11')](_0xc902('0xc'),_0x46ea55,_0x1c2871);_0x527506(_0x1c2871);});});}exports[_0xc902('0x14')]=function(_0x2ca99f){var _0x3f7193=this;return new Promise(function(_0x154c82,_0x4e82ef){return db[_0xc902('0x15')]['create'](_0x2ca99f[_0xc902('0x16')],{'raw':_0x2ca99f[_0xc902('0x17')]?_0x2ca99f['options'][_0xc902('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5c4e01){logger['info'](_0xc902('0x14'),_0x2ca99f);logger['debug'](_0xc902('0x14'),_0x2ca99f,JSON[_0xc902('0x10')](_0x5c4e01));_0x154c82(_0x5c4e01);})['catch'](function(_0x2b1b85){logger[_0xc902('0x11')](_0xc902('0x14'),_0x2b1b85['message'],_0x2ca99f);_0x4e82ef(_0x3f7193['error'](0x1f4,_0x2b1b85[_0xc902('0x12')]));});});};exports[_0xc902('0x19')]=function(_0x1ca9b8){var _0x2eb945=this;return new Promise(function(_0x44344d,_0x1644c6){return db[_0xc902('0x15')][_0xc902('0x1a')](_0x1ca9b8[_0xc902('0x16')],{'raw':_0x1ca9b8[_0xc902('0x17')]?_0x1ca9b8[_0xc902('0x17')][_0xc902('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ca9b8[_0xc902('0x17')]?_0x1ca9b8[_0xc902('0x17')]['where']||null:null,'attributes':_0x1ca9b8[_0xc902('0x17')]?_0x1ca9b8[_0xc902('0x17')][_0xc902('0x1b')]||null:null,'limit':_0x1ca9b8[_0xc902('0x17')]?_0x1ca9b8[_0xc902('0x17')][_0xc902('0x1c')]||null:null})[_0xc902('0xb')](function(_0x704540){logger[_0xc902('0x13')](_0xc902('0x19'),_0x1ca9b8);logger[_0xc902('0xe')](_0xc902('0x19'),_0x1ca9b8,JSON[_0xc902('0x10')](_0x704540));_0x44344d(_0x704540);})['catch'](function(_0x12a5b7){logger['error'](_0xc902('0x19'),_0x12a5b7['message'],_0x1ca9b8);_0x1644c6(_0x2eb945[_0xc902('0x11')](0x1f4,_0x12a5b7[_0xc902('0x12')]));});});};
\ No newline at end of file