Built motion from commit 9e1399f3.|2.5.37
[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 _0xb982=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','DeskConfiguration,\x20%s,\x20%s','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird'];(function(_0x51a5d3,_0x9bb804){var _0x5a4af1=function(_0x38f858){while(--_0x38f858){_0x51a5d3['push'](_0x51a5d3['shift']());}};_0x5a4af1(++_0x9bb804);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2b98('0x0'));var BPromise=require(_0x2b98('0x1'));var rs=require(_0x2b98('0x2'));var fs=require('fs');var Redis=require(_0x2b98('0x3'));var db=require(_0x2b98('0x4'))['db'];var utils=require(_0x2b98('0x5'));var logger=require(_0x2b98('0x6'))(_0x2b98('0x7'));var config=require(_0x2b98('0x8'));var jayson=require(_0x2b98('0x9'));var client=jayson['client'][_0x2b98('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1166cb,_0x15ee91,_0x4626ad){return new BPromise(function(_0x3a6bad,_0x6b6f9e){return client['request'](_0x1166cb,_0x4626ad)[_0x2b98('0xb')](function(_0x4c64b5){logger['info'](_0x2b98('0xc'),_0x15ee91,'request\x20sent');logger[_0x2b98('0xd')](_0x2b98('0xe'),_0x15ee91,_0x2b98('0xf'),JSON[_0x2b98('0x10')](_0x4c64b5));if(_0x4c64b5[_0x2b98('0x11')]){if(_0x4c64b5['error'][_0x2b98('0x12')]===0x1f4){logger['error'](_0x2b98('0xc'),_0x15ee91,_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);return _0x6b6f9e(_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);}logger[_0x2b98('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x15ee91,_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);return _0x3a6bad(_0x4c64b5[_0x2b98('0x11')][_0x2b98('0x13')]);}else{logger[_0x2b98('0x14')](_0x2b98('0xc'),_0x15ee91,_0x2b98('0xf'));_0x3a6bad(_0x4c64b5['result'][_0x2b98('0x13')]);}})[_0x2b98('0x15')](function(_0x51eb95){logger[_0x2b98('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x15ee91,_0x51eb95);_0x6b6f9e(_0x51eb95);});});}