Built motion from commit d5e4af8c.|2.6.23
[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 _0x09e4=['code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31b813,_0x3792c3){var _0x3d6737=function(_0x163a79){while(--_0x163a79){_0x31b813['push'](_0x31b813['shift']());}};_0x3d6737(++_0x3792c3);}(_0x09e4,0x1ce));var _0x409e=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x09e4[_0x1b5080];return _0x195c87;};'use strict';var _=require(_0x409e('0x0'));var util=require(_0x409e('0x1'));var moment=require(_0x409e('0x2'));var BPromise=require(_0x409e('0x3'));var rs=require(_0x409e('0x4'));var fs=require('fs');var Redis=require(_0x409e('0x5'));var db=require(_0x409e('0x6'))['db'];var utils=require(_0x409e('0x7'));var logger=require('../../config/logger')(_0x409e('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x409e('0x9')][_0x409e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcb9d17,_0x3f124e,_0x5d718e){return new BPromise(function(_0x21255d,_0x420144){return client[_0x409e('0xb')](_0xcb9d17,_0x5d718e)[_0x409e('0xc')](function(_0x5305d4){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x3f124e,_0x409e('0xd'));logger[_0x409e('0xe')](_0x409e('0xf'),_0x3f124e,'request\x20sent',JSON[_0x409e('0x10')](_0x5305d4));if(_0x5305d4[_0x409e('0x11')]){if(_0x5305d4[_0x409e('0x11')][_0x409e('0x12')]===0x1f4){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);return _0x420144(_0x5305d4['error']['message']);}logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x5305d4['error'][_0x409e('0x14')]);return _0x21255d(_0x5305d4[_0x409e('0x11')][_0x409e('0x14')]);}else{logger[_0x409e('0x15')](_0x409e('0x13'),_0x3f124e,_0x409e('0xd'));_0x21255d(_0x5305d4[_0x409e('0x16')][_0x409e('0x14')]);}})[_0x409e('0x17')](function(_0x59fd27){logger[_0x409e('0x11')](_0x409e('0x13'),_0x3f124e,_0x59fd27);_0x420144(_0x59fd27);});});}