9b742d30fb10dc01b751f99b1bbc7ea9783f281f
[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 _0xeb15=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3e3ecf,_0x41e0fe){var _0x263236=function(_0x54e77e){while(--_0x54e77e){_0x3e3ecf['push'](_0x3e3ecf['shift']());}};_0x263236(++_0x41e0fe);}(_0xeb15,0x9e));var _0x5eb1=function(_0x1bf809,_0x536f55){_0x1bf809=_0x1bf809-0x0;var _0x1caa4e=_0xeb15[_0x1bf809];return _0x1caa4e;};'use strict';var _=require(_0x5eb1('0x0'));var util=require(_0x5eb1('0x1'));var moment=require(_0x5eb1('0x2'));var BPromise=require(_0x5eb1('0x3'));var rs=require(_0x5eb1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5eb1('0x5'));var logger=require(_0x5eb1('0x6'))('rpc');var config=require(_0x5eb1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5eb1('0x8')][_0x5eb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x58786d,_0x3edbdb,_0x35f946){return new BPromise(function(_0xe57eb6,_0x3f97f0){return client[_0x5eb1('0xa')](_0x58786d,_0x35f946)[_0x5eb1('0xb')](function(_0x535c08){logger[_0x5eb1('0xc')](_0x5eb1('0xd'),_0x3edbdb,_0x5eb1('0xe'));logger[_0x5eb1('0xf')](_0x5eb1('0x10'),_0x3edbdb,_0x5eb1('0xe'),JSON[_0x5eb1('0x11')](_0x535c08));if(_0x535c08[_0x5eb1('0x12')]){if(_0x535c08[_0x5eb1('0x12')][_0x5eb1('0x13')]===0x1f4){logger[_0x5eb1('0x12')](_0x5eb1('0xd'),_0x3edbdb,_0x535c08[_0x5eb1('0x12')][_0x5eb1('0x14')]);return _0x3f97f0(_0x535c08['error'][_0x5eb1('0x14')]);}logger[_0x5eb1('0x12')](_0x5eb1('0xd'),_0x3edbdb,_0x535c08[_0x5eb1('0x12')][_0x5eb1('0x14')]);return _0xe57eb6(_0x535c08[_0x5eb1('0x12')][_0x5eb1('0x14')]);}else{logger[_0x5eb1('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x3edbdb,'request\x20sent');_0xe57eb6(_0x535c08[_0x5eb1('0x15')][_0x5eb1('0x14')]);}})[_0x5eb1('0x16')](function(_0x309ebb){logger[_0x5eb1('0x12')](_0x5eb1('0xd'),_0x3edbdb,_0x309ebb);_0x3f97f0(_0x309ebb);});});}