Built motion from commit 775e2a94.|2.6.3
[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 _0x8ab2=['info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','DeskConfiguration,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request'];(function(_0xcf620d,_0x1ce714){var _0x2712bc=function(_0x59fdc3){while(--_0x59fdc3){_0xcf620d['push'](_0xcf620d['shift']());}};_0x2712bc(++_0x1ce714);}(_0x8ab2,0x89));var _0x28ab=function(_0xd0ce,_0x326c6a){_0xd0ce=_0xd0ce-0x0;var _0x4f4b12=_0x8ab2[_0xd0ce];return _0x4f4b12;};'use strict';var _=require(_0x28ab('0x0'));var util=require(_0x28ab('0x1'));var moment=require(_0x28ab('0x2'));var BPromise=require('bluebird');var rs=require(_0x28ab('0x3'));var fs=require('fs');var Redis=require(_0x28ab('0x4'));var db=require(_0x28ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x28ab('0x6'));var config=require(_0x28ab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x28ab('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41e7f2,_0x53d46d,_0x259484){return new BPromise(function(_0x298a42,_0x16b9fe){return client[_0x28ab('0x9')](_0x41e7f2,_0x259484)['then'](function(_0x5f3827){logger[_0x28ab('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x53d46d,_0x28ab('0xb'));logger[_0x28ab('0xc')](_0x28ab('0xd'),_0x53d46d,_0x28ab('0xb'),JSON[_0x28ab('0xe')](_0x5f3827));if(_0x5f3827[_0x28ab('0xf')]){if(_0x5f3827[_0x28ab('0xf')][_0x28ab('0x10')]===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x53d46d,_0x5f3827[_0x28ab('0xf')][_0x28ab('0x11')]);return _0x16b9fe(_0x5f3827['error'][_0x28ab('0x11')]);}logger[_0x28ab('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x53d46d,_0x5f3827[_0x28ab('0xf')]['message']);return _0x298a42(_0x5f3827[_0x28ab('0xf')]['message']);}else{logger[_0x28ab('0xa')]('DeskConfiguration,\x20%s,\x20%s',_0x53d46d,'request\x20sent');_0x298a42(_0x5f3827[_0x28ab('0x12')][_0x28ab('0x11')]);}})[_0x28ab('0x13')](function(_0x3b4a7c){logger['error'](_0x28ab('0x14'),_0x53d46d,_0x3b4a7c);_0x16b9fe(_0x3b4a7c);});});}