Built motion from commit e0fa946e.|2.6.5
[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 _0xe59c=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x492c09,_0x4c9496){var _0x44acc3=function(_0x249bf7){while(--_0x249bf7){_0x492c09['push'](_0x492c09['shift']());}};_0x44acc3(++_0x4c9496);}(_0xe59c,0xb3));var _0xce59=function(_0x19d09c,_0xb36c8c){_0x19d09c=_0x19d09c-0x0;var _0xce69d5=_0xe59c[_0x19d09c];return _0xce69d5;};'use strict';var _=require(_0xce59('0x0'));var util=require(_0xce59('0x1'));var moment=require(_0xce59('0x2'));var BPromise=require(_0xce59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce59('0x4'));var db=require(_0xce59('0x5'))['db'];var utils=require(_0xce59('0x6'));var logger=require(_0xce59('0x7'))('rpc');var config=require(_0xce59('0x8'));var jayson=require(_0xce59('0x9'));var client=jayson[_0xce59('0xa')][_0xce59('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9a2c15,_0x5aec93,_0x254f41){return new BPromise(function(_0x315b7b,_0x4c52da){return client['request'](_0x9a2c15,_0x254f41)[_0xce59('0xc')](function(_0x3baf69){logger[_0xce59('0xd')](_0xce59('0xe'),_0x5aec93,'request\x20sent');logger[_0xce59('0xf')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x5aec93,_0xce59('0x10'),JSON['stringify'](_0x3baf69));if(_0x3baf69[_0xce59('0x11')]){if(_0x3baf69['error'][_0xce59('0x12')]===0x1f4){logger[_0xce59('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x5aec93,_0x3baf69[_0xce59('0x11')][_0xce59('0x13')]);return _0x4c52da(_0x3baf69[_0xce59('0x11')][_0xce59('0x13')]);}logger[_0xce59('0x11')](_0xce59('0xe'),_0x5aec93,_0x3baf69['error']['message']);return _0x315b7b(_0x3baf69[_0xce59('0x11')][_0xce59('0x13')]);}else{logger[_0xce59('0xd')](_0xce59('0xe'),_0x5aec93,_0xce59('0x10'));_0x315b7b(_0x3baf69[_0xce59('0x14')][_0xce59('0x13')]);}})[_0xce59('0x15')](function(_0x5bb744){logger[_0xce59('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x5aec93,_0x5bb744);_0x4c52da(_0x5bb744);});});}