92824dd911c6b2489d45153b1005f71ed51a14e3
[motion2.git] / server / api / whatsappTransferReport / whatsappTransferReport.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x24ce=['info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x46ecd0,_0x561fb4){var _0x508c0d=function(_0x52b1b6){while(--_0x52b1b6){_0x46ecd0['push'](_0x46ecd0['shift']());}};_0x508c0d(++_0x561fb4);}(_0x24ce,0x106));var _0xe24c=function(_0xe3b65e,_0x27e7e2){_0xe3b65e=_0xe3b65e-0x0;var _0x378b6b=_0x24ce[_0xe3b65e];return _0x378b6b;};'use strict';var _=require(_0xe24c('0x0'));var util=require(_0xe24c('0x1'));var moment=require(_0xe24c('0x2'));var BPromise=require(_0xe24c('0x3'));var rs=require(_0xe24c('0x4'));var fs=require('fs');var Redis=require(_0xe24c('0x5'));var db=require(_0xe24c('0x6'))['db'];var utils=require(_0xe24c('0x7'));var logger=require(_0xe24c('0x8'))(_0xe24c('0x9'));var config=require(_0xe24c('0xa'));var jayson=require(_0xe24c('0xb'));var client=jayson[_0xe24c('0xc')][_0xe24c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xd3ec6,_0x3a1591,_0x398172){return new BPromise(function(_0xc5448b,_0x22bc77){return client['request'](_0xd3ec6,_0x398172)['then'](function(_0x3f5b53){logger[_0xe24c('0xe')](_0xe24c('0xf'),_0x3a1591,_0xe24c('0x10'));logger[_0xe24c('0x11')](_0xe24c('0x12'),_0x3a1591,_0xe24c('0x10'),JSON[_0xe24c('0x13')](_0x3f5b53));if(_0x3f5b53[_0xe24c('0x14')]){if(_0x3f5b53[_0xe24c('0x14')]['code']===0x1f4){logger[_0xe24c('0x14')](_0xe24c('0xf'),_0x3a1591,_0x3f5b53[_0xe24c('0x14')][_0xe24c('0x15')]);return _0x22bc77(_0x3f5b53['error'][_0xe24c('0x15')]);}logger[_0xe24c('0x14')](_0xe24c('0xf'),_0x3a1591,_0x3f5b53[_0xe24c('0x14')]['message']);return _0xc5448b(_0x3f5b53[_0xe24c('0x14')][_0xe24c('0x15')]);}else{logger[_0xe24c('0xe')](_0xe24c('0xf'),_0x3a1591,_0xe24c('0x10'));_0xc5448b(_0x3f5b53['result'][_0xe24c('0x15')]);}})[_0xe24c('0x16')](function(_0x3def41){logger[_0xe24c('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3a1591,_0x3def41);_0x22bc77(_0x3def41);});});}