Built motion from commit 43538d75.|2.5.35
[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 _0x7994=['request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','WhatsappTransferReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x57ee02,_0x58b0c4){var _0x2fc9b0=function(_0x565e77){while(--_0x565e77){_0x57ee02['push'](_0x57ee02['shift']());}};_0x2fc9b0(++_0x58b0c4);}(_0x7994,0x183));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4799('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4799('0x1'));var rs=require(_0x4799('0x2'));var fs=require('fs');var Redis=require(_0x4799('0x3'));var db=require(_0x4799('0x4'))['db'];var utils=require(_0x4799('0x5'));var logger=require(_0x4799('0x6'))(_0x4799('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4799('0x8')][_0x4799('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49fe62,_0x357f02,_0x4f1285){return new BPromise(function(_0x240b63,_0x15ef9){return client[_0x4799('0xa')](_0x49fe62,_0x4f1285)[_0x4799('0xb')](function(_0x10c059){logger[_0x4799('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x357f02,_0x4799('0xd'));logger[_0x4799('0xe')](_0x4799('0xf'),_0x357f02,_0x4799('0xd'),JSON['stringify'](_0x10c059));if(_0x10c059[_0x4799('0x10')]){if(_0x10c059[_0x4799('0x10')]['code']===0x1f4){logger['error'](_0x4799('0x11'),_0x357f02,_0x10c059[_0x4799('0x10')][_0x4799('0x12')]);return _0x15ef9(_0x10c059[_0x4799('0x10')][_0x4799('0x12')]);}logger[_0x4799('0x10')](_0x4799('0x11'),_0x357f02,_0x10c059[_0x4799('0x10')][_0x4799('0x12')]);return _0x240b63(_0x10c059[_0x4799('0x10')][_0x4799('0x12')]);}else{logger['info'](_0x4799('0x11'),_0x357f02,_0x4799('0xd'));_0x240b63(_0x10c059['result'][_0x4799('0x12')]);}})[_0x4799('0x13')](function(_0x5192c4){logger[_0x4799('0x10')](_0x4799('0x11'),_0x357f02,_0x5192c4);_0x15ef9(_0x5192c4);});});}