Built motion from commit f3da74b7.|2.5.36
[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 _0x46e2=['then','info','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x50c4a6,_0x53186f){var _0x4832c2=function(_0x4fe943){while(--_0x4fe943){_0x50c4a6['push'](_0x50c4a6['shift']());}};_0x4832c2(++_0x53186f);}(_0x46e2,0x9b));var _0x246e=function(_0x2991e3,_0x18b578){_0x2991e3=_0x2991e3-0x0;var _0x533719=_0x46e2[_0x2991e3];return _0x533719;};'use strict';var _=require(_0x246e('0x0'));var util=require(_0x246e('0x1'));var moment=require('moment');var BPromise=require(_0x246e('0x2'));var rs=require(_0x246e('0x3'));var fs=require('fs');var Redis=require(_0x246e('0x4'));var db=require(_0x246e('0x5'))['db'];var utils=require(_0x246e('0x6'));var logger=require(_0x246e('0x7'))(_0x246e('0x8'));var config=require('../../config/environment');var jayson=require(_0x246e('0x9'));var client=jayson[_0x246e('0xa')][_0x246e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45e01b,_0x43c79f,_0x4d4e5e){return new BPromise(function(_0x27cb11,_0x22a850){return client[_0x246e('0xc')](_0x45e01b,_0x4d4e5e)[_0x246e('0xd')](function(_0x8edd8e){logger[_0x246e('0xe')]('WhatsappTransferReport,\x20%s,\x20%s',_0x43c79f,'request\x20sent');logger[_0x246e('0xf')](_0x246e('0x10'),_0x43c79f,'request\x20sent',JSON[_0x246e('0x11')](_0x8edd8e));if(_0x8edd8e[_0x246e('0x12')]){if(_0x8edd8e[_0x246e('0x12')][_0x246e('0x13')]===0x1f4){logger[_0x246e('0x12')](_0x246e('0x14'),_0x43c79f,_0x8edd8e[_0x246e('0x12')][_0x246e('0x15')]);return _0x22a850(_0x8edd8e[_0x246e('0x12')]['message']);}logger[_0x246e('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x43c79f,_0x8edd8e[_0x246e('0x12')][_0x246e('0x15')]);return _0x27cb11(_0x8edd8e[_0x246e('0x12')][_0x246e('0x15')]);}else{logger[_0x246e('0xe')](_0x246e('0x14'),_0x43c79f,_0x246e('0x16'));_0x27cb11(_0x8edd8e[_0x246e('0x17')][_0x246e('0x15')]);}})['catch'](function(_0x3b4553){logger['error'](_0x246e('0x14'),_0x43c79f,_0x3b4553);_0x22a850(_0x3b4553);});});}