49a8f8152e1cb8e6b3572141a5462a1e46aa0fea
[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 _0xcf1b=['http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x14d9ce,_0x3a42ab){var _0x3b959a=function(_0x583e34){while(--_0x583e34){_0x14d9ce['push'](_0x14d9ce['shift']());}};_0x3b959a(++_0x3a42ab);}(_0xcf1b,0x1c5));var _0xbcf1=function(_0xcdbd77,_0x3dbdb8){_0xcdbd77=_0xcdbd77-0x0;var _0x26c039=_0xcf1b[_0xcdbd77];return _0x26c039;};'use strict';var _=require('lodash');var util=require(_0xbcf1('0x0'));var moment=require('moment');var BPromise=require(_0xbcf1('0x1'));var rs=require(_0xbcf1('0x2'));var fs=require('fs');var Redis=require(_0xbcf1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbcf1('0x4'));var logger=require(_0xbcf1('0x5'))('rpc');var config=require(_0xbcf1('0x6'));var jayson=require(_0xbcf1('0x7'));var client=jayson[_0xbcf1('0x8')][_0xbcf1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18622d,_0xe7e876,_0x416b2f){return new BPromise(function(_0x56758c,_0x3c8595){return client[_0xbcf1('0xa')](_0x18622d,_0x416b2f)[_0xbcf1('0xb')](function(_0x33d3ba){logger['info'](_0xbcf1('0xc'),_0xe7e876,'request\x20sent');logger[_0xbcf1('0xd')](_0xbcf1('0xe'),_0xe7e876,'request\x20sent',JSON['stringify'](_0x33d3ba));if(_0x33d3ba[_0xbcf1('0xf')]){if(_0x33d3ba[_0xbcf1('0xf')][_0xbcf1('0x10')]===0x1f4){logger[_0xbcf1('0xf')](_0xbcf1('0xc'),_0xe7e876,_0x33d3ba[_0xbcf1('0xf')][_0xbcf1('0x11')]);return _0x3c8595(_0x33d3ba[_0xbcf1('0xf')]['message']);}logger[_0xbcf1('0xf')](_0xbcf1('0xc'),_0xe7e876,_0x33d3ba[_0xbcf1('0xf')][_0xbcf1('0x11')]);return _0x56758c(_0x33d3ba['error'][_0xbcf1('0x11')]);}else{logger[_0xbcf1('0x12')](_0xbcf1('0xc'),_0xe7e876,'request\x20sent');_0x56758c(_0x33d3ba[_0xbcf1('0x13')][_0xbcf1('0x11')]);}})[_0xbcf1('0x14')](function(_0xd0bb8b){logger[_0xbcf1('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0xe7e876,_0xd0bb8b);_0x3c8595(_0xd0bb8b);});});}