Built motion from commit 97153652.|2.6.26
[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 _0x2cea=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x2cea,0xa9));var _0xa2ce=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0x2cea[_0x40e854];return _0x1463b3;};'use strict';var _=require('lodash');var util=require(_0xa2ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa2ce('0x1'));var fs=require('fs');var Redis=require(_0xa2ce('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2ce('0x3'));var logger=require(_0xa2ce('0x4'))('rpc');var config=require(_0xa2ce('0x5'));var jayson=require(_0xa2ce('0x6'));var client=jayson[_0xa2ce('0x7')][_0xa2ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x176ab6,_0xf418f3,_0x443170){return new BPromise(function(_0x2dcaa1,_0x310cab){return client[_0xa2ce('0x9')](_0x176ab6,_0x443170)[_0xa2ce('0xa')](function(_0x12ba50){logger['info'](_0xa2ce('0xb'),_0xf418f3,'request\x20sent');logger['debug'](_0xa2ce('0xc'),_0xf418f3,_0xa2ce('0xd'),JSON[_0xa2ce('0xe')](_0x12ba50));if(_0x12ba50[_0xa2ce('0xf')]){if(_0x12ba50[_0xa2ce('0xf')][_0xa2ce('0x10')]===0x1f4){logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0x12ba50[_0xa2ce('0xf')]['message']);return _0x310cab(_0x12ba50[_0xa2ce('0xf')][_0xa2ce('0x11')]);}logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0x12ba50['error'][_0xa2ce('0x11')]);return _0x2dcaa1(_0x12ba50['error'][_0xa2ce('0x11')]);}else{logger[_0xa2ce('0x12')](_0xa2ce('0xb'),_0xf418f3,_0xa2ce('0xd'));_0x2dcaa1(_0x12ba50[_0xa2ce('0x13')][_0xa2ce('0x11')]);}})['catch'](function(_0xbc043a){logger[_0xa2ce('0xf')](_0xa2ce('0xb'),_0xf418f3,_0xbc043a);_0x310cab(_0xbc043a);});});}