Built motion from commit 753c950e.|2.5.42
[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 _0xdf62=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','DeskConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent'];(function(_0x14908f,_0x292269){var _0x4d8ccc=function(_0x21da22){while(--_0x21da22){_0x14908f['push'](_0x14908f['shift']());}};_0x4d8ccc(++_0x292269);}(_0xdf62,0x151));var _0x2df6=function(_0x5e5163,_0xb2b3e){_0x5e5163=_0x5e5163-0x0;var _0x2d2eaa=_0xdf62[_0x5e5163];return _0x2d2eaa;};'use strict';var _=require(_0x2df6('0x0'));var util=require(_0x2df6('0x1'));var moment=require(_0x2df6('0x2'));var BPromise=require(_0x2df6('0x3'));var rs=require(_0x2df6('0x4'));var fs=require('fs');var Redis=require(_0x2df6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2df6('0x6'))(_0x2df6('0x7'));var config=require(_0x2df6('0x8'));var jayson=require(_0x2df6('0x9'));var client=jayson[_0x2df6('0xa')][_0x2df6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c4e7f,_0x5059ec,_0x8acc33){return new BPromise(function(_0x53a836,_0x4511af){return client[_0x2df6('0xc')](_0x2c4e7f,_0x8acc33)[_0x2df6('0xd')](function(_0x6a8be8){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5059ec,_0x2df6('0xe'));logger[_0x2df6('0xf')](_0x2df6('0x10'),_0x5059ec,_0x2df6('0xe'),JSON['stringify'](_0x6a8be8));if(_0x6a8be8[_0x2df6('0x11')]){if(_0x6a8be8[_0x2df6('0x11')]['code']===0x1f4){logger[_0x2df6('0x11')](_0x2df6('0x12'),_0x5059ec,_0x6a8be8[_0x2df6('0x11')][_0x2df6('0x13')]);return _0x4511af(_0x6a8be8[_0x2df6('0x11')]['message']);}logger[_0x2df6('0x11')](_0x2df6('0x12'),_0x5059ec,_0x6a8be8[_0x2df6('0x11')][_0x2df6('0x13')]);return _0x53a836(_0x6a8be8[_0x2df6('0x11')]['message']);}else{logger[_0x2df6('0x14')](_0x2df6('0x12'),_0x5059ec,_0x2df6('0xe'));_0x53a836(_0x6a8be8[_0x2df6('0x15')][_0x2df6('0x13')]);}})['catch'](function(_0x1be726){logger[_0x2df6('0x11')](_0x2df6('0x12'),_0x5059ec,_0x1be726);_0x4511af(_0x1be726);});});}