Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / whatsappQueueReport / whatsappQueueReport.rpc.js
index d71a151..bae4def 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc9=['../../config/logger','rpc','../../config/environment','jayson/promise','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','attributes','limit','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7cc9,0x16d));var _0x97cc=function(_0x21aa5b,_0x2c808f){_0x21aa5b=_0x21aa5b-0x0;var _0x2ca4c8=_0x7cc9[_0x21aa5b];return _0x2ca4c8;};'use strict';var _=require(_0x97cc('0x0'));var util=require('util');var moment=require(_0x97cc('0x1'));var BPromise=require(_0x97cc('0x2'));var rs=require(_0x97cc('0x3'));var fs=require('fs');var Redis=require(_0x97cc('0x4'));var db=require(_0x97cc('0x5'))['db'];var utils=require(_0x97cc('0x6'));var logger=require(_0x97cc('0x7'))(_0x97cc('0x8'));var config=require(_0x97cc('0x9'));var jayson=require(_0x97cc('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1796de,_0xf17ed2,_0x3f1d94){return new BPromise(function(_0x454a8a,_0x24dec2){return client['request'](_0x1796de,_0x3f1d94)[_0x97cc('0xb')](function(_0x3eefd9){logger[_0x97cc('0xc')](_0x97cc('0xd'),_0xf17ed2,_0x97cc('0xe'));logger[_0x97cc('0xf')](_0x97cc('0x10'),_0xf17ed2,_0x97cc('0xe'),JSON[_0x97cc('0x11')](_0x3eefd9));if(_0x3eefd9[_0x97cc('0x12')]){if(_0x3eefd9[_0x97cc('0x12')]['code']===0x1f4){logger['error'](_0x97cc('0xd'),_0xf17ed2,_0x3eefd9[_0x97cc('0x12')][_0x97cc('0x13')]);return _0x24dec2(_0x3eefd9[_0x97cc('0x12')][_0x97cc('0x13')]);}logger['error'](_0x97cc('0xd'),_0xf17ed2,_0x3eefd9[_0x97cc('0x12')][_0x97cc('0x13')]);return _0x454a8a(_0x3eefd9['error'][_0x97cc('0x13')]);}else{logger['info'](_0x97cc('0xd'),_0xf17ed2,_0x97cc('0xe'));_0x454a8a(_0x3eefd9[_0x97cc('0x14')][_0x97cc('0x13')]);}})['catch'](function(_0x4f8526){logger[_0x97cc('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0xf17ed2,_0x4f8526);_0x24dec2(_0x4f8526);});});}exports[_0x97cc('0x15')]=function(_0x390b71){var _0x5cca65=this;return new Promise(function(_0x38fdf5,_0x3985c2){return db[_0x97cc('0x16')][_0x97cc('0x17')](_0x390b71[_0x97cc('0x18')],{'raw':_0x390b71[_0x97cc('0x19')]?_0x390b71[_0x97cc('0x19')][_0x97cc('0x1a')]===undefined?!![]:![]:!![]})[_0x97cc('0xb')](function(_0x225b48){logger[_0x97cc('0xc')](_0x97cc('0x15'),_0x390b71);logger[_0x97cc('0xf')]('CreateWhatsappQueueReport',_0x390b71,JSON[_0x97cc('0x11')](_0x225b48));_0x38fdf5(_0x225b48);})['catch'](function(_0x23ab4a){logger[_0x97cc('0x12')](_0x97cc('0x15'),_0x23ab4a[_0x97cc('0x13')],_0x390b71);_0x3985c2(_0x5cca65[_0x97cc('0x12')](0x1f4,_0x23ab4a[_0x97cc('0x13')]));});});};exports[_0x97cc('0x1b')]=function(_0x1e4496){var _0x33c932=this;return new Promise(function(_0x2ba4fa,_0xac2f4a){return db[_0x97cc('0x16')]['update'](_0x1e4496[_0x97cc('0x18')],{'raw':_0x1e4496[_0x97cc('0x19')]?_0x1e4496[_0x97cc('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e4496[_0x97cc('0x19')]?_0x1e4496[_0x97cc('0x19')]['where']||null:null,'attributes':_0x1e4496[_0x97cc('0x19')]?_0x1e4496[_0x97cc('0x19')][_0x97cc('0x1c')]||null:null,'limit':_0x1e4496[_0x97cc('0x19')]?_0x1e4496['options'][_0x97cc('0x1d')]||null:null})[_0x97cc('0xb')](function(_0xdc394c){logger['info'](_0x97cc('0x1b'),_0x1e4496);logger['debug']('UpdateWhatsappQueueReport',_0x1e4496,JSON[_0x97cc('0x11')](_0xdc394c));_0x2ba4fa(_0xdc394c);})[_0x97cc('0x1e')](function(_0x31c941){logger[_0x97cc('0x12')](_0x97cc('0x1b'),_0x31c941[_0x97cc('0x13')],_0x1e4496);_0xac2f4a(_0x33c932[_0x97cc('0x12')](0x1f4,_0x31c941[_0x97cc('0x13')]));});});};
\ No newline at end of file
+var _0x3a9e=['where','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','body','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','options','raw'];(function(_0x1dbf16,_0x9f799d){var _0x34307d=function(_0xcc8495){while(--_0xcc8495){_0x1dbf16['push'](_0x1dbf16['shift']());}};_0x34307d(++_0x9f799d);}(_0x3a9e,0x162));var _0xe3a9=function(_0x153844,_0x37a9b9){_0x153844=_0x153844-0x0;var _0x4207d0=_0x3a9e[_0x153844];return _0x4207d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe3a9('0x0'));var BPromise=require(_0xe3a9('0x1'));var rs=require(_0xe3a9('0x2'));var fs=require('fs');var Redis=require(_0xe3a9('0x3'));var db=require(_0xe3a9('0x4'))['db'];var utils=require(_0xe3a9('0x5'));var logger=require(_0xe3a9('0x6'))(_0xe3a9('0x7'));var config=require('../../config/environment');var jayson=require(_0xe3a9('0x8'));var client=jayson[_0xe3a9('0x9')][_0xe3a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb118,_0xe40436,_0x22c9ae){return new BPromise(function(_0x31ad40,_0x2e48ac){return client[_0xe3a9('0xb')](_0x2bb118,_0x22c9ae)[_0xe3a9('0xc')](function(_0x1fef77){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0xe40436,_0xe3a9('0xd'));logger[_0xe3a9('0xe')](_0xe3a9('0xf'),_0xe40436,_0xe3a9('0xd'),JSON[_0xe3a9('0x10')](_0x1fef77));if(_0x1fef77['error']){if(_0x1fef77[_0xe3a9('0x11')][_0xe3a9('0x12')]===0x1f4){logger[_0xe3a9('0x11')](_0xe3a9('0x13'),_0xe40436,_0x1fef77['error'][_0xe3a9('0x14')]);return _0x2e48ac(_0x1fef77[_0xe3a9('0x11')][_0xe3a9('0x14')]);}logger[_0xe3a9('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0xe40436,_0x1fef77[_0xe3a9('0x11')][_0xe3a9('0x14')]);return _0x31ad40(_0x1fef77[_0xe3a9('0x11')]['message']);}else{logger[_0xe3a9('0x15')]('WhatsappQueueReport,\x20%s,\x20%s',_0xe40436,_0xe3a9('0xd'));_0x31ad40(_0x1fef77[_0xe3a9('0x16')][_0xe3a9('0x14')]);}})[_0xe3a9('0x17')](function(_0x743956){logger['error'](_0xe3a9('0x13'),_0xe40436,_0x743956);_0x2e48ac(_0x743956);});});}exports['CreateWhatsappQueueReport']=function(_0x12722b){var _0x541b6e=this;return new Promise(function(_0x4eac84,_0x2be4ac){return db['WhatsappQueueReport']['create'](_0x12722b[_0xe3a9('0x18')],{'raw':_0x12722b['options']?_0x12722b['options']['raw']===undefined?!![]:![]:!![]})[_0xe3a9('0xc')](function(_0x53557c){logger['info'](_0xe3a9('0x19'),_0x12722b);logger[_0xe3a9('0xe')](_0xe3a9('0x19'),_0x12722b,JSON['stringify'](_0x53557c));_0x4eac84(_0x53557c);})['catch'](function(_0x517d4e){logger[_0xe3a9('0x11')](_0xe3a9('0x19'),_0x517d4e[_0xe3a9('0x14')],_0x12722b);_0x2be4ac(_0x541b6e[_0xe3a9('0x11')](0x1f4,_0x517d4e[_0xe3a9('0x14')]));});});};exports[_0xe3a9('0x1a')]=function(_0x32f7c4){var _0x4e0790=this;return new Promise(function(_0x56d0bc,_0x103511){return db['WhatsappQueueReport'][_0xe3a9('0x1b')](_0x32f7c4['body'],{'raw':_0x32f7c4['options']?_0x32f7c4[_0xe3a9('0x1c')][_0xe3a9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32f7c4['options']?_0x32f7c4[_0xe3a9('0x1c')][_0xe3a9('0x1e')]||null:null,'attributes':_0x32f7c4[_0xe3a9('0x1c')]?_0x32f7c4[_0xe3a9('0x1c')]['attributes']||null:null,'limit':_0x32f7c4[_0xe3a9('0x1c')]?_0x32f7c4[_0xe3a9('0x1c')][_0xe3a9('0x1f')]||null:null})['then'](function(_0x49295b){logger[_0xe3a9('0x15')](_0xe3a9('0x1a'),_0x32f7c4);logger[_0xe3a9('0xe')](_0xe3a9('0x1a'),_0x32f7c4,JSON['stringify'](_0x49295b));_0x56d0bc(_0x49295b);})[_0xe3a9('0x17')](function(_0x10d4d3){logger['error']('UpdateWhatsappQueueReport',_0x10d4d3[_0xe3a9('0x14')],_0x32f7c4);_0x103511(_0x4e0790[_0xe3a9('0x11')](0x1f4,_0x10d4d3['message']));});});};
\ No newline at end of file