a06917e255e3d0f39ec06b3ff91ee49ca3cc95da
[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 _0x60d1=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1cd234,_0x12db2f){var _0x130802=function(_0x22d630){while(--_0x22d630){_0x1cd234['push'](_0x1cd234['shift']());}};_0x130802(++_0x12db2f);}(_0x60d1,0x80));var _0x160d=function(_0x1b46b2,_0x4a9b91){_0x1b46b2=_0x1b46b2-0x0;var _0xc4dec7=_0x60d1[_0x1b46b2];return _0xc4dec7;};'use strict';var _=require('lodash');var util=require(_0x160d('0x0'));var moment=require('moment');var BPromise=require(_0x160d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x160d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x160d('0x3'));var logger=require(_0x160d('0x4'))(_0x160d('0x5'));var config=require(_0x160d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x160d('0x7')][_0x160d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xab6797,_0x2d55b2,_0x5101e6){return new BPromise(function(_0x5417d0,_0x1aa4b0){return client['request'](_0xab6797,_0x5101e6)['then'](function(_0x4d986c){logger[_0x160d('0x9')](_0x160d('0xa'),_0x2d55b2,_0x160d('0xb'));logger[_0x160d('0xc')](_0x160d('0xd'),_0x2d55b2,'request\x20sent',JSON[_0x160d('0xe')](_0x4d986c));if(_0x4d986c['error']){if(_0x4d986c[_0x160d('0xf')][_0x160d('0x10')]===0x1f4){logger[_0x160d('0xf')](_0x160d('0xa'),_0x2d55b2,_0x4d986c[_0x160d('0xf')][_0x160d('0x11')]);return _0x1aa4b0(_0x4d986c[_0x160d('0xf')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d55b2,_0x4d986c[_0x160d('0xf')][_0x160d('0x11')]);return _0x5417d0(_0x4d986c[_0x160d('0xf')][_0x160d('0x11')]);}else{logger['info'](_0x160d('0xa'),_0x2d55b2,_0x160d('0xb'));_0x5417d0(_0x4d986c[_0x160d('0x12')][_0x160d('0x11')]);}})[_0x160d('0x13')](function(_0x4a6222){logger[_0x160d('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2d55b2,_0x4a6222);_0x1aa4b0(_0x4a6222);});});}