8b6a55693402e67896a795c573cb61e33f687a40
[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 _0x6671=['WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6671,0x196));var _0x1667=function(_0xd5a6fc,_0x2a1c9b){_0xd5a6fc=_0xd5a6fc-0x0;var _0x2e5ece=_0x6671[_0xd5a6fc];return _0x2e5ece;};'use strict';var _=require(_0x1667('0x0'));var util=require(_0x1667('0x1'));var moment=require(_0x1667('0x2'));var BPromise=require(_0x1667('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1667('0x4'));var db=require(_0x1667('0x5'))['db'];var utils=require(_0x1667('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1667('0x7'));var jayson=require(_0x1667('0x8'));var client=jayson[_0x1667('0x9')][_0x1667('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ce7c7,_0x585ee4,_0x391d79){return new BPromise(function(_0x52b81c,_0x34d6ec){return client[_0x1667('0xb')](_0x4ce7c7,_0x391d79)[_0x1667('0xc')](function(_0x1583b9){logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x585ee4,_0x1667('0xd'));logger['debug'](_0x1667('0xe'),_0x585ee4,_0x1667('0xd'),JSON['stringify'](_0x1583b9));if(_0x1583b9[_0x1667('0xf')]){if(_0x1583b9[_0x1667('0xf')][_0x1667('0x10')]===0x1f4){logger[_0x1667('0xf')](_0x1667('0x11'),_0x585ee4,_0x1583b9[_0x1667('0xf')][_0x1667('0x12')]);return _0x34d6ec(_0x1583b9[_0x1667('0xf')][_0x1667('0x12')]);}logger[_0x1667('0xf')](_0x1667('0x11'),_0x585ee4,_0x1583b9['error'][_0x1667('0x12')]);return _0x52b81c(_0x1583b9[_0x1667('0xf')][_0x1667('0x12')]);}else{logger['info'](_0x1667('0x11'),_0x585ee4,_0x1667('0xd'));_0x52b81c(_0x1583b9[_0x1667('0x13')][_0x1667('0x12')]);}})[_0x1667('0x14')](function(_0x3c723f){logger['error'](_0x1667('0x11'),_0x585ee4,_0x3c723f);_0x34d6ec(_0x3c723f);});});}