65183a128ffd466e51184048605e4b51167e37fd
[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 _0xe9b4=['../../config/environment','jayson/promise','client','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x410001,_0x4705c1){var _0x2781cf=function(_0x693562){while(--_0x693562){_0x410001['push'](_0x410001['shift']());}};_0x2781cf(++_0x4705c1);}(_0xe9b4,0x1f1));var _0x4e9b=function(_0x4f9d25,_0x619f56){_0x4f9d25=_0x4f9d25-0x0;var _0x3aa11b=_0xe9b4[_0x4f9d25];return _0x3aa11b;};'use strict';var _=require('lodash');var util=require(_0x4e9b('0x0'));var moment=require(_0x4e9b('0x1'));var BPromise=require(_0x4e9b('0x2'));var rs=require(_0x4e9b('0x3'));var fs=require('fs');var Redis=require(_0x4e9b('0x4'));var db=require(_0x4e9b('0x5'))['db'];var utils=require(_0x4e9b('0x6'));var logger=require(_0x4e9b('0x7'))(_0x4e9b('0x8'));var config=require(_0x4e9b('0x9'));var jayson=require(_0x4e9b('0xa'));var client=jayson[_0x4e9b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d863a,_0x17295a,_0x3d95b8){return new BPromise(function(_0x564242,_0x461a59){return client[_0x4e9b('0xc')](_0x5d863a,_0x3d95b8)['then'](function(_0x1c0536){logger['info'](_0x4e9b('0xd'),_0x17295a,_0x4e9b('0xe'));logger[_0x4e9b('0xf')](_0x4e9b('0x10'),_0x17295a,_0x4e9b('0xe'),JSON[_0x4e9b('0x11')](_0x1c0536));if(_0x1c0536[_0x4e9b('0x12')]){if(_0x1c0536[_0x4e9b('0x12')][_0x4e9b('0x13')]===0x1f4){logger[_0x4e9b('0x12')](_0x4e9b('0xd'),_0x17295a,_0x1c0536[_0x4e9b('0x12')][_0x4e9b('0x14')]);return _0x461a59(_0x1c0536['error']['message']);}logger[_0x4e9b('0x12')]('ChatTransferReport,\x20%s,\x20%s',_0x17295a,_0x1c0536[_0x4e9b('0x12')][_0x4e9b('0x14')]);return _0x564242(_0x1c0536[_0x4e9b('0x12')][_0x4e9b('0x14')]);}else{logger[_0x4e9b('0x15')](_0x4e9b('0xd'),_0x17295a,_0x4e9b('0xe'));_0x564242(_0x1c0536[_0x4e9b('0x16')][_0x4e9b('0x14')]);}})['catch'](function(_0x403d8a){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x17295a,_0x403d8a);_0x461a59(_0x403d8a);});});}