Built motion from commit 47436d59.|2.6.7
[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 _0xd506=['catch','lodash','../../config/logger','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x146242,_0x4f52b2){var _0x45c774=function(_0xe625d2){while(--_0xe625d2){_0x146242['push'](_0x146242['shift']());}};_0x45c774(++_0x4f52b2);}(_0xd506,0x197));var _0x6d50=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xd506[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x6d50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d50('0x1'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d50('0x2')][_0x6d50('0x3')]({'port':0x232a});function respondWithRpcPromise(_0x1b0af3,_0x4cf512,_0x9565b6){return new BPromise(function(_0xce67b6,_0x2dacde){return client['request'](_0x1b0af3,_0x9565b6)[_0x6d50('0x4')](function(_0x5012ed){logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,_0x6d50('0x7'));logger[_0x6d50('0x8')](_0x6d50('0x9'),_0x4cf512,_0x6d50('0x7'),JSON['stringify'](_0x5012ed));if(_0x5012ed['error']){if(_0x5012ed['error'][_0x6d50('0xa')]===0x1f4){logger[_0x6d50('0xb')](_0x6d50('0x6'),_0x4cf512,_0x5012ed[_0x6d50('0xb')]['message']);return _0x2dacde(_0x5012ed[_0x6d50('0xb')]['message']);}logger[_0x6d50('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x4cf512,_0x5012ed['error']['message']);return _0xce67b6(_0x5012ed[_0x6d50('0xb')]['message']);}else{logger[_0x6d50('0x5')](_0x6d50('0x6'),_0x4cf512,'request\x20sent');_0xce67b6(_0x5012ed['result'][_0x6d50('0xc')]);}})[_0x6d50('0xd')](function(_0x38068e){logger['error'](_0x6d50('0x6'),_0x4cf512,_0x38068e);_0x2dacde(_0x38068e);});});}