fb87d3a12d3a58dfe65b619b8bab3c6be25ee688
[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 _0xc36a=['jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3b9716,_0x5218e7){var _0x4a0917=function(_0x5798ec){while(--_0x5798ec){_0x3b9716['push'](_0x3b9716['shift']());}};_0x4a0917(++_0x5218e7);}(_0xc36a,0x1b0));var _0xac36=function(_0x5ec83b,_0x2190e1){_0x5ec83b=_0x5ec83b-0x0;var _0x1c5c08=_0xc36a[_0x5ec83b];return _0x1c5c08;};'use strict';var _=require(_0xac36('0x0'));var util=require('util');var moment=require(_0xac36('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac36('0x2'));var db=require(_0xac36('0x3'))['db'];var utils=require(_0xac36('0x4'));var logger=require(_0xac36('0x5'))(_0xac36('0x6'));var config=require(_0xac36('0x7'));var jayson=require(_0xac36('0x8'));var client=jayson[_0xac36('0x9')][_0xac36('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xee0d05,_0x57cce1,_0xd462ae){return new BPromise(function(_0x36a6a3,_0x48a356){return client[_0xac36('0xb')](_0xee0d05,_0xd462ae)['then'](function(_0x107d2d){logger[_0xac36('0xc')](_0xac36('0xd'),_0x57cce1,_0xac36('0xe'));logger[_0xac36('0xf')](_0xac36('0x10'),_0x57cce1,_0xac36('0xe'),JSON[_0xac36('0x11')](_0x107d2d));if(_0x107d2d[_0xac36('0x12')]){if(_0x107d2d[_0xac36('0x12')][_0xac36('0x13')]===0x1f4){logger[_0xac36('0x12')](_0xac36('0xd'),_0x57cce1,_0x107d2d[_0xac36('0x12')][_0xac36('0x14')]);return _0x48a356(_0x107d2d[_0xac36('0x12')][_0xac36('0x14')]);}logger[_0xac36('0x12')](_0xac36('0xd'),_0x57cce1,_0x107d2d[_0xac36('0x12')]['message']);return _0x36a6a3(_0x107d2d[_0xac36('0x12')]['message']);}else{logger['info'](_0xac36('0xd'),_0x57cce1,_0xac36('0xe'));_0x36a6a3(_0x107d2d['result'][_0xac36('0x14')]);}})[_0xac36('0x15')](function(_0x54823f){logger[_0xac36('0x12')](_0xac36('0xd'),_0x57cce1,_0x54823f);_0x48a356(_0x54823f);});});}