dd9c3881ce29dda6dd4e8334b75a667a25e0132c
[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 _0x5712=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x2842b4,_0x2b1b7b){var _0x2b9521=function(_0x3613b8){while(--_0x3613b8){_0x2842b4['push'](_0x2842b4['shift']());}};_0x2b9521(++_0x2b1b7b);}(_0x5712,0x140));var _0x2571=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5712[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x2571('0x0'));var util=require(_0x2571('0x1'));var moment=require(_0x2571('0x2'));var BPromise=require(_0x2571('0x3'));var rs=require(_0x2571('0x4'));var fs=require('fs');var Redis=require(_0x2571('0x5'));var db=require(_0x2571('0x6'))['db'];var utils=require(_0x2571('0x7'));var logger=require(_0x2571('0x8'))(_0x2571('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2571('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e19b2,_0x251ee6,_0x3ca885){return new BPromise(function(_0x204ecc,_0xda659a){return client[_0x2571('0xb')](_0x3e19b2,_0x3ca885)['then'](function(_0x1f0c98){logger['info'](_0x2571('0xc'),_0x251ee6,_0x2571('0xd'));logger[_0x2571('0xe')](_0x2571('0xf'),_0x251ee6,_0x2571('0xd'),JSON[_0x2571('0x10')](_0x1f0c98));if(_0x1f0c98[_0x2571('0x11')]){if(_0x1f0c98[_0x2571('0x11')]['code']===0x1f4){logger['error'](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0xda659a(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);return _0x204ecc(_0x1f0c98[_0x2571('0x11')][_0x2571('0x12')]);}else{logger[_0x2571('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x251ee6,_0x2571('0xd'));_0x204ecc(_0x1f0c98['result']['message']);}})['catch'](function(_0x4c3e11){logger[_0x2571('0x11')](_0x2571('0xc'),_0x251ee6,_0x4c3e11);_0xda659a(_0x4c3e11);});});}