Built motion from commit 85328c08.|2.5.50
[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 _0xab00=['error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','stringify'];(function(_0x47933e,_0x454d00){var _0x3f5e20=function(_0x2202dc){while(--_0x2202dc){_0x47933e['push'](_0x47933e['shift']());}};_0x3f5e20(++_0x454d00);}(_0xab00,0x1b9));var _0x0ab0=function(_0x3e88f3,_0x4c7928){_0x3e88f3=_0x3e88f3-0x0;var _0x43b42d=_0xab00[_0x3e88f3];return _0x43b42d;};'use strict';var _=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var moment=require(_0x0ab0('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab0('0x3'));var fs=require('fs');var Redis=require(_0x0ab0('0x4'));var db=require(_0x0ab0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ab0('0x6'))('rpc');var config=require(_0x0ab0('0x7'));var jayson=require(_0x0ab0('0x8'));var client=jayson[_0x0ab0('0x9')][_0x0ab0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363359,_0x25742b,_0x59fb03){return new BPromise(function(_0x3e934d,_0x2cbb53){return client['request'](_0x363359,_0x59fb03)[_0x0ab0('0xb')](function(_0x4f4a28){logger[_0x0ab0('0xc')](_0x0ab0('0xd'),_0x25742b,'request\x20sent');logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x25742b,'request\x20sent',JSON[_0x0ab0('0xe')](_0x4f4a28));if(_0x4f4a28['error']){if(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x10')]===0x1f4){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x2cbb53(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}logger[_0x0ab0('0xf')](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x3e934d(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}else{logger[_0x0ab0('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x25742b,'request\x20sent');_0x3e934d(_0x4f4a28['result'][_0x0ab0('0x11')]);}})[_0x0ab0('0x12')](function(_0x2f594b){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x2f594b);_0x2cbb53(_0x2f594b);});});}