a2407584bbe56bd93dd4293fbd02fcb8c8f5abca
[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 _0x3025=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3025,0x1c7));var _0x5302=function(_0x4374b4,_0x4af1dd){_0x4374b4=_0x4374b4-0x0;var _0x2a5b2a=_0x3025[_0x4374b4];return _0x2a5b2a;};'use strict';var _=require(_0x5302('0x0'));var util=require(_0x5302('0x1'));var moment=require(_0x5302('0x2'));var BPromise=require(_0x5302('0x3'));var rs=require(_0x5302('0x4'));var fs=require('fs');var Redis=require(_0x5302('0x5'));var db=require(_0x5302('0x6'))['db'];var utils=require(_0x5302('0x7'));var logger=require(_0x5302('0x8'))('rpc');var config=require(_0x5302('0x9'));var jayson=require(_0x5302('0xa'));var client=jayson['client'][_0x5302('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d93ea,_0x41c3d6,_0x2e9c66){return new BPromise(function(_0x54884e,_0x40505e){return client[_0x5302('0xc')](_0x4d93ea,_0x2e9c66)['then'](function(_0xf1b697){logger[_0x5302('0xd')](_0x5302('0xe'),_0x41c3d6,_0x5302('0xf'));logger['debug'](_0x5302('0x10'),_0x41c3d6,_0x5302('0xf'),JSON[_0x5302('0x11')](_0xf1b697));if(_0xf1b697[_0x5302('0x12')]){if(_0xf1b697['error'][_0x5302('0x13')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x41c3d6,_0xf1b697[_0x5302('0x12')][_0x5302('0x14')]);return _0x40505e(_0xf1b697[_0x5302('0x12')][_0x5302('0x14')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x41c3d6,_0xf1b697['error'][_0x5302('0x14')]);return _0x54884e(_0xf1b697[_0x5302('0x12')]['message']);}else{logger[_0x5302('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x41c3d6,'request\x20sent');_0x54884e(_0xf1b697[_0x5302('0x15')]['message']);}})[_0x5302('0x16')](function(_0x47b4a2){logger[_0x5302('0x12')](_0x5302('0xe'),_0x41c3d6,_0x47b4a2);_0x40505e(_0x47b4a2);});});}