Built motion from commit 9b156c94.|2.6.22
[motion2.git] / server / api / whatsappQueueReport / whatsappQueueReport.rpc.js
index 71a85a9..78f7fdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b56=['info','result','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','catch','UpdateWhatsappQueueReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5b0725,_0x22c731){var _0x294fba=function(_0x5ca509){while(--_0x5ca509){_0x5b0725['push'](_0x5b0725['shift']());}};_0x294fba(++_0x22c731);}(_0x9b56,0x14c));var _0x69b5=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x9b56[_0x5cb97e];return _0x1714b4;};'use strict';var _=require(_0x69b5('0x0'));var util=require(_0x69b5('0x1'));var moment=require(_0x69b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x69b5('0x3'));var db=require(_0x69b5('0x4'))['db'];var utils=require(_0x69b5('0x5'));var logger=require(_0x69b5('0x6'))(_0x69b5('0x7'));var config=require(_0x69b5('0x8'));var jayson=require(_0x69b5('0x9'));var client=jayson['client'][_0x69b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e012a,_0x5f5a25,_0x135ac7){return new BPromise(function(_0x406237,_0x3eaf4f){return client[_0x69b5('0xb')](_0x4e012a,_0x135ac7)[_0x69b5('0xc')](function(_0x3fb47d){logger['info'](_0x69b5('0xd'),_0x5f5a25,_0x69b5('0xe'));logger[_0x69b5('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5f5a25,_0x69b5('0xe'),JSON[_0x69b5('0x10')](_0x3fb47d));if(_0x3fb47d[_0x69b5('0x11')]){if(_0x3fb47d['error'][_0x69b5('0x12')]===0x1f4){logger[_0x69b5('0x11')](_0x69b5('0xd'),_0x5f5a25,_0x3fb47d['error']['message']);return _0x3eaf4f(_0x3fb47d['error'][_0x69b5('0x13')]);}logger[_0x69b5('0x11')](_0x69b5('0xd'),_0x5f5a25,_0x3fb47d[_0x69b5('0x11')][_0x69b5('0x13')]);return _0x406237(_0x3fb47d['error']['message']);}else{logger[_0x69b5('0x14')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5f5a25,_0x69b5('0xe'));_0x406237(_0x3fb47d[_0x69b5('0x15')][_0x69b5('0x13')]);}})['catch'](function(_0x4c9984){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x5f5a25,_0x4c9984);_0x3eaf4f(_0x4c9984);});});}exports['CreateWhatsappQueueReport']=function(_0x51bf39){var _0x3e53af=this;return new Promise(function(_0x1aab0f,_0x4954fb){return db[_0x69b5('0x16')]['create'](_0x51bf39[_0x69b5('0x17')],{'raw':_0x51bf39[_0x69b5('0x18')]?_0x51bf39[_0x69b5('0x18')][_0x69b5('0x19')]===undefined?!![]:![]:!![]})[_0x69b5('0xc')](function(_0x3327a1){logger[_0x69b5('0x14')]('CreateWhatsappQueueReport',_0x51bf39);logger[_0x69b5('0xf')](_0x69b5('0x1a'),_0x51bf39,JSON[_0x69b5('0x10')](_0x3327a1));_0x1aab0f(_0x3327a1);})[_0x69b5('0x1b')](function(_0x4c3c37){logger['error'](_0x69b5('0x1a'),_0x4c3c37[_0x69b5('0x13')],_0x51bf39);_0x4954fb(_0x3e53af[_0x69b5('0x11')](0x1f4,_0x4c3c37[_0x69b5('0x13')]));});});};exports[_0x69b5('0x1c')]=function(_0x4a8667){var _0x5b953e=this;return new Promise(function(_0x203502,_0x4734ce){return db['WhatsappQueueReport'][_0x69b5('0x1d')](_0x4a8667[_0x69b5('0x17')],{'raw':_0x4a8667[_0x69b5('0x18')]?_0x4a8667['options'][_0x69b5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a8667['options']?_0x4a8667[_0x69b5('0x18')][_0x69b5('0x1e')]||null:null,'attributes':_0x4a8667[_0x69b5('0x18')]?_0x4a8667[_0x69b5('0x18')][_0x69b5('0x1f')]||null:null,'limit':_0x4a8667[_0x69b5('0x18')]?_0x4a8667['options']['limit']||null:null})[_0x69b5('0xc')](function(_0x18b102){logger['info'](_0x69b5('0x1c'),_0x4a8667);logger['debug'](_0x69b5('0x1c'),_0x4a8667,JSON[_0x69b5('0x10')](_0x18b102));_0x203502(_0x18b102);})['catch'](function(_0x4a98f0){logger['error']('UpdateWhatsappQueueReport',_0x4a98f0[_0x69b5('0x13')],_0x4a8667);_0x4734ce(_0x5b953e[_0x69b5('0x11')](0x1f4,_0x4a98f0[_0x69b5('0x13')]));});});};
\ No newline at end of file
+var _0xbde4=['create','body','options','raw','update','where','attributes','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport'];(function(_0x4e0006,_0x304b22){var _0x2883e1=function(_0x5062cd){while(--_0x5062cd){_0x4e0006['push'](_0x4e0006['shift']());}};_0x2883e1(++_0x304b22);}(_0xbde4,0xa8));var _0x4bde=function(_0x51a0ac,_0x225b12){_0x51a0ac=_0x51a0ac-0x0;var _0x1459a8=_0xbde4[_0x51a0ac];return _0x1459a8;};'use strict';var _=require(_0x4bde('0x0'));var util=require('util');var moment=require(_0x4bde('0x1'));var BPromise=require(_0x4bde('0x2'));var rs=require(_0x4bde('0x3'));var fs=require('fs');var Redis=require(_0x4bde('0x4'));var db=require(_0x4bde('0x5'))['db'];var utils=require(_0x4bde('0x6'));var logger=require(_0x4bde('0x7'))(_0x4bde('0x8'));var config=require('../../config/environment');var jayson=require(_0x4bde('0x9'));var client=jayson[_0x4bde('0xa')][_0x4bde('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16d036,_0x3e8bf4,_0x8cbf36){return new BPromise(function(_0x35f477,_0x1bab98){return client['request'](_0x16d036,_0x8cbf36)[_0x4bde('0xc')](function(_0x223b55){logger[_0x4bde('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3e8bf4,_0x4bde('0xe'));logger[_0x4bde('0xf')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x3e8bf4,_0x4bde('0xe'),JSON[_0x4bde('0x10')](_0x223b55));if(_0x223b55[_0x4bde('0x11')]){if(_0x223b55[_0x4bde('0x11')][_0x4bde('0x12')]===0x1f4){logger[_0x4bde('0x11')](_0x4bde('0x13'),_0x3e8bf4,_0x223b55[_0x4bde('0x11')][_0x4bde('0x14')]);return _0x1bab98(_0x223b55[_0x4bde('0x11')]['message']);}logger[_0x4bde('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3e8bf4,_0x223b55[_0x4bde('0x11')][_0x4bde('0x14')]);return _0x35f477(_0x223b55[_0x4bde('0x11')][_0x4bde('0x14')]);}else{logger[_0x4bde('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3e8bf4,_0x4bde('0xe'));_0x35f477(_0x223b55['result'][_0x4bde('0x14')]);}})[_0x4bde('0x15')](function(_0x48258d){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x3e8bf4,_0x48258d);_0x1bab98(_0x48258d);});});}exports[_0x4bde('0x16')]=function(_0x238474){var _0x486957=this;return new Promise(function(_0x3a5acc,_0x3c5efe){return db[_0x4bde('0x17')][_0x4bde('0x18')](_0x238474[_0x4bde('0x19')],{'raw':_0x238474['options']?_0x238474[_0x4bde('0x1a')][_0x4bde('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x519bec){logger[_0x4bde('0xd')](_0x4bde('0x16'),_0x238474);logger[_0x4bde('0xf')](_0x4bde('0x16'),_0x238474,JSON['stringify'](_0x519bec));_0x3a5acc(_0x519bec);})[_0x4bde('0x15')](function(_0x16e00e){logger['error'](_0x4bde('0x16'),_0x16e00e[_0x4bde('0x14')],_0x238474);_0x3c5efe(_0x486957[_0x4bde('0x11')](0x1f4,_0x16e00e['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x168f45){var _0x9e4eb3=this;return new Promise(function(_0x49179e,_0x48579b){return db['WhatsappQueueReport'][_0x4bde('0x1c')](_0x168f45['body'],{'raw':_0x168f45[_0x4bde('0x1a')]?_0x168f45['options'][_0x4bde('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x168f45[_0x4bde('0x1a')]?_0x168f45[_0x4bde('0x1a')][_0x4bde('0x1d')]||null:null,'attributes':_0x168f45['options']?_0x168f45[_0x4bde('0x1a')][_0x4bde('0x1e')]||null:null,'limit':_0x168f45[_0x4bde('0x1a')]?_0x168f45['options']['limit']||null:null})['then'](function(_0x45bb62){logger[_0x4bde('0xd')](_0x4bde('0x1f'),_0x168f45);logger[_0x4bde('0xf')](_0x4bde('0x1f'),_0x168f45,JSON[_0x4bde('0x10')](_0x45bb62));_0x49179e(_0x45bb62);})['catch'](function(_0x3740ac){logger[_0x4bde('0x11')](_0x4bde('0x1f'),_0x3740ac[_0x4bde('0x14')],_0x168f45);_0x48579b(_0x9e4eb3['error'](0x1f4,_0x3740ac[_0x4bde('0x14')]));});});};
\ No newline at end of file