Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / intDeskConfiguration / intDeskConfiguration.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 _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x1a7656,_0x4b7c9d){var _0x3f0fac=function(_0x1a3f1c){while(--_0x1a3f1c){_0x1a7656['push'](_0x1a7656['shift']());}};_0x3f0fac(++_0x4b7c9d);}(_0x1a85,0x178));var _0x51a8=function(_0x3238ea,_0x91809d){_0x3238ea=_0x3238ea-0x0;var _0x4aaac2=_0x1a85[_0x3238ea];return _0x4aaac2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}