Built motion from commit 1fa89557.|2.6.10
[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 _0x8eb6=['stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x20a939,_0x39114b){var _0x160d94=function(_0x2237d1){while(--_0x2237d1){_0x20a939['push'](_0x20a939['shift']());}};_0x160d94(++_0x39114b);}(_0x8eb6,0x1bc));var _0x68eb=function(_0x2a89ae,_0x3ad7d8){_0x2a89ae=_0x2a89ae-0x0;var _0x49d5f6=_0x8eb6[_0x2a89ae];return _0x49d5f6;};'use strict';var _=require(_0x68eb('0x0'));var util=require(_0x68eb('0x1'));var moment=require(_0x68eb('0x2'));var BPromise=require(_0x68eb('0x3'));var rs=require(_0x68eb('0x4'));var fs=require('fs');var Redis=require(_0x68eb('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x68eb('0x6'))(_0x68eb('0x7'));var config=require(_0x68eb('0x8'));var jayson=require(_0x68eb('0x9'));var client=jayson['client'][_0x68eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35742b,_0xa56b57,_0x1eb97c){return new BPromise(function(_0x8cfee4,_0x325c94){return client[_0x68eb('0xb')](_0x35742b,_0x1eb97c)[_0x68eb('0xc')](function(_0x1491a6){logger[_0x68eb('0xd')](_0x68eb('0xe'),_0xa56b57,_0x68eb('0xf'));logger[_0x68eb('0x10')](_0x68eb('0x11'),_0xa56b57,_0x68eb('0xf'),JSON[_0x68eb('0x12')](_0x1491a6));if(_0x1491a6['error']){if(_0x1491a6[_0x68eb('0x13')]['code']===0x1f4){logger[_0x68eb('0x13')](_0x68eb('0xe'),_0xa56b57,_0x1491a6[_0x68eb('0x13')][_0x68eb('0x14')]);return _0x325c94(_0x1491a6['error'][_0x68eb('0x14')]);}logger['error'](_0x68eb('0xe'),_0xa56b57,_0x1491a6[_0x68eb('0x13')][_0x68eb('0x14')]);return _0x8cfee4(_0x1491a6[_0x68eb('0x13')]['message']);}else{logger[_0x68eb('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xa56b57,'request\x20sent');_0x8cfee4(_0x1491a6['result'][_0x68eb('0x14')]);}})['catch'](function(_0x195f5a){logger[_0x68eb('0x13')](_0x68eb('0xe'),_0xa56b57,_0x195f5a);_0x325c94(_0x195f5a);});});}