Built motion from commit 47436d59.|2.6.7
[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 _0x3acc=['code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','stringify','error'];(function(_0x2e16d7,_0x2012ce){var _0x5c6ed1=function(_0x4d3d52){while(--_0x4d3d52){_0x2e16d7['push'](_0x2e16d7['shift']());}};_0x5c6ed1(++_0x2012ce);}(_0x3acc,0x1e8));var _0xc3ac=function(_0x4f645a,_0x65a067){_0x4f645a=_0x4f645a-0x0;var _0x12c258=_0x3acc[_0x4f645a];return _0x12c258;};'use strict';var _=require(_0xc3ac('0x0'));var util=require(_0xc3ac('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc3ac('0x2'));var fs=require('fs');var Redis=require(_0xc3ac('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc3ac('0x4'));var logger=require(_0xc3ac('0x5'))(_0xc3ac('0x6'));var config=require(_0xc3ac('0x7'));var jayson=require(_0xc3ac('0x8'));var client=jayson[_0xc3ac('0x9')][_0xc3ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cdc58,_0x437f3e,_0x3ebe16){return new BPromise(function(_0x1d6d10,_0xdce77c){return client[_0xc3ac('0xb')](_0x2cdc58,_0x3ebe16)['then'](function(_0x391abe){logger[_0xc3ac('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x437f3e,_0xc3ac('0xd'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x437f3e,_0xc3ac('0xd'),JSON[_0xc3ac('0xe')](_0x391abe));if(_0x391abe[_0xc3ac('0xf')]){if(_0x391abe[_0xc3ac('0xf')][_0xc3ac('0x10')]===0x1f4){logger[_0xc3ac('0xf')](_0xc3ac('0x11'),_0x437f3e,_0x391abe[_0xc3ac('0xf')][_0xc3ac('0x12')]);return _0xdce77c(_0x391abe[_0xc3ac('0xf')][_0xc3ac('0x12')]);}logger[_0xc3ac('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x437f3e,_0x391abe[_0xc3ac('0xf')][_0xc3ac('0x12')]);return _0x1d6d10(_0x391abe[_0xc3ac('0xf')][_0xc3ac('0x12')]);}else{logger['info'](_0xc3ac('0x11'),_0x437f3e,_0xc3ac('0xd'));_0x1d6d10(_0x391abe[_0xc3ac('0x13')][_0xc3ac('0x12')]);}})[_0xc3ac('0x14')](function(_0x57859e){logger[_0xc3ac('0xf')](_0xc3ac('0x11'),_0x437f3e,_0x57859e);_0xdce77c(_0x57859e);});});}