Built motion from commit bab6f49e.|2.6.17
[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 _0x866b=['client','http','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x866b,0xae));var _0xb866=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x866b[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0xb866('0x0'));var util=require('util');var moment=require(_0xb866('0x1'));var BPromise=require('bluebird');var rs=require(_0xb866('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb866('0x3'))['db'];var utils=require(_0xb866('0x4'));var logger=require(_0xb866('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb866('0x6')][_0xb866('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xacf748,_0x5d5090,_0x23ee45){return new BPromise(function(_0x452c2e,_0x2cf4a8){return client['request'](_0xacf748,_0x23ee45)[_0xb866('0x8')](function(_0x29d71f){logger[_0xb866('0x9')](_0xb866('0xa'),_0x5d5090,'request\x20sent');logger[_0xb866('0xb')](_0xb866('0xc'),_0x5d5090,_0xb866('0xd'),JSON[_0xb866('0xe')](_0x29d71f));if(_0x29d71f['error']){if(_0x29d71f[_0xb866('0xf')][_0xb866('0x10')]===0x1f4){logger[_0xb866('0xf')](_0xb866('0xa'),_0x5d5090,_0x29d71f['error'][_0xb866('0x11')]);return _0x2cf4a8(_0x29d71f[_0xb866('0xf')][_0xb866('0x11')]);}logger[_0xb866('0xf')](_0xb866('0xa'),_0x5d5090,_0x29d71f[_0xb866('0xf')][_0xb866('0x11')]);return _0x452c2e(_0x29d71f[_0xb866('0xf')][_0xb866('0x11')]);}else{logger['info'](_0xb866('0xa'),_0x5d5090,_0xb866('0xd'));_0x452c2e(_0x29d71f[_0xb866('0x12')][_0xb866('0x11')]);}})[_0xb866('0x13')](function(_0x6846df){logger[_0xb866('0xf')](_0xb866('0xa'),_0x5d5090,_0x6846df);_0x2cf4a8(_0x6846df);});});}