Built motion from commit eddce310.|2.6.12
[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 _0x8863=['catch','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0xed86e7,_0x3c3545){var _0x1e5bdb=function(_0x10396e){while(--_0x10396e){_0xed86e7['push'](_0xed86e7['shift']());}};_0x1e5bdb(++_0x3c3545);}(_0x8863,0x1b6));var _0x3886=function(_0x1eee6e,_0x12f7a3){_0x1eee6e=_0x1eee6e-0x0;var _0x3caf1d=_0x8863[_0x1eee6e];return _0x3caf1d;};'use strict';var _=require('lodash');var util=require(_0x3886('0x0'));var moment=require(_0x3886('0x1'));var BPromise=require(_0x3886('0x2'));var rs=require(_0x3886('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3886('0x4'));var config=require(_0x3886('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3886('0x6')][_0x3886('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x566503,_0x25d62e,_0x6edf8a){return new BPromise(function(_0x3a7943,_0x2718ec){return client['request'](_0x566503,_0x6edf8a)[_0x3886('0x8')](function(_0x2dbdc1){logger[_0x3886('0x9')](_0x3886('0xa'),_0x25d62e,_0x3886('0xb'));logger['debug'](_0x3886('0xc'),_0x25d62e,_0x3886('0xb'),JSON[_0x3886('0xd')](_0x2dbdc1));if(_0x2dbdc1['error']){if(_0x2dbdc1['error'][_0x3886('0xe')]===0x1f4){logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);return _0x2718ec(_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);}logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);return _0x3a7943(_0x2dbdc1[_0x3886('0xf')]['message']);}else{logger[_0x3886('0x9')](_0x3886('0xa'),_0x25d62e,'request\x20sent');_0x3a7943(_0x2dbdc1[_0x3886('0x11')]['message']);}})[_0x3886('0x12')](function(_0xdbb8c){logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0xdbb8c);_0x2718ec(_0xdbb8c);});});}