b1db6e62a9b127c8e9ae4be53fcc023fb5e5e3eb
[motion2.git] / server / api / chatTransferReport / chatTransferReport.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 _0x76af=['ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x36285a,_0xce9b4f){var _0x15a48e=function(_0xccf8e1){while(--_0xccf8e1){_0x36285a['push'](_0x36285a['shift']());}};_0x15a48e(++_0xce9b4f);}(_0x76af,0xb1));var _0xf76a=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0x76af[_0xd2d54];return _0x78b113;};'use strict';var _=require(_0xf76a('0x0'));var util=require(_0xf76a('0x1'));var moment=require(_0xf76a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf76a('0x3'));var db=require(_0xf76a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf76a('0x5'))(_0xf76a('0x6'));var config=require(_0xf76a('0x7'));var jayson=require(_0xf76a('0x8'));var client=jayson['client'][_0xf76a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x196b3b,_0x41c55a,_0xe3f870){return new BPromise(function(_0x2eec67,_0x5d0cc2){return client[_0xf76a('0xa')](_0x196b3b,_0xe3f870)['then'](function(_0x487fb5){logger[_0xf76a('0xb')](_0xf76a('0xc'),_0x41c55a,'request\x20sent');logger[_0xf76a('0xd')](_0xf76a('0xe'),_0x41c55a,_0xf76a('0xf'),JSON['stringify'](_0x487fb5));if(_0x487fb5['error']){if(_0x487fb5[_0xf76a('0x10')][_0xf76a('0x11')]===0x1f4){logger[_0xf76a('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x41c55a,_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);return _0x5d0cc2(_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);}logger[_0xf76a('0x10')](_0xf76a('0xc'),_0x41c55a,_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);return _0x2eec67(_0x487fb5[_0xf76a('0x10')][_0xf76a('0x12')]);}else{logger['info'](_0xf76a('0xc'),_0x41c55a,_0xf76a('0xf'));_0x2eec67(_0x487fb5[_0xf76a('0x13')][_0xf76a('0x12')]);}})[_0xf76a('0x14')](function(_0x4797ea){logger[_0xf76a('0x10')](_0xf76a('0xc'),_0x41c55a,_0x4797ea);_0x5d0cc2(_0x4797ea);});});}