Built motion from commit (unavailable).|2.5.4
[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 _0x751d=['moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x57eb08,_0xd435e4){var _0x3deda3=function(_0x44c8d0){while(--_0x44c8d0){_0x57eb08['push'](_0x57eb08['shift']());}};_0x3deda3(++_0xd435e4);}(_0x751d,0x1a3));var _0xd751=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x751d[_0x15ea09];return _0x3e9c78;};'use strict';var _=require(_0xd751('0x0'));var util=require('util');var moment=require(_0xd751('0x1'));var BPromise=require('bluebird');var rs=require(_0xd751('0x2'));var fs=require('fs');var Redis=require(_0xd751('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd751('0x4'))(_0xd751('0x5'));var config=require(_0xd751('0x6'));var jayson=require(_0xd751('0x7'));var client=jayson[_0xd751('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b4cae,_0x5d6b95,_0x38d085){return new BPromise(function(_0x233e83,_0x1c98e3){return client[_0xd751('0x9')](_0x2b4cae,_0x38d085)[_0xd751('0xa')](function(_0x6f3b4e){logger[_0xd751('0xb')](_0xd751('0xc'),_0x5d6b95,_0xd751('0xd'));logger[_0xd751('0xe')](_0xd751('0xf'),_0x5d6b95,_0xd751('0xd'),JSON[_0xd751('0x10')](_0x6f3b4e));if(_0x6f3b4e[_0xd751('0x11')]){if(_0x6f3b4e['error'][_0xd751('0x12')]===0x1f4){logger[_0xd751('0x11')](_0xd751('0xc'),_0x5d6b95,_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);return _0x1c98e3(_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);}logger[_0xd751('0x11')](_0xd751('0xc'),_0x5d6b95,_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);return _0x233e83(_0x6f3b4e[_0xd751('0x11')][_0xd751('0x13')]);}else{logger[_0xd751('0xb')](_0xd751('0xc'),_0x5d6b95,'request\x20sent');_0x233e83(_0x6f3b4e[_0xd751('0x14')][_0xd751('0x13')]);}})['catch'](function(_0x650ab4){logger[_0xd751('0x11')](_0xd751('0xc'),_0x5d6b95,_0x650ab4);_0x1c98e3(_0x650ab4);});});}