e0a862602830486d42d5d180f7670f5fbecd3e99
[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 _0x780f=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x5d3e70,_0x376c1c){var _0x8470a6=function(_0x5eab9e){while(--_0x5eab9e){_0x5d3e70['push'](_0x5d3e70['shift']());}};_0x8470a6(++_0x376c1c);}(_0x780f,0x6c));var _0xf780=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0x780f[_0x57cc22];return _0x6f7bdc;};'use strict';var _=require(_0xf780('0x0'));var util=require(_0xf780('0x1'));var moment=require(_0xf780('0x2'));var BPromise=require(_0xf780('0x3'));var rs=require(_0xf780('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf780('0x5'));var logger=require(_0xf780('0x6'))(_0xf780('0x7'));var config=require(_0xf780('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf780('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd856,_0x93539d,_0x1c3fdc){return new BPromise(function(_0xa12d00,_0x44f14c){return client[_0xf780('0xa')](_0x1bd856,_0x1c3fdc)['then'](function(_0x2c8221){logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));logger[_0xf780('0xe')](_0xf780('0xf'),_0x93539d,_0xf780('0xd'),JSON['stringify'](_0x2c8221));if(_0x2c8221['error']){if(_0x2c8221[_0xf780('0x10')][_0xf780('0x11')]===0x1f4){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x2c8221['error'][_0xf780('0x12')]);return _0x44f14c(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}logger[_0xf780('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x93539d,_0x2c8221[_0xf780('0x10')]['message']);return _0xa12d00(_0x2c8221[_0xf780('0x10')][_0xf780('0x12')]);}else{logger[_0xf780('0xb')](_0xf780('0xc'),_0x93539d,_0xf780('0xd'));_0xa12d00(_0x2c8221[_0xf780('0x13')][_0xf780('0x12')]);}})['catch'](function(_0x450198){logger[_0xf780('0x10')](_0xf780('0xc'),_0x93539d,_0x450198);_0x44f14c(_0x450198);});});}