Built motion from commit 753c950e.|2.5.42
[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 _0x6af9=['then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x30fa61,_0x5df30f){var _0x5921f5=function(_0x7730ba){while(--_0x7730ba){_0x30fa61['push'](_0x30fa61['shift']());}};_0x5921f5(++_0x5df30f);}(_0x6af9,0x136));var _0x96af=function(_0x29daf9,_0x4b5366){_0x29daf9=_0x29daf9-0x0;var _0x2bf8a7=_0x6af9[_0x29daf9];return _0x2bf8a7;};'use strict';var _=require(_0x96af('0x0'));var util=require('util');var moment=require(_0x96af('0x1'));var BPromise=require(_0x96af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96af('0x3'));var db=require(_0x96af('0x4'))['db'];var utils=require(_0x96af('0x5'));var logger=require(_0x96af('0x6'))(_0x96af('0x7'));var config=require(_0x96af('0x8'));var jayson=require(_0x96af('0x9'));var client=jayson['client'][_0x96af('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bde3a,_0x55d55a,_0x5f5cbf){return new BPromise(function(_0x383515,_0x81529a){return client[_0x96af('0xb')](_0x3bde3a,_0x5f5cbf)[_0x96af('0xc')](function(_0x56825e){logger[_0x96af('0xd')](_0x96af('0xe'),_0x55d55a,_0x96af('0xf'));logger[_0x96af('0x10')](_0x96af('0x11'),_0x55d55a,_0x96af('0xf'),JSON[_0x96af('0x12')](_0x56825e));if(_0x56825e[_0x96af('0x13')]){if(_0x56825e[_0x96af('0x13')][_0x96af('0x14')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x55d55a,_0x56825e[_0x96af('0x13')]['message']);return _0x81529a(_0x56825e[_0x96af('0x13')]['message']);}logger['error'](_0x96af('0xe'),_0x55d55a,_0x56825e['error'][_0x96af('0x15')]);return _0x383515(_0x56825e['error']['message']);}else{logger[_0x96af('0xd')](_0x96af('0xe'),_0x55d55a,_0x96af('0xf'));_0x383515(_0x56825e[_0x96af('0x16')][_0x96af('0x15')]);}})['catch'](function(_0x358cc1){logger[_0x96af('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x55d55a,_0x358cc1);_0x81529a(_0x358cc1);});});}